1 Introduction

Throughout the paper, a graph means a finite simple graph. A finite graph allowed to have a multiple edge or a loop is called a multigraph. For a graph G, we set \(V(G)=\{v_1,\ldots , v_n\}\), \(E(G)=\{e_1,\ldots ,e_m\}\) and \(\mathbb {e}=(e_1,\ldots ,e_m)\) unless otherwise specified. For a positive integer n, we denote \(\{1,\ldots ,n\}\) by [n]. For an integer vector \(\mathbb {b}\), \(\mathbb {b}^+\) (resp. \(\mathbb {b}^-\)) means the vector whose ith entry is \(\max \{b_i,0\}\) (resp. \(-\min \{b_i,0\}\)). For an integer vector \(\mathbb {x}=(x_1,\ldots ,x_m)\), \(\mathbb {e}^{\mathbb {x}}\) means a monomial \(e_1^{x_1}e_2^{x_2}\cdots e_m^{x_m}\).Footnote 1

Let \(K[e_1,\ldots ,e_m]\) be a polynomial ring in m variables over a field K. For an \(n\times m\) integer matrix A without zero columns, the ideal

$$\begin{aligned} I_A=\left\langle \mathbb {e}^{\mathbb {b}^+} - \mathbb {e}^{\mathbb {b}^-} \in K[e_1,\ldots ,e_m] \mid \mathbb {b}\in {\mathbb {Z}}^m \text { and } A\mathbb {b}=\mathbb {0} \right\rangle \end{aligned}$$

is called the toric ideal associated with A. It is well known that a toric ideal is a prime binomial ideal. For more details about toric ideals and related topics, see [11, 25].

A (homogeneous) toric ideal not only defines a projective toric variety (see [6, 24]), but also provides wide applications in other areas, such as algebraic statistics, dynamical system, hypergeometric differential equations, toric geometry, and graph theory, see [5, 14, 25]. Toric ideals arising from various kinds of combinatorial objects have been widely studied by many researchers, see [12, 13, 19, 20] for some recent results. Particularly, the toric ideal of a graph or a digraph, which is the toric ideal associated with its vertex-edge incidence matrix, has been an interesting topic (see [2,3,4, 7, 8, 17, 18, 21, 22]).

A major line of research on toric ideal arising from a combinatorial object focuses on a ‘special’ set of binomials of the ideal (giving a combinatorial interpretation). Among them, the set of primitive binomials, which is known to form the Graver basis, was studied widely related to a problem initiated by Sturmfels, called true degree problem. (See [23, 25, 26, 28] for detail.) For a toric ideal \(I_A\), an irreducible binomial \(B=B^+-B^-\) of \(I_A\) is primitive if there exists no other binomial \(B_0=B_0^+-B_0^-\) such that \(B_0^+|B^+\) and \(B_0^-|B^-\). For the toric ideal of a graph, the primitive binomials and some other important binomials were characterized in [22]. The primitive binomials of the toric ideal of a digraph are nicely stated in [8, 9]. See Sect. 2.2.1 for the primitive binomials of the toric ideal of a graph/digraph.

Another important research direction on a toric ideal is about the complete intersection property. A toric ideal \(I_A\) associated with an \(n\times m\) integer matrix A has the height \(\text {ht}(I_ A ) = m- \text {rank}(A)\). We say \(I_A\) is a complete intersection if it is generated by \(\text {ht}(I_A)\) elements (see [25]). A complete intersection toric ideal was first studied by Herzog in [10], and it is known that the Hilbert series of the corresponding quotient ring R/I can be computed easily when I is a complete intersection. The complete intersection property of the toric ideal from a combinatorial object was also investigated by many researchers, see [1, 2, 7,8,9, 15, 16, 21, 27]. We summarize some known results on the toric ideals of graphs/digraphs in Sect. 2.2.2.

In this paper, we consider toric ideals of signed graphs, as a generalization of graphs and digraphs. An incidence of a graph G is a pair (ev) of an edge e and a vertex v such that v is an endpoint of e. A sign \(\tau \) of G is a function from the set of all incidences to the set \(\{1,-1\}\), and a signed graph is a pair \((G,\tau )\) of a graph G and its sign \(\tau \). For a signed graph \((G,\tau )\) with n vertices and m edges, the incidence matrix \(A(G,\tau )\) of \((G,\tau )\) is an \(n\times m\) matrix whose rows are labeled by the vertices \(v_1, \ldots , v_n\) and columns are labeled by the edges \(e_1, \ldots , e_m\) such that \([A(G,\tau )]_{ij}=\tau (e_j,v_i)\) if \(v_i\) is incident to \(e_j\), and \([A(G,\tau )]_{ij}=0\) otherwise. With an abuse of notation, we often consider the codomain of \(\tau \) is \(\{+,-\}\). See Fig. 1 for an example.

Fig. 1
figure 1

A signed graph \((G,\tau )\) and its incidence matrix \(A(G,\tau )\)

We remark that if a sign \(\tau \) is a constant function, then \((G,\tau )\) is just a graph. If a sign \(\tau \) satisfies that \(\tau (e,u) \tau (e,v)=-1\) for each edge \(e=uv\), then \((G,\tau )\) is equal to a digraph. The toric ideal of a signed graph \((G,\tau )\), denoted by \(I_{(G,\tau )}\), is the toric ideal associated with the incidence matrix \(A(G,\tau )\) in the polynomial ring \(K[e_1,\ldots ,e_m]\) over a field K.

As long as the authors are aware, the toric ideal of a signed graph is firstly considered in this paper, and so we start our research from a fundamental question on generators. We completely characterize the primitive binomials of \(I_{(G,\tau )}\) of a signed graph \((G,\tau )\) with graph theory language. This gives a way to explain the previous results on graphs/digraphs in a unified idea. The latter part of the paper sheds light on the complete intersection property of \(I_{(G,\tau )}\). We give a necessary and sufficient condition for a graph G to have a complete intersection \(I_{(G,\tau )}\) for every sign \(\tau \), see Theorems 3.9 and 3.10 . We emphasize that this result is more than unifying the results of graphs/digraphs in [2, 8], since there are infinitely many graphs G such that the toric ideal of G and its every orientation are complete intersections but \(I_{(G,\tau )}\) is not a complete intersection for some sign \(\tau \) (see Sect. 3). Lastly, we find a full list of such graphs without assuming 2-connectedness, see Theorem 3.9.

2 Preliminaries

This section gives some basic notion and terminology in graphs and then summarizes some known results on toric ideals of graphs and digraphs. In addition, we explain how to define binomials from walks in a signed graph, which generate \(I_{(G,\tau )}\).

2.1 Basic notion for walks in a graph

For a graph G, let \({\mathbf {w}}: v_{i_1}e_{j_1} \cdots e_{j_t}v_{i_{t+1}}\) be a walk or \((v_{i_1},v_{i_{t+1}})\)-walk, which is an alternating sequence of vertices \(v_i\)’s and edges \(e_j\)’s where \(e_{j_{\ell }}=v_{i_{\ell }}v_{i_{\ell +1}}\) for each \(\ell \in [t]\). We call \(v_{i_{\ell }}\) (resp. \(e_{j_{\ell }}\)) the \(\ell \)th vertex (resp. edge) term of \({\mathbf {w}}\). A vertex term is said to be internal if it is neither first nor last. We let \(V({\mathbf {w}})\) be the set of vertex terms of \({\mathbf {w}}\) and \(E({\mathbf {w}})\) be the multiset of the edge terms in \({\mathbf {w}}\). We denote the multigraph with the vertex set \(V({\mathbf {w}})\) and the edge set \(E({\mathbf {w}})\) by \([{\mathbf {w}}]\). The underlying simple graph of \([{\mathbf {w}}]\) is a subgraph of G, but \([{\mathbf {w}}]\) may not be a subgraph of G by multiple edges. See Fig. 2.

Fig. 2
figure 2

A walk \({\mathbf {w}}\) in a graph G and \(V({\mathbf {w}})\), \(E({\mathbf {w}})\), and \([{\mathbf {w}}]\)

The length of \({\mathbf {w}}\) is the number of edge terms in \({\mathbf {w}}\). A subwalk of \({\mathbf {w}}\) is a subsequence of \({\mathbf {w}}\) which is a walk, and a section is a subwalk consisting of consecutive terms of \({\mathbf {w}}\). When we consider a subwalk or a section of a closed walk \({\mathbf {w}}\), the terms are considered cyclically so that the last edge term is consecutive to the first vertex term.

For two walks \({\mathbf {w}}\) and \({\mathbf {w}}'\) in a graph, if the last vertex term of \({\mathbf {w}}\) and the first vertex term of \({\mathbf {w}}'\) are equal, then we denote by \({\mathbf {w}}+{\mathbf {w}}'\) the walk going through \({\mathbf {w}}\) and then \({\mathbf {w}}'\). If \({\mathbf {w}}_0, \ldots , {\mathbf {w}}_k\) are sections of a walk \({\mathbf {w}}\) such that \({\mathbf {w}}={\mathbf {w}}_0+\cdots +{\mathbf {w}}_k\), then we call this form a section decomposition of \({\mathbf {w}}\). If every \({\mathbf {w}}_i\) is a nontrivial walk, then we say it is nontrivial.

The walk obtained by reading a walk \({\mathbf {w}}\) in the reverse order is denoted by \({\mathbf {w}}^{-1}\). For a closed walk \({\mathbf {w}}: v_{i_1}e_{j_1}\cdots e_{j_t}v_{i_1}\) \((t\ge 2)\), we say a vertex \(v\in V({\mathbf {w}})\) is repeated if v appears in \(v_{i_1}e_{j_1}v_{i_2}\cdots v_{i_t}\) (\(e_{j_t}v_{i_1}\) is deleted from \({\mathbf {w}}\)) at least two times. Note that if a closed walk \({\mathbf {w}}\) has a repeated vertex \(v\in V({\mathbf {w}})\), then \({\mathbf {w}}\) has a nontrivial section decomposition \({\mathbf {w}}_0+{\mathbf {w}}_1\) for some closed walks \({\mathbf {w}}_0\) and \({\mathbf {w}}_1\) (whose first vertex terms are v).

2.2 Toric ideals of graphs and digraphs

Recall that the toric ideal \(I_G\) of a graph (resp. digraph) G is the toric ideal \(I_{(G,\tau )}\) when \(\tau \) is a constant function (resp. \(\tau (e,u)\tau (e,v)=-1\) for every edge \(e=uv\)). In this section, we summarize some previous results on the toric ideals of graphs/digraphs, which will be used in this paper.

2.2.1 Primitive binomials

Let A be an \(n\times m\) matrix without zero columns. An irreducible binomial of \(I_A\) has a form of \(\mathbb {e}^{\mathbb {b}^+}-\mathbb {e}^{\mathbb {b}^-}\) for some \(\mathbb {b}\in {\mathbb {Z}}^{m}\) with \(A\mathbb {b}=\mathbb {0}\). An irreducible binomial \(\mathbb {e}^{\mathbb {b}^+}-\mathbb {e}^{\mathbb {b}^-}\) is called primitive if there exists no other binomial \(\mathbb {e}^{\mathbb {c}^+}-\mathbb {e}^{\mathbb {c}^-}\) such that \(\mathbb {e}^{\mathbb {c}^+}| \mathbb {e}^{\mathbb {b}^+}\) and \(\mathbb {e}^{\mathbb {c}^-}|\mathbb {e}^{\mathbb {b}^-}\).

For a closed nontrivial walk \({\mathbf {w}}: v_{i_1}e_{j_1}\cdots v_{i_{2t}}e_{j_{2t}}v_{i_1}\) of even length in a graph G, let \(B_{{\mathbf {w}}}=B^+-B^-\), where \(B^+=e_{j_1}e_{j_3}\cdots e_{j_{2t-1}}\) and \(B^-=e_{j_2}e_{j_4}\cdots e_{j_{2t}}\). Here, the same closed walk can be written in different ways but associated binomials differ only in the sign. It is observed that (see [29]) \(I_G\) is generated by those binomials \(B_{{\mathbf {w}}}\). A necessary condition for the primitive binomials was firstly studied in [18] and a necessary and sufficient condition was established in [22] as follows. When two graphs G and \(G'\) contain cliques K and \(K'\) of size k, respectively, a graph obtained from G and \(G'\) by identifying K and \(K'\) is called a k-clique sum of G and \(G'\).

Theorem 2.1

[22, Theorem 3.2] For a closed walk \({\mathbf {w}}\) of even length in a graph, the binomial \(B_{\mathbf {w}}\) is primitive if and only if the following hold:

  1. (i)

    The multigraph \([{\mathbf {w}}]\) is constructed by 1-clique sums of cycles of length at least two such that every vertex of \([{\mathbf {w}}]\) belongs to at most two cycles.

  2. (ii)

    For every nontrivial section decomposition \({\mathbf {w}}={\mathbf {w}}_0+{\mathbf {w}}_1\) into two closed walks \({\mathbf {w}}_0\) and \({\mathbf {w}}_1\), the length of each \({\mathbf {w}}_i\) is odd.

In [22], other important sets of binomials in \(I_G\) were also characterized and we omit them here as it is not related to our main purposes.

Let G be a graph and D be its orientation. The primitive binomials of \(I_D\) are much more simply described. For every cycle \({\mathbf {w}}\) of G, we define \(B_{{\mathbf {w}}}=B^+-B^-\), where \(B^+\) is the product of the clockwise oriented edges and \(B^-\) is the product of the other edges.

Theorem 2.2

[8, Proposition 2] For a graph G, let D be its orientation. The primitive binomials of \(I_D\) are binomials \(B_{{\mathbf {w}}}\) associated with cycles \({\mathbf {w}}\) of G.

2.2.2 The complete intersection property

Recall that the toric ideal \(I_A\) is a complete intersection if it can be generated by \(\mathrm {ht}(I)\) elements, where \(\mathrm {ht}(I)\) is the height of I. It also holds that \(\mathrm {ht}(I_A)=m-\mathrm {rank}(A)\). For a connected graph G with n vertices and m edges, \(I_G\) is a complete intersection if and only if it is generated by r(G) binomials, where

$$\begin{aligned} r(G)={\left\{ \begin{array}{ll} m-n+1&{}\text {if }G\text { is bipartite},\\ m-n&{}\text {otherwise. } \end{array}\right. } \end{aligned}$$

For a disconnected graph G, \(I_G\) is a complete intersection if every connected component of G has a complete intersection toric ideal. Let \({\mathcal {G}}^{ci}\) be the set of all graphs with complete intersection toric ideals. The bipartite graphs in \({\mathcal {G}}^{ci}\) are nicely characterized as follows.

Theorem 2.3

[9, Corollary 3.4] For a connected bipartite graph G, \(G\in {\mathcal {G}}^{ci}\) if and only if G is a ring graph. Here, a ring graph is a graph whose nonedge block is constructed by 2-clique sums of cycles.

A pseudo-code to check whether a graph is in \({\mathcal {G}}^{ci}\) or not is given in [2], see Algorithm 2.4. The algorithm relies on inductive idea, which may not give an exact description on structures of graphs in \({\mathcal {G}}^{ci}\). Instead, useful structural properties are provided in [2, 27], and some are listed in Theorem 2.5. For a graph H, the number of connected components which are bipartite is denoted by b(H).

figure a

Theorem 2.5

[2, Theorem 3.6, Corollary 3.9, Lemma 6.2], [27, Theorem 3.1, Corollary 5.6] Let G be a connected graph in \({\mathcal {G}}^{ci}\). Then, the following hold:

  1. (i)

    If G is not bipartite, then \(2|E(G)|\le 3|V(G)|-\sum _{v\in V(G)} b(G-v)\).

  2. (ii)

    G has no \(K_{2,3}\) as a subgraph.

  3. (iii)

    If G is 2-connected and has two cycles C and \(C'\) of odd length sharing exactly one vertex v, then there is an edge e not incident to v which connects C and \(C'\).

  4. (iv)

    If G is 2-connected and has disjoint two cycles C and \(C'\) of odd length, then there are two disjoint edges \(e_1\) and \(e_2\) such that each \(e_i\) connects C and \(C'\).

  5. (v)

    G has at most two nonbipartite blocks.

  6. (vi)

    Every induced subgraph of G belongs to \( {\mathcal {G}}^{ci}\).

In [2], 3-regular graphs with complete intersection toric ideals are characterized, see Theorem 2.6. Instead of giving the definitions of bands or Möbius bands, we note that the complete graph \(K_4\) is an even Möbius band. For the definitions, see [2, Definition 4.2].

Theorem 2.6

[2, Theorem 4.4] For a 3-regular connected graph G, \(G\in {\mathcal {G}}^{ci}\) if and only if it is an odd band or an even Möbius band.

The following lists results on digraphs. For a connected graph G with n vertices and m edges, and an orientation D of G, \(I_D\) is a (binomial) complete intersection if and only if it is generated by \(r(D)=m-n+1\) binomials. For an orientation D of a disconnected graph, \(I_D\) is a complete intersection if the toric ideal of the digraph restricted to every connected component of G is a complete intersection. Let \({\mathcal {G}}^{cio}\) be the set of graphs G such that \(I_D\) is generated a complete intersection for every orientation D of G.

Theorem 2.7

[8, Theorems 4 and 6, Corollary 4] Let G be a connected graph.

  1. (i)

    \(G\in {\mathcal {G}}^{cio}\) if and only if G is constructed by clique sums of complete graphs and/or cycles.

  2. (ii)

    Every induced subgraph of a graph in \({\mathcal {G}}^{cio}\) belongs to \({\mathcal {G}}^{cio}\).

2.3 Even-signed walks in \((G,\tau )\) and their associated binomials of \(I_{(G,\tau )}\)

In this subsection, we explain how to define binomials associated with closed walks in a signed graph, and this will play a key role in Sect. 3.

Definition 2.8

Let \({\mathbf {w}}:v_{i_1}e_{j_1}v_{i_2}\cdots e_{j_t}v_{i_{t+1}}\) be a walk in a signed graph \((G,\tau )\) of length at least two. An internal vertex term \(v_{i_{\ell }}\) of \({\mathbf {w}}\) is unbalanced if \(\tau (e_{j_{\ell -1}},v_{i_{\ell }})\tau (e_{j_{\ell }},v_{i_{\ell }})=1\). As long as \({\mathbf {w}}\) is closed, we say \(v_{i_1}\) (or \(v_{i_{t+1}}\)) is unbalanced if \(\tau (e_{j_t},v_{i_1})\tau (e_{j_1},v_{i_1})=1\). We define \(\mu ({\mathbf {w}})=(-1)^{k}\), where k is the number of unbalanced vertex terms of \({\mathbf {w}}\). We also say \({\mathbf {w}}\) is even-signed if \(\mu ({\mathbf {w}})=1\), and \({\mathbf {w}}\) is odd-signed if \(\mu ({\mathbf {w}})=-1\).

Throughout the paper, a walk/cycle with odd/even number of edge terms is said to be a walk/cycle of odd/even length. A triangle means a cycle of length three.

A balanced section \({\mathbf {w}}_0\) of a walk \({\mathbf {w}}\) is a maximal section of \({\mathbf {w}}\) such that \({\mathbf {w}}_0\) has no internal unbalanced vertex term. If \({\mathbf {w}}_0+\cdots +{\mathbf {w}}_k\) is a section decomposition of \({\mathbf {w}}\) such that each \({\mathbf {w}}_i\) is a balanced section, then this form is called a balanced section decomposition of \({\mathbf {w}}\).

For a closed walk \({\mathbf {w}}\), if it has no unbalanced vertex term, then it is even-signed and has exactly one balanced section which is itself. Otherwise, its balanced section decomposition \({\mathbf {w}}_0+\cdots +{\mathbf {w}}_k\) is also unique up to cyclic permutations. So, by choosing an unbalanced vertex as the first vertex term properly, we can denote by \({\mathbf {w}}={\mathbf {w}}_0+\cdots +{\mathbf {w}}_k\).

Example 2.9

Consider a signed graph \((G,\tau )\) in Fig. 3, and its two closed walks \({\mathbf {w}}\) and \({\mathbf {w}}'\), where

$$\begin{aligned} {\mathbf {w}}:v_3e_3v_4 e_4 v_5e_5v_1e_6v_3e_2v_2e_1v_1e_6v_3,\quad {\mathbf {w}}':v_1e_1v_2e_2v_3e_6v_1e_5v_5e_5v_1. \end{aligned}$$
Fig. 3
figure 3

A signed graph \((G,\tau )\) and two closed walks \({\mathbf {w}}\) and \({\mathbf {w}}'\)

For a closed walk \({\mathbf {w}}\), the 2nd, 3rd, 4th, and 6th vertex terms are the unbalanced vertex terms, which implies that \({\mathbf {w}}\) is an even-signed walk in \((G,\tau )\) and the balanced sections are

$$\begin{aligned} {\mathbf {w}}_0: v_2e_1v_1e_6v_3e_3v_4, \quad {\mathbf {w}}_1: v_4 e_4 v_5, \quad {\mathbf {w}}_2: v_5e_5v_1, \quad {\mathbf {w}}_3: v_1e_6v_3e_2v_2. \end{aligned}$$

The walk has a balanced section decomposition \({\mathbf {w}}_0+{\mathbf {w}}_1+{\mathbf {w}}_2+{\mathbf {w}}_3\). For the closed walk \({\mathbf {w}}'\), there are three unbalanced vertex terms, the 2nd, 4th, and 5th vertex terms, which implies that \({\mathbf {w}}'\) is odd-signed in \((G,\tau )\) and its balanced sections are

$$\begin{aligned} {\mathbf {w}}'_0: v_5e_5v_1{e_1}v_2, \quad {\mathbf {w}}'_1: v_2e_2v_3e_6v_1, \quad {\mathbf {w}}'_2: v_1e_5v_5, \end{aligned}$$

and \({\mathbf {w}}'_0+{\mathbf {w}}'_1+{\mathbf {w}}'_2\) is a balanced section decomposition of \({\mathbf {w}}'\). Note that by taking the first vertex term of \({\mathbf {w}}\) or \({\mathbf {w}}'\) properly, we can write \({\mathbf {w}}={\mathbf {w}}_0+{\mathbf {w}}_1+{\mathbf {w}}_2+{\mathbf {w}}_3\) or \({\mathbf {w}}'={\mathbf {w}}'_0+{\mathbf {w}}'_1+{\mathbf {w}}'_2\).

Definition 2.10

Let \({\mathbf {w}}\) be an even-signed closed walk in a signed graph, and \({\mathbf {w}}_0+ {\mathbf {w}}_1+\cdots + {\mathbf {w}}_{2k-1}\) be its balanced section decomposition (\(k\ge 1\)). The binomial \(B_{{\mathbf {w}}}\) associated with \({\mathbf {w}}\) is \(B_{{\mathbf {w}}}=B_{{\mathbf {w}}}^+ -B_{{\mathbf {w}}}^-\) where

$$\begin{aligned} B_{{\mathbf {w}}}^+=\prod _{i:\text {even}}\prod _{e\in E({{\mathbf {w}}}_{i})}e\qquad \text {and}\qquad B_{{\mathbf {w}}}^-=\prod _{i:\text {odd}}\prod _{e\in E({{\mathbf {w}}}_{i})}e. \end{aligned}$$

If \({\mathbf {w}}\) has no unbalanced vertex term, then it is defined by \(B_{{\mathbf {w}}}^+=\prod _{e\in E({\mathbf {w}})}e \) and \(B_{{\mathbf {w}}}^-=1\).

Since \({\mathbf {w}}\) has an even number of unbalanced vertex terms, its binomial is unique up to sign. That is, the binomial is either \(B_{{\mathbf {w}}}\) or \(-B_{{\mathbf {w}}}\) according to its balanced section decomposition. For the even-signed closed walk \({{\mathbf {w}}}\) in \((G,\tau )\) in Example 2.9, \(B_{{\mathbf {w}}}=e_2e_4e_6-e_1e_3e_5e_6\) (one may say \(B_{{\mathbf {w}}}=e_1e_3e_5e_6-e_2e_4e_6\)).

Observation 2.11

If \({\mathbf {w}}\) is an even-signed closed walk in a signed graph \((G,\tau )\), then \(B_{{\mathbf {w}}}\in I_{(G,\tau )}\).

Proof

Let \({\mathbf {w}}:v_{i_1}e_{j_1} \cdots v_{i_t} e_{j_t} v_{i_1}\) be an even-signed closed walk in \((G,\tau )\). We may assume that the first vertex term is unbalanced, and let \({\mathbf {w}}={\mathbf {w}}_0+\cdots +{\mathbf {w}}_{2k-1}\) be a balanced section decomposition of \({\mathbf {w}}\). For each edge term \(e_{j_{\ell }}\), we let \(\kappa (e_{j_{\ell }})=(-1)^{s}\) if \(e_{j_{\ell }}\) belongs to the section \({\mathbf {w}}_s\).

Let \(\mathbb {b}=(b_e)_{e\in E(G)}\) be a vector such that \(b_e=f^+(e)-f^{-}(e)\) for every edge e, where

$$\begin{aligned} f^+(e)= | \{\ell \mid e_{j_{\ell }}=e\text { and }\kappa (e_{j_{\ell }})=1\} |,\qquad f^-(e)= | \{\ell \mid e_{j_{\ell }}=e\text { and }\kappa (e_{j_{\ell }}) =-1 \}|. \end{aligned}$$

Then, the entry of \(A\mathbb {b}\) corresponding to a vertex v is

$$\begin{aligned}&\sum _{\begin{array}{c} e: v\in e \end{array}} (f^+(e)-f^-(e)) \tau (e,v) = \sum _{\begin{array}{c} e: v\in e \end{array}} \sum _{\ell :e_{j_{\ell }}=e} \kappa (e_{j_{\ell }}) \tau (e,v)\\&\quad =\sum _{\ell :v_{i_{\ell }}=v} \left( \kappa (e_{j_{\ell -1}})\tau (e_{j_{\ell -1}},v) +\kappa (e_{j_{\ell }}) \tau (e_{j_{\ell }},v) \right) . \end{aligned}$$

If \(\kappa (e_{j_{\ell }})=\kappa (e_{j_{\ell -1}})\), then \(\tau (e_{j_{\ell -1}},v) =-\tau (e_{j_{\ell }},v)\), and if \(\kappa (e_{j_{\ell }})\ne \kappa (e_{j_{\ell -1}})\), then \(\tau (e_{j_{\ell -1}},v) =\tau (e_{j_{\ell }},v)\). In both cases, the sum \(\kappa (e_{j_{\ell -1}})\tau (e_{j_{\ell -1}},v) +\kappa (e_{j_{\ell }})\tau (e_{j_{\ell }},v)\) is 0. This implies that \(\mathbb {e}^{\mathbb {b}^+}-\mathbb {e}^{\mathbb {b}^-}\in I_{(G,\tau )}\).

On the other hand, from the definition, \(\mathbb {e}^{\mathbb {x}} (\mathbb {e}^{\mathbb {b}^+}-\mathbb {e}^{\mathbb {b}^-})=B_{{\mathbf {w}}}\), where \(\mathbb {x}=(x_e)_{e\in E(G)}\) is the vector such that \(x_e=\min \{f^+(e),f^-(e)\}\) for every edge e. Thus, \(B_{{\mathbf {w}}}\) is an element of \(I_{(G,\tau )}\). \(\square \)

It seems natural to have the following proposition from the definition of \(I_{(G,\tau )}\).

Proposition 2.12

If \((G,\tau )\) is a signed graph, then the toric ideal \(I_{(G,\tau )}\) is generated by

$$\begin{aligned} \{B_{{\mathbf {w}}}\mid {\mathbf {w}}\text { is an even-signed closed walk in }(G,\tau )\}. \end{aligned}$$

The above proposition immediately follows from Observation 2.11 and Proposition 2.13, and we leave the proof detail of Proposition 2.13 in Appendix.

Proposition 2.13

Let \((G,\tau )\) be a signed graph, and \(\mathbb {b}={(b_e)}_{e\in E(G)}\) be a nonzero integer vector such that \(A\mathbb {b}=\mathbb {0}\), where \(A=A(G,\tau )\). If we denote by \((G_{\mathbb {b}},\tau _{\mathbb {b}})\) the signed multigraph induced by \(|b_e|\) copies of e for every edge e with its sign copied, then each connected component D of \(G_{\mathbb {b}}\) has an Eulerian \({\mathbf {w}}_D\) which is an even-signed closed walk in \((G,\tau )\) and

$$\begin{aligned} \mathbb {e}^{\mathbb {b}^+}-\mathbb {e}^{\mathbb {b}^-} =\prod _{\begin{array}{c} D:\text {connected}\\ \text {component of }G_{\mathbb {b}} \end{array}} B_{{\mathbf {w}}_D}^+ \ - \ \prod _{\begin{array}{c} D:\text {connected} \\ \text {component of }G_{\mathbb {b}} \end{array} } B_{{\mathbf {w}}_D}^-. \end{aligned}$$

3 The main results

In this section, we state the main results of the paper. Section 3.1 focuses on the primitive binomials of \(I_{(G,\tau )}\), and Sect. 3.2 gives characterizations of graphs G with a complete intersection \(I_{(G,\tau )}\) for every sign \(\tau \).

3.1 Primitive binomials of \(I_{(G,\tau )}\)

We characterize all primitive binomials in \(I_{(G,\tau )}\).

Theorem 3.1

For an even-signed closed walk \({\mathbf {w}}\) in a signed graph, \(B_{\mathbf {w}}\) is primitive if and only if the following hold:

  1. (i)

    The multigraph \([{\mathbf {w}}]\) is constructed by 1-clique sums of cycles of length at least two such that every vertex of \([{\mathbf {w}}]\) belongs to at most two cycles.

  2. (ii)

    For every nontrivial section decomposition \({\mathbf {w}}={\mathbf {w}}_0+{\mathbf {w}}_1\) into two closed walks \({\mathbf {w}}_0\) and \({\mathbf {w}}_1\), each \({\mathbf {w}}_i\) is odd-signed in \((G,\tau )\).

A proof of Theorem 3.1 is given in Sect. 5.1. We often say an even-signed closed walk \({\mathbf {w}}\) in a signed graph \((G,\tau )\) is primitive if \(B_{{\mathbf {w}}}\) is primitive in \(I_{(G,\tau )}\). Figure 4 shows an image of the multigraph \([{\mathbf {w}}]\) for a primitive walk \({\mathbf {w}}\). Note that if \({\mathbf {w}}\) is a primitive walk, then every cut vertex of \([{\mathbf {w}}]\) decomposes \([{\mathbf {w}}]\) into two parts, and each part corresponds to an odd-signed closed walk in \((G,\tau )\).Footnote 2

Fig. 4
figure 4

The multigraph \([{\mathbf {w}}]\), where \({\mathbf {w}}\) is an even-signed closed walk in a signed graph \((G,\tau )\). If \((G,\tau )\) has no even-signed cycle, then \({\mathbf {w}}\) is primitive

Example 3.2

Consider a signed graph \((G,\tau )\) in Fig. 5. Let \({\mathbf {w}}\) be a walk in \((G,\tau )\) defined by

$$\begin{aligned} {\mathbf {w}}:v_1e_1v_2e_2v_3e_3v_1e_4v_4e_5v_5e_6v_6e_7v_7e_8v_5e_9 v_8 e_{10}v_1. \end{aligned}$$

It has four balanced sections, and so \({\mathbf {w}}\) is an even-signed closed walk in \((G,\tau )\). See the vertex \(v_5\) which is repeated in \({\mathbf {w}}\). Then, \({\mathbf {w}}\) has a nontrivial section decomposition \({\mathbf {w}}_0+{\mathbf {w}}_1\) and each of \({\mathbf {w}}_0\) and \({\mathbf {w}}_1\) is an even-signed closed walk, where \({\mathbf {w}}_0:~v_5e_6v_6e_7v_7e_8v_5\) and \({\mathbf {w}}_1:~v_5e_9 v_8 e_{10}v_1e_1v_2e_2v_3e_3v_1e_4v_4e_5v_5\). Thus, its associated binomial \(B_{{\mathbf {w}}}\) is not primitive by Theorem 3.1(ii).

Fig. 5
figure 5

A signed graph \((G,\tau )\)

It is easy to see that Theorem 3.1 is a generalization of Theorem 2.1. Moreover, if you consider an orientation of a cycle as a signed graph, then it is an even-signed closed walk. Thus, every digraph has no odd-signed closed walk, which implies that Theorem 3.1 is also a generalization of Theorem 2.2.

3.2 The complete intersection property of the toric ideal \(I_{(G,\tau )}\)

We compute the rank of the incidence matrix of a connected signed graph first.

Proposition 3.3

Let \((G,\tau )\) be a connected signed graph. Then,

$$\begin{aligned} \mathrm {rank}(A(G,\tau ))={\left\{ \begin{array}{ll} |V(G)|-1 &{}\text {if there is no odd-signed closed walk in }(G,\tau ),\\ |V(G)| &{}\text {otherwise.} \end{array}\right. } \end{aligned}$$

See Appendix for the proof of Proposition 3.3. Due to the proposition and from the fact that ht\((I_{(G,\tau )})=m-\mathrm {rank}(A{(G,\tau )})\), we define the following.

Definition 3.4

Let \((G,\tau )\) be a connected signed graph. We say \((G,\tau )\) is a complete intersection when \(I_{(G,\tau )}\) is a (binomial) complete intersection, i.e., \(I_{(G,\tau )}\) is generated by \(r({G,\tau })\) binomials, where

$$\begin{aligned} r(G,\tau )={\left\{ \begin{array}{ll} |E(G)|-|V(G)|+1 &{}\text {if there is no odd-signed closed walk in }(G,\tau ),\\ |E(G)|-|V(G)| &{}\text {otherwise.} \end{array}\right. } \end{aligned}$$

For a disconnected signed graph, it is said to be a complete intersection if every connected component is a complete intersection. Let \({\mathcal {G}}^{cis}\) be the set of all graphs G such that \((G,\tau ) \) is a (binomial) complete intersection for every sign \(\tau \). It is natural to ask which graphs are in \({\mathcal {G}}^{cis}\), and we start from basic observations.

Proposition 3.5

Every block of a graph in \({\mathcal {G}}^{cis}\) belongs to \({\mathcal {G}}^{cis}\).

Proof

Let G be a graph in \({\mathcal {G}}^{cis}\) having a block H such that \(H\not \in {\mathcal {G}}^{cis}\). We may assume that G is connected. Then, there is a sign \(\tau \) of H such that \(I_{(H,\tau )}\) cannot be generated by \(r(H,\tau )\) binomials. Let t be the minimum number of binomials which generate \(I_{(H,\tau )}\). Then, \(t>r(H,\tau )\).

Let \(\tau '\) be the sign of G such that \(\tau '(e,v)=\tau (e,v)\) for every \(e\in E(H)\) and \(\tau '(e,v)\tau '(e,w)=-1\) for every \(e=vw\in E(G)\setminus E(H)\). Let \(X=\{ v\in V(G)\mid v\text { is contained in a block other than }H\}\). Since \(G\in {\mathcal {G}}^{cis}\subset {\mathcal {G}}^{cio}\), it follows that \(G[X]\in {\mathcal {G}}^{cio}\) by Theorem 2.7(ii). Note that \((G[X],\tau '|_X)\) can be understood as a digraph, and so \((G[X],\tau '|_X)\) has no odd-signed cycle. Thus,

$$\begin{aligned}&r(G,\tau ')=r(H,\tau )+(|E(G[X])|-|X|+c)=r(H,\tau )+(|E(G)|-|E(H)|-|X|+c),\nonumber \\ \end{aligned}$$
(3.1)

where \(c=|V(H)\cap X|\). Moreover, since G[X] has at least c components, we need at least \(|E(G)|-|E(H)|-|X|+c\) binomials to generate \(I_{(G[X],\tau '|_X)}\). Hence, in order to generate \(I_{(G,\tau ')}\), we need at least \(t+|E(G)|-|E(H)|-|X|+c\) binomials. Since \(t+|E(G)|-|E(H)|-|X|+c> r(G,\tau ')\) by (3.1), we reach a contradiction to the fact that \(G\in {\mathcal {G}}^{cis}\). \(\square \)

Proposition 3.6

Let H be either a cycle or a \(K_2\). For a connected graph G, let \(G'\) be a 1- or 2-clique sum of G and H. Let \(\tau '\) be a sign of \(G'\) such that \(\tau =\tau '|_{V(G)}\). Suppose that H is even-signed in \((G',\tau ')\) when H is a cycle. Then, \(I_{(G',\tau ')}\) is a complete intersection if and only if \(I_{(G,\tau )}\) is a complete intersection.

Proof

Suppose that H is a cycle. It is clear that \(r(G',\tau ')=r(G,\tau )+1\). Since C is a primitive walk in \((G',\tau ')\), its associated binomial generates \(I_{(G',\tau ')}\) together with a generating set of \(I_{(G,\tau )}\). If \(H=K_2\), then \(r(G',\tau ')=r(G,\tau )\) for every sign \(\tau '\) of \(G'\) and the primitive walks of \((G,\tau )\) and those of \((G',\tau ')\) are the same. Thus, the proposition holds. \(\square \)

Proposition 3.6 implies that for a graph G, if \(G\not \in {\mathcal {G}}^{cis}\), then a graph constructed by clique sums of G and cycles/\(K_2\) is not in \({\mathcal {G}}^{cis}\). Thus, the following holds.

Corollary 3.7

For a graph \(G\in {\mathcal {G}}^{cis}\) and an induced subgraph H of G, if G can be constructed by clique sums of H and cycles/\(K_2\), then H belongs to \({\mathcal {G}}^{cis}\).

Observation 3.8

A graph in \({\mathcal {G}}^{cis}\) is \(K_4\)-free.

Proof

First, we show that \(K_4\not \in {\mathcal {G}}^{cis}\). Following the labeling in Fig. 6, let \(\tau \) be a sign of \(K_4\) such that

$$\begin{aligned} \tau (e_4,v_1)=\tau (e_5,v_2)=\tau (e_6,v_3)=-1, \end{aligned}$$

and all the others have sign 1. By Theorem 3.1, there are only three primitive walks \({\mathbf {w}}_1\), \({\mathbf {w}}_2\), \({\mathbf {w}}_3\), which are defined as Fig. 6.Footnote 3 Then, we have \(B_{{\mathbf {w}}_1}= e_1e_5-e_3e_6\), \(B_{{\mathbf {w}}_2}= e_1e_4-e_2e_6\), and \(B_{{\mathbf {w}}_3}= e_2e_5-e_3e_4\). Note that each of three cannot be generated by the others. However, \(r(K_4,\tau )=2\), since \((K_4,\tau )\) has odd-signed cycles. Thus, \(I_{(K_4,\tau )}\) is not a complete intersection.

Fig. 6
figure 6

A complete graph \(K_4\) and its three closed walks

Suppose that there is a graph G in \({\mathcal {G}}^{cis}\) having \(K_4\) as a subgraph. We take such G as a smallest one. By Proposition 3.5, a block of G with \(K_4\) is in \({\mathcal {G}}^{cis}\). Thus, G is 2-connected. Moreover, by the above argument, \(G\ne K_4\). Since \(G\in {\mathcal {G}}^{cio}\), G is constructed by clique sums of cycles and/or complete graphs by Theorem 2.7(i). Since G is 2-connected, it follows that every clique sum to construct G is not a 1-clique sum. From the fact that \(G\in {\mathcal {G}}^{ci}\), by Theorem 2.5(ii), it follows that every clique sum to construct G is a 2-clique sum. If G is constructed by clique sums of exactly one \(K_4\) and cycles, then by Proposition 3.6 and the fact that \(K_4\not \in {\mathcal {G}}^{cis}\), it follows that \(G\not \in {\mathcal {G}}^{cis}\), a contradiction. Thus, G has at least two \(K_4\), say K and \(K'\). By Theorem 2.5(v), \(G[K\cup K']\) is in \({\mathcal {G}}^{ci}\). By applying Theorem 2.5(i) to \(G[K\cup K']\), we know that \(G[K\cup K']\) is a disjoint union of K and \(K'\). By Theorem 2.5(iv), every two vertex disjoint cycles of length three from K and \(K'\) are connected by two disjoint edges, which is a contradiction. \(\square \)

We remark that \({\mathcal {G}}^{cis}\) is a subset of \({\mathcal {G}}^{ci}\cap {\mathcal {G}}^{cio}\) by definitions, and so Observation 3.8 tells us from Theorem 2.7(i) that the (connected) graphs in \({\mathcal {G}}^{cis}\) are constructed by clique sums of cycles and/or \(K_2\). Among those graphs, we completely characterize all graphs in \({\mathcal {G}}^{cis}\). The following considers only 2-connected graphs in \({\mathcal {G}}^{cis}\), and its proof is given in Sect. 5.2.

Theorem 3.9

For a 2-connected graph G with at least three vertices, \(G\in {\mathcal {G}}^{cis}\) if and only if G is one of (G1)-(G5) for some \(m,n\ge 3\) (see Fig. 7):

  1. (G1)

    A cycle \(C_n\);

  2. (G2)

    A 2-clique sum of two cycles \(C_n\) and \(C_m\);

  3. (G3)

    : the graph obtained from \(C_3\) by gluing \(C_m\) and \(C_n\) to two distinct edges of \(C_3\) using 2-clique sum, respectively;

  4. (G4)

    : the graph obtained from \(C_4\) by gluing \(C_m\) and \(C_n\) to two opposite edges of \(C_4\) using 2-clique sum, respectively;

  5. (G5)

    : the graph obtained from by adding a diagonal edge of the middle \(C_4\).

Fig. 7
figure 7

Some graphs in Theorem 3.9

Now we characterize all graphs in \({\mathcal {G}}^{cis}\). The proof of Theorem 3.10 is given in Sect. 5.3, and see Fig. 8 for some graphs described in the theorem.

Theorem 3.10

For a graph G, G is in \({\mathcal {G}}^{cis}\) if and only if every connected component \(G'\) of G is one of the following:

  1. (i)

    \(G'\) is a tree.

  2. (ii)

    \(G'\) has exactly one nonedge block and it is isomorphic to one of (G1)\(\sim \)(G5).

  3. (iii)

    \(G'\) has exactly two nonedge blocks B and \(B'\), each of which is isomorphic to (G1) or (G2). When B is (G2), the vertex v of B closest to \(B'\) is on a triangle of B and \(\deg _{B}(v)=2\).

Fig. 8
figure 8

Examples of graphs in \({\mathcal {G}}^{cis}\) satisfying Theorem 3.10(iii)

We remark that from the structures of the graphs in Theorem 3.10, it follows that every induced subgraph of a graph in \({\mathcal {G}}^{cis}\) belongs to \({\mathcal {G}}^{cis}\).

Now, we finish the section by noting that it is not difficult to find graphs in \({\mathcal {G}}^{ci}\cap {\mathcal {G}}^{cio}\) which are not in \({\mathcal {G}}^{cis}\). A reader may already notice that \(K_4\) is such an example by Theorems 2.6 and 2.7 (i), and Observation 3.8. The following properties not only are helpful to understand Example 3.12 but also may give an idea to find graphs in \(({\mathcal {G}}^{ci}\cap {\mathcal {G}}^{cio})\setminus {\mathcal {G}}^{cis}\).

Let \({\mathbf {p}}:v_{0}e_{1}v_{1}\cdots e_{t}v_{t}\) be a path in G of length at least two such that \(v_{0}v_{t}\not \in E(G)\) and \(\deg _G(v_i)=2\) for each \(i \in [{t-1}]\) as depicted in Fig. 22. We call such path an ear of G, and we denote by \(G/{\mathbf {p}}\) the graph obtained from G by deleting the vertices \(v_{1}\), \(\ldots \), \(v_{t-1}\) and adding an edge between \(v_{0}\) and \(v_{t}\). We sometimes call \(G/{\mathbf {p}}\) a contraction of G by \({\mathbf {p}}\). The proof of the following proposition is given in Appendix.

Proposition 3.11

Let \({\mathbf {p}}:v_{0}e_{1}v_{1}\cdots e_{t}v_{t}\) (\(t\ge 2\)) be an ear of a graph G. Then, the following hold:

  1. (i)

    If \(G \in {\mathcal {G}}^{cis}\), then \(G/{\mathbf {p}} \in {\mathcal {G}}^{cis}\). (Equivalently, if a graph is not in \({\mathcal {G}}^{cis}\), then its subdivision is not in \({\mathcal {G}}^{cis}\).)

  2. (ii)

    If \(t\ge 3\) and \(G/{\mathbf {q}} \in {\mathcal {G}}^{cis}\), where \({\mathbf {q}}={\mathbf {p}}-v_t\), then \(G \in {\mathcal {G}}^{cis}\). (Equivalently, if \(G\not \in {\mathcal {G}}^{cis}\), then the graph obtained by contracting an edge \(e=uv\) with \(\deg _G(u)=\deg _G(v)=2\) is not in \({\mathcal {G}}^{cis}\).)

Example 3.12

Let G be the graph in Fig. 9. Then, \(G\not \in {\mathcal {G}}^{cis}\) and \(G\in {\mathcal {G}}^{ci}\cap {\mathcal {G}}^{cio}\).

First, we consider the graph \(G_0\) in Fig. 9. Note that if \(G_0\not \in {\mathcal {G}}^{ci}\) then \(G_0\not \in {\mathcal {G}}^{cis}\), which also implies that by Proposition 3.11(i), \(G\not \in {\mathcal {G}}^{cis}\). Thus, it is sufficient to show that \(G_0\not \in {\mathcal {G}}^{ci}\) by Algorithm 2.4. Note that for each \(i\in \{1,3,5\}\), vertex \(v_i\) of \(G_0\) has degree two and \(b(G_0-v_i)=b(G_0)\). We apply the algorithm to \(G_0\) with \(v_1\). Then, \(W=\{v_1,v_2,v_4,v_6\}\) and a shortest closed walk \({\mathbf {w}}_1\) of even length with \(V({\mathbf {w}}_1)=W\) is a cycle of length 4. Its associated binomial is \(B_{{\mathbf {w}}_1}=e_1e_8-e_6e_{7}\). Similarly, by considering the vertex \(v_3\) and \(v_5\) one by one, finally, we have \({\mathcal {B}}=\{B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_3}\}\) where \(B_{{\mathbf {w}}_2}=e_2e_8-e_3e_9\) and \(B_{{\mathbf {w}}_3}=e_4e_9-e_5e_7\). It remains to check if \(I_G=\left\langle {\mathcal {B}} \right\rangle \). However, \(B_{{\mathbf {w}}_4}\) cannot be generated by \({\mathcal {B}}\), where \(B_{{\mathbf {w}}_4}=e_1e_3e_5-e_2e_4e_6\) is the primitive binomial associated with \({\mathbf {w}}_4: v_1e_1v_2e_2v_3e_3v_4e_4v_5e_5v_6e_6v_1\). Thus, Algorithm 2.4 returns False, as a desired one.

Now, we will show that \(G\in {\mathcal {G}}^{ci}\cap {\mathcal {G}}^{cio}\). Since G is constructed by clique sums of cycles, \(G\in {\mathcal {G}}^{cio}\) by Theorem 2.7(i). It remains to check that \(G\in {\mathcal {G}}^{ci}\). Note that G has exactly six primitive walks \({\mathbf {x}}_1\sim {\mathbf {x}}_6\), defined as Fig. 9. Then, one can check from Corollary 4.5 that

$$\begin{aligned} B_{{\mathbf {x}}_4}\in \left\langle B_{{\mathbf {x}}_1},B_{{\mathbf {x}}_2}\right\rangle , \qquad B_{{\mathbf {x}}_5}\in \left\langle B_{{\mathbf {x}}_1}, B_{{\mathbf {x}}_3}\right\rangle , \qquad B_{{\mathbf {x}}_6}\in \left\langle B_{{\mathbf {x}}_2}, B_{{\mathbf {x}}_3}\right\rangle . \end{aligned}$$

Thus, \(I_G=\left\langle B_{{\mathbf {x}}_1},B_{{\mathbf {x}}_2},B_{{\mathbf {x}}_3}\right\rangle \), which implies that \(I_G\) is a complete intersection.

Fig. 9
figure 9

Graphs \(G_0\), G and primitive walks in G

4 Properties of walks in a signed graph

In this section, we investigate properties of even-signed closed walks in a signed graph \((G,\tau )\), which play an important role in the following section.

Lemma 4.1

In a signed graph \((G,\tau )\), for two closed walks \({\mathbf {w}}\) and \({\mathbf {w}}'\) sharing a vertex, \(\mu ({\mathbf {w}}+{\mathbf {w}}')=\mu ({\mathbf {w}})\mu ({\mathbf {w}}')\).

Proof

If \({\mathbf {w}}\) or \({\mathbf {w}}'\) is trivial, then it is clear. Suppose that both are nontrivial. Let \({\mathbf {w}}: ue_{j_1}v_{i_2}\cdots e_{j_t} u\) and \({\mathbf {w}}': ue'_{j_1}v'_{i_2}\cdots e'_{j_r} u\). Since \(\tau (e_{j_1},u)\tau (e_{j_t},u)=1\) (resp. \(\tau (e'_{j_1},u)\tau (e'_{j_r},u)=1\)) means that u is an unbalanced vertex term of \({\mathbf {w}}\) (resp. \({\mathbf {w}}'\)), \(\mu ({\mathbf {w}}+{\mathbf {w}}')\) is equal to

$$\begin{aligned}&(-\tau (e_{j_1},u)\tau (e_{j_t},u))(-\tau (e'_{j_1},u)\tau (e'_{j_r},u))\mu ({\mathbf {w}})\mu ({\mathbf {w}}')\\&\quad (-\tau (e_{j_t},u)\tau (e'_{j_1},u))(-\tau (e'_{j_r},u)\tau (e_{j_1},u))=\mu ({\mathbf {w}})\mu ({\mathbf {w}}'). \end{aligned}$$

\(\square \)

Lemma 4.2

Let \({\mathbf {w}}\) be a (uv)-walk in a signed graph \((G,\tau )\). For any two (vu)-walks \({\mathbf {w}}_1\) and \({\mathbf {w}}_2\),

$$\begin{aligned} \mu ({\mathbf {w}}_1+{\mathbf {w}}_2^{-1})=\mu ({\mathbf {w}}+{\mathbf {w}}_1)\mu ({\mathbf {w}}+{\mathbf {w}}_2). \end{aligned}$$

Proof

If \(u=v\), then the lemma holds, since we have the following from Lemma 4.1:

$$\begin{aligned} \mu ({\mathbf {w}}_1+{\mathbf {w}}_2^{-1})= & {} \mu ({\mathbf {w}}_1)\mu ({\mathbf {w}}_2^{-1})=\mu ({\mathbf {w}}_1)\mu ({\mathbf {w}}_2)= \mu ({\mathbf {w}})\mu ({\mathbf {w}}_1)\mu ({\mathbf {w}})\mu ({\mathbf {w}}_2)\\= & {} \mu ({\mathbf {w}}+{\mathbf {w}}_1)\mu ({\mathbf {w}}+{\mathbf {w}}_2). \end{aligned}$$

Suppose that u and v are distinct. Then, each of \({\mathbf {w}}\), \({\mathbf {w}}_1\), and \({\mathbf {w}}_2\) is nontrivial. Without loss of generality, it is enough to consider the case when

$$\begin{aligned} {\mathbf {w}}: ue_1v_2\cdots e_tv,\qquad {\mathbf {w}}_1: ve'_1v'_2\cdots e'_ru,\qquad {\mathbf {w}}_2: ve''_1v''_2\cdots e''_su \end{aligned}$$

as depicted in Fig. 10.

Note that \(\tau (e'_r,u)\tau (e''_s,u)=1\) (resp. \(\tau (e'_1v)\tau (e''_1,v)=1\)) means that u (resp. v) is a new unbalanced vertex term of \({\mathbf {w}}_1+{\mathbf {w}}_2^{-1}\). Thus,

$$\begin{aligned} \mu ({\mathbf {w}}_1+{\mathbf {w}}_2^{-1})=\mu ({\mathbf {w}}_1)(-\tau (e'_r,u)\tau (e''_s,u))\mu ({\mathbf {w}}_2)(-\tau (e'_1,v)\tau (e''_1,v)). \end{aligned}$$

Likewise,

$$\begin{aligned} \mu ({\mathbf {w}}+{\mathbf {w}}_1)= & {} \mu ({\mathbf {w}})(-\tau (e_t,v)\tau (e'_1,v))\mu ({\mathbf {w}}_1)(-\tau (e'_r,u)\tau (e_1,u)),\\ \mu ({\mathbf {w}}+{\mathbf {w}}_2)= & {} \mu ({\mathbf {w}})(-\tau (e_t,v)\tau (e''_1,v))\mu ({\mathbf {w}}_2)(-\tau (e''_s,u)\tau (e_1,u)). \end{aligned}$$

Therefore, \(\mu ({\mathbf {w}}_1+{\mathbf {w}}_2^{-1})=\mu ({\mathbf {w}}_1)\mu ({\mathbf {w}}_2)\tau (e'_r,u)\tau (e''_s,u) \tau (e'_1,v)\tau (e''_1,v)=\mu ({\mathbf {w}}+{\mathbf {w}}_1)\mu ({\mathbf {w}}+{\mathbf {w}}_2)\). \(\square \)

Fig. 10
figure 10

An illustration for the proof of Lemma 4.2

Lemma 4.3

Let \({\mathbf {w}}\) and \({\mathbf {w}}'\) be two even-signed closed walks in a signed graph, whose first vertex terms are the same. Then (by taking \(B_{{\mathbf {w}}}\) and \(B_{{\mathbf {w}}'}\) properly) \(B^+_{{\mathbf {w}}+{\mathbf {w}}'}=B^+_{{\mathbf {w}}}B^+_{{\mathbf {w}}'}\) and \(B^-_{{\mathbf {w}}+{\mathbf {w}}'}=B^-_{{\mathbf {w}}}B^-_{{\mathbf {w}}'}\).

Proof

Let \({\mathbf {w}}={\mathbf {w}}_0+\cdots +{\mathbf {w}}_{r}\) and \({\mathbf {w}}'={\mathbf {w}}'_0+\cdots +{\mathbf {w}}'_s\) be balanced section decompositions of \({\mathbf {w}}\) and \({\mathbf {w}}'\) for some odd integers r and s. By Lemma 4.1, \({\mathbf {w}}_{r}+{\mathbf {w}}'_0\) is a balanced section of \({\mathbf {w}}+{\mathbf {w}}'\) if and only if \({\mathbf {w}}'_{s} +{\mathbf {w}}_0\) is a balanced section of \({\mathbf {w}}+{\mathbf {w}}'\). First, suppose that \({\mathbf {w}}_{r}+{\mathbf {w}}'_0\) is not a balanced section of \({\mathbf {w}}+{\mathbf {w}}'\). Then, \({\mathbf {w}}_0+\cdots +{\mathbf {w}}_{r}+{\mathbf {w}}'_0+\cdots +{\mathbf {w}}'_s\) is a balanced section decomposition of \({\mathbf {w}}+{\mathbf {w}}'\). By definition, it follows that \(B^+_{{\mathbf {w}}}B^+_{{\mathbf {w}}'}=B^+_{{\mathbf {w}}+{\mathbf {w}}'}\) and \(B^-_{{\mathbf {w}}}B^-_{{\mathbf {w}}'}=B^-_{{\mathbf {w}}+{\mathbf {w}}'}\). Suppose that \({\mathbf {w}}_{r}+{\mathbf {w}}'_0\) is a balanced section of \({\mathbf {w}}+{\mathbf {w}}'\). Letting \({\mathbf {x}}={\mathbf {w}}'_s+{\mathbf {w}}_0\) and \({\mathbf {y}}={\mathbf {w}}_r+{\mathbf {w}}_0'\), we have a balanced section decomposition of \({\mathbf {w}}+{\mathbf {w}}'\),

$$\begin{aligned} {\mathbf {x}}+{\mathbf {w}}_1+\cdots +{\mathbf {w}}_{r-1}+{\mathbf {y}}+{\mathbf {w}}'_1+\cdots +{\mathbf {w}}'_{s-1}. \end{aligned}$$

Then, we can obtain that \(B^+_{{\mathbf {w}}}B^+_{{\mathbf {w}}'}=B^+_{{\mathbf {w}}+{\mathbf {w}}'}\) and \(B^-_{{\mathbf {w}}}B^-_{{\mathbf {w}}'}=B^-_{{\mathbf {w}}+{\mathbf {w}}'}\) by redefining \(B_{{\mathbf {w}}}\) and \(B_{{\mathbf {w}}'}\) properly. \(\square \)

Lemma 4.4

Let \({\mathbf {w}}\) be a (uv)-walk in a signed graph without unbalanced vertex term. For two (vu)-walks \({\mathbf {w}}_1\) and \({\mathbf {w}}_2\), if \({\mathbf {w}}+{\mathbf {w}}_i\) is even-signed for each \(i=1,2\), then \(B_{{\mathbf {w}}_1+{\mathbf {w}}_2^{-1}}\) belongs to the ideal \(\left\langle B_{{\mathbf {w}}+{\mathbf {w}}_1}, B_{{\mathbf {w}}+{\mathbf {w}}_2} \right\rangle \).

Proof

For simplicity, let \({\mathbf {a}}\), \({\mathbf {b}}\), \({\mathbf {c}}\), and \({\mathbf {d}}\) be closed walks such that

$$\begin{aligned} \begin{array}{llll} {\mathbf {a}}={\mathbf {w}}+{\mathbf {w}}_1, \quad&{\mathbf {b}}={\mathbf {w}}_2^{-1}+{\mathbf {w}}^{-1},\quad&{\mathbf {c}}={\mathbf {w}}_1+{\mathbf {w}}_2^{-1},\quad&{\mathbf {d}}={\mathbf {w}}^{-1}+{\mathbf {w}}. \end{array} \end{aligned}$$

Note that each of the four walks are even-signed (\({\mathbf {a}}\) and \({\mathbf {b}}\) are even-signed by the assumptions, \({\mathbf {c}}\) and \({\mathbf {d}}\) are even-signed by Lemma 4.2). Moreover, the first vertex terms of \({\mathbf {a}}\) and \({\mathbf {b}}\) are the same as u, and the first vertex terms of \({\mathbf {c}}\) and \({\mathbf {d}}\) are the same as v.

We consider two closed walks \({\mathbf {a}}+{\mathbf {b}}\) and \({\mathbf {c}}+{\mathbf {d}}\). Since \({\mathbf {a}}+{\mathbf {b}}={\mathbf {w}}+{\mathbf {w}}_1+({\mathbf {w}}_2)^{-1}+{\mathbf {w}}^{-1}\) and \({\mathbf {c}}+{\mathbf {d}}={\mathbf {w}}_1+({\mathbf {w}}_2)^{-1}+{\mathbf {w}}^{-1}+{\mathbf {w}}\), they are the same walk and so \(\pm B_{{\mathbf {a}}+{\mathbf {b}}}= B_{{\mathbf {c}}+{\mathbf {d}}}\). By Lemma 4.3, by taking binomials associated with four even-signed closed walks \({\mathbf {a}}\), \({\mathbf {b}}\), \({\mathbf {c}}\) and \({\mathbf {d}}\) properly, we have

$$\begin{aligned} B^+_{{\mathbf {a}}+{\mathbf {b}}}=B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}, \qquad B^-_{{\mathbf {a}}+{\mathbf {b}}}=B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}, \qquad B^+_{{\mathbf {c}}+{\mathbf {d}}}=B^+_{{\mathbf {c}}}B^+_{{\mathbf {d}}}, \qquad B^-_{{\mathbf {c}}+{\mathbf {d}}}=B^-_{{\mathbf {c}}}B^-_{{\mathbf {d}}}. \end{aligned}$$

Note that since \({\mathbf {w}}\) has no unbalanced vertex term, \(B^+_{{\mathbf {d}}}=B^-_{{\mathbf {d}}}\), and we let \(X:=B^+_{{\mathbf {d}}}\). Hence,

$$\begin{aligned} \!\!\!\!\!\!B_{{\mathbf {c}}}\!\!\!= & {} \!\!\!B^+_{{\mathbf {c}}}-B^-_{{\mathbf {c}}} = \frac{B^+_{{\mathbf {c}}+{\mathbf {d}}}}{B^+_{{\mathbf {d}}}} -\frac{B^-_{{\mathbf {c}}+{\mathbf {d}}}}{B^-_{{\mathbf {d}}}} = \frac{1}{X} \left( B^+_{{\mathbf {c}}+{\mathbf {d}}}-B^-_{{\mathbf {c}}+{\mathbf {d}}}\right) =\frac{1}{X} B_{{\mathbf {c}}+{\mathbf {d}}}=\pm \frac{1}{X}B_{{\mathbf {a}}+{\mathbf {b}}}=\pm \frac{B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X} \mp \frac{B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X}. \end{aligned}$$

We may assume that \(B_{{\mathbf {c}}}=\frac{B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X}- \frac{B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X}.\) (The other case is similar.) Thus, X divides both \(B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}\) and \(B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}\). Moreover, since \({\mathbf {w}}\) has no unbalanced vertex term, X divides one of \(B^+_{{\mathbf {a}}}\) and \(B^-_{{\mathbf {a}}}\), and one of \(B^+_{{\mathbf {b}}}\) and \(B^-_{{\mathbf {b}}}\). Thus, X divides either \(B^+_{{\mathbf {a}}}\) and \(B^-_{{\mathbf {b}}}\), or \(B^-_{{\mathbf {a}}}\) and \(B^+_{{\mathbf {b}}}\). If X divides \(B^+_{{\mathbf {a}}}\) and \(B^-_{{\mathbf {b}}}\), then

$$\begin{aligned} B_{{\mathbf {c}}}= & {} \frac{B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X}+\left( -\frac{B^+_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X}+\frac{B^+_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X} \right) -\frac{B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X}\\= & {} \left( \frac{B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X} -\frac{B^+_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X} \right) + \left( \frac{B^+_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X} -\frac{B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X}\right) =\frac{B^+_{{\mathbf {a}}}}{X} B_{{\mathbf {b}}} + \frac{B^-_{{\mathbf {b}}}}{X} B_{{\mathbf {a}}}. \end{aligned}$$

Similarly, if X divides \(B^-_{{\mathbf {a}}}\) and \(B^+_{{\mathbf {b}}}\), then

$$\begin{aligned} B_{{\mathbf {c}}}= & {} \frac{B^+_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X}+\left( -\frac{B^-_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X}+\frac{B^-_{{\mathbf {a}}}B^+_{{\mathbf {b}}}}{X} \right) -\frac{B^-_{{\mathbf {a}}}B^-_{{\mathbf {b}}}}{X} =\frac{B^-_{{\mathbf {a}}}}{X} B_{{\mathbf {b}}} + \frac{B^+_{{\mathbf {b}}}}{X} B_{{\mathbf {a}}}. \end{aligned}$$

In any case, \(B_{{\mathbf {c}}}\) belongs to the ideal \(\left\langle B_{{\mathbf {a}}}, B_{{\mathbf {b}}} \right\rangle \), a desired conclusion. \(\square \)

The following is from Lemma 4.4 by considering cases where \({\mathbf {w}}\) is a walk of length one.

Corollary 4.5

Let \({\mathbf {w}}_1\) and \({\mathbf {w}}_2\) be two even-signed closed walks in a signed graph, starting with uev for an edge \(e=uv\). Then, \(B_{{\mathbf {w}}'}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2}\right\rangle \), where \({\mathbf {w}}_i=uev+{\mathbf {w}}'_i\) for \(i=1,2\) and \({\mathbf {w}}'= {\mathbf {w}}'_1+{{\mathbf {w}}'_2}^{-1}\).

The following lemma may fail if we drop the assumption on oddness of sign of \({\mathbf {w}}\) or \({\mathbf {w}}'\).

Lemma 4.6

Let \({\mathbf {w}}\) and \({\mathbf {w}}'\) be two odd-signed closed walks in a signed graph \((G,\tau )\), whose first vertex terms are the same. Then, \({\mathbf {w}}+{\mathbf {w}}'\) and \({\mathbf {w}}^{-1}+{\mathbf {w}}'\) are even-signed closed walks in \((G,\tau )\) and \(B_{{\mathbf {w}}^{-1}+{\mathbf {w}}'}=\pm B_{{\mathbf {w}}+{\mathbf {w}}'}\).

Proof

Note that \({\mathbf {w}}+{\mathbf {w}}'\) and \({\mathbf {w}}^{-1}+{\mathbf {w}}'\) are even-signed by Lemma 4.1, since \(\mu ({\mathbf {w}}^{-1})=\mu ({\mathbf {w}})=\mu ({\mathbf {w}}')=-1\), \(\mu ({\mathbf {w}}+{\mathbf {w}}')=\mu ({\mathbf {w}})\mu ({\mathbf {w}}')=1\), and \(\mu ({\mathbf {w}}^{-1}+{\mathbf {w}}')=\mu ({\mathbf {w}}^{-1})\mu ({\mathbf {w}}')=1\). Let \({\mathbf {w}}_0+\cdots +{\mathbf {w}}_{2r}\) be a balanced section decomposition of \({\mathbf {w}}\) for some nonnegative integer r. We assume that \({\mathbf {w}}_0\) contains the first vertex term v. Then, \({\mathbf {y}}\) is a nontrivial walk and \({\mathbf {x}}\) may be trivial, and \({\mathbf {w}}+{\mathbf {w}}'\) and \({\mathbf {w}}^{-1}+{\mathbf {w}}'\) have the following section decompositions (the parts \({\mathbf {w}}_1+\cdots +{\mathbf {w}}_{2r}\) and \({\mathbf {w}}_{2r}^{-1}+\cdots +{\mathbf {w}}_1\) are dropped if \(r=0\)):

$$\begin{aligned} \begin{array}{ccccccccccccccc} {\mathbf {w}}&{}+&{}{\mathbf {w}}'&{}=&{}{\mathbf {y}}&{}+&{}{\mathbf {w}}_1&{}+&{}\cdots &{}+&{}{\mathbf {w}}_{2r}&{}+&{}{\mathbf {x}}&{}+&{}{\mathbf {w}}',\\ {\mathbf {w}}^{-1}&{}+&{}{\mathbf {w}}'&{}=&{}{\mathbf {x}}^{-1}&{}+&{}{\mathbf {w}}^{-1}_{2r}&{}+&{}\cdots &{}+&{}{\mathbf {w}}^{-1}_{1}&{}+&{}{\mathbf {y}}^{-1}&{}+&{}{\mathbf {w}}'. \end{array} \end{aligned}$$

Then, we make a binomial \(B_{{\mathbf {w}}+{\mathbf {w}}'}=B^+-B^-\) by putting the edges in \(E({\mathbf {y}})\) to \(B^+\), the edges in \(E({\mathbf {w}}_1)\) to \(B^-\), the edges in \(E({\mathbf {w}}_2)\) to \(B^+\), and so on. Let \(U^+\) and \(U^-\) be the (multi)set so that

$$\begin{aligned} B^+= \prod _{e\in U^+}e \qquad \text {and}\qquad B^-=\prod _{e\in U^-}e. \end{aligned}$$

Then, by a way to make the binomial \(B_{{\mathbf {w}}+{\mathbf {w}}'}\),

$$\begin{aligned} U^+\supset E({\mathbf {y}}) \cup \left( \bigcup _{i>0:\text { even}} E({\mathbf {w}}_i) \right) ,\qquad U^- \supset \left( \bigcup _{i:\text { odd}} E({\mathbf {w}}_i) \right) \cup E({\mathbf {x}}). \end{aligned}$$

Similarly, we also make a binomial \(B_{{\mathbf {w}}^{-1}+{\mathbf {w}}'}=B'^+-B'^-\) by putting the edges in \(E({\mathbf {x}}^{-1})\) to \(B'^-\), the edges in \(E({\mathbf {w}}_{2r}^{-1})\) to \(B^+\), and so on. Let \(W^+\) and \(W^-\) be the (multi)set so that

$$\begin{aligned} B'^+= \prod _{e\in W^+}e \qquad \text {and}\qquad B'^-=\prod _{e\in W^-}e. \end{aligned}$$

Then, by a way to make the binomial \(B_{{\mathbf {w}}^{-1}+{\mathbf {w}}'}\),

$$\begin{aligned} W^+\supset E({\mathbf {y}}) \cup \left( \bigcup _{i>0:\text { even}} E({\mathbf {w}}_i) \right) ,\qquad W^- \supset \left( \bigcup _{i:\text { odd}} E({\mathbf {w}}_i) \right) \cup E({\mathbf {x}}). \end{aligned}$$

Note that it is sufficient to show that for the first edge term \(e'_{j_1}\) of \({\mathbf {w}}'\), \(e'_{j_1}\in U^+\) if and only if \(e'_{j_1}\in W^+\). In the following, let \(e_{j_1}\) be the first edge term of \({\mathbf {w}}\) (i.e., the first edge term of \({\mathbf {y}}\)), and \(e_{j_*}\) be the last edge term of \({\mathbf {w}}\). We note \(e_{j_1}\in E({\mathbf {y}})\subset W^+\).

(Case 1) Suppose that \({\mathbf {x}}\) is nontrivial. Then, \(e_{j_*}\) is the last edge term of \({\mathbf {x}}\) and \({\mathbf {x}}+{\mathbf {y}}\) is a balanced section of \({\mathbf {w}}\). Thus,

$$\begin{aligned}&\tau (e_{j_*},v)=-\tau (e_{j_1},v). \end{aligned}$$
(4.1)

We also note that \(e_{j_*}\in E({\mathbf {x}})\subset U^-\). Then, where the second biconditional is from (4.1),

$$\begin{aligned} e'_{j_1}\in U^+ ~~\Leftrightarrow ~ ~\tau (e_{j_*},v)=\tau (e'_{j_1},v)~~ \Leftrightarrow ~~-\tau (e_{j_1},v)=\tau (e'_{j_1},v) ~~\Leftrightarrow ~ ~e'_{j_1}\in W^+. \end{aligned}$$

(Case 2) Suppose that \({\mathbf {x}}\) is trivial. Then, the first vertex term v of \({\mathbf {w}}\) is unbalanced, and so

$$\begin{aligned}&\tau (e_{j_*},v)=\tau (e_{j_1},v). \end{aligned}$$
(4.2)

We also note that \(e_{j_*}\in E({\mathbf {w}}_{2r})\subset U^+\). Then, where the second biconditional is from (4.2),

$$\begin{aligned} e'_{j_1}\in U^+ ~~\Leftrightarrow ~ ~\tau (e_{j_*},v)=-\tau (e'_{j_1},v)~~ \Leftrightarrow ~~\tau (e_{j_1},v)=-\tau (e'_{j_1},v)~~\Leftrightarrow ~~e'_{j_1}\in W^+. \end{aligned}$$

\(\square \)

5 Proofs of the main results

5.1 Proof of Theorem 3.1

Proof of Theorem 3.1

The following is directly derived from Lemma 4.3.

Claim 5.1

For an even-signed closed walk \({\mathbf {w}}\) in a signed graph, if \(B_{{\mathbf {w}}}\) is primitive, then \({\mathbf {w}}\) has no proper nontrivial section that is an even-signed closed walk.

Let \({\mathbf {w}}:v_{i_1}e_{j_1}v_{i_2}\cdots v_{i_r}e_{j_r}v_{i_1}\) be an even-signed closed walk in a signed graph \((G,\tau )\). First, we show the ‘only if’ part. Suppose that \(B_{{\mathbf {w}}}\) is primitive in \(I_{(G,\tau )}\). Note that (ii) holds by Claim 5.1, and so we will show (i).

Claim 5.2

Let \({\mathbf {w}}={\mathbf {w}}_0+{\mathbf {w}}_1+{\mathbf {w}}_2+{\mathbf {w}}_3\) be a nontrivial section decomposition of \({\mathbf {w}}\). Then, at least one of \({\mathbf {w}}_0+{\mathbf {w}}_1\) and \({\mathbf {w}}_1+{\mathbf {w}}_2\) is not a closed walk.

Proof

Suppose to contrary that each of \({\mathbf {w}}_0+{\mathbf {w}}_1\) and \({\mathbf {w}}_1+{\mathbf {w}}_2\) is a closed walk. First, we will show that both \({\mathbf {w}}_3+{\mathbf {w}}_0\) and \({\mathbf {w}}_3+{\mathbf {w}}_1^{-1}\) are odd-signed closed walks in \((G,\tau )\). Let v be the first vertex term of \({\mathbf {w}}_0\) and u be the first vertex term of \({\mathbf {w}}_1\). Then, \({\mathbf {w}}_3\) is a (uv)-walk, and each of \({\mathbf {w}}_0\) and \({\mathbf {w}}^{-1}_1\) is a (vu)-walk. Hence, both \({\mathbf {w}}_3+{\mathbf {w}}_0\) and \({\mathbf {w}}_3+{\mathbf {w}}_1^{-1}\) are closed walks. Then, \({\mathbf {w}}_3+{\mathbf {w}}_0\) is clearly a proper closed section of \({\mathbf {w}}\), and so it is odd-signed by Claim 5.1. In a closed walk \({\mathbf {w}}^*={\mathbf {w}}_1^{-1}+{\mathbf {w}}_0^{-1}+{\mathbf {w}}_2+{\mathbf {w}}_3\), note that \({\mathbf {w}}_3+{\mathbf {w}}_1^{-1}\) is a proper closed section. By Lemma 4.6, \({\mathbf {w}}^*\) is also an even closed walk such that \(B_{{\mathbf {w}}}=B_{{\mathbf {w}}^*}\), and so \(B_{{\mathbf {w}}^*}\) is also primitive. It follows from Claim 5.1 that \({\mathbf {w}}_3+{\mathbf {w}}_1^{-1}\) is odd-signed in \((G,\tau )\). Then,

$$\begin{aligned} \mu ({\mathbf {w}}_0+{\mathbf {w}}_1)=\mu ({\mathbf {w}}_0+({\mathbf {w}}^{-1}_1)^{-1})= \mu ({\mathbf {w}}_3+{\mathbf {w}}_0)\mu ({\mathbf {w}}_3+{\mathbf {w}}_1^{-1})=1, \end{aligned}$$

where the second equality is from Lemma 4.2 and the last one is from the fact that both \({\mathbf {w}}_3+{\mathbf {w}}_0\) and \({\mathbf {w}}_3+{\mathbf {w}}_1^{-1}\) are odd-signed. Hence, \({\mathbf {w}}_0+{\mathbf {w}}_1\) is a proper even-signed closed section of \({\mathbf {w}}\), a contradiction to Claim 5.1. \(\square \)

Claim 5.3

Let v be a vertex repeated in \({\mathbf {w}}\). Then, v is repeated exactly twice in \({\mathbf {w}}\) and is a cut vertex of \([{\mathbf {w}}]\) such that \([{\mathbf {w}}]-v\) has exactly two connected components and each block of \([{\mathbf {w}}]\) is a cycle of length at least two.

Proof

We may assume that the first vertex term is v. First, we claim that there is no vertex repeated more than twice. Suppose that there are k and \(\ell \) such that \(1<k<\ell \le r\) and \(v=v_{i_{k}}=v_{i_{\ell }}\). Let \({\mathbf {w}}={\mathbf {w}}_0+{\mathbf {w}}_1+{\mathbf {w}}_2\) where each \({\mathbf {w}}_t\) is a nontrivial closed walk whose first vertex term is v. Then, \(\mu ({\mathbf {w}}_0)\mu ({\mathbf {w}}_1)\mu ({\mathbf {w}}_2)=\mu ({\mathbf {w}})=1\) by Lemma 4.1, which implies that at least one of \({\mathbf {w}}_0\), \({\mathbf {w}}_1\), and \({\mathbf {w}}_2\) is an even-signed closed walk in \((G,\tau )\), and say \({\mathbf {w}}_0\). This contradicts to Claim 5.1. Hence, v is repeated twice and so we let \({\mathbf {w}}={\mathbf {w}}_0+{\mathbf {w}}_1\) where \({\mathbf {w}}_t\) is a nontrivial closed walk whose first vertex term is v.

By Claim 5.2, every internal vertex term u of \({\mathbf {w}}_0\) is not appeared in \({\mathbf {w}}_1\) at all. Hence v is a cut vertex of \([{\mathbf {w}}]\). Moreover, since v is repeated twice, \([{\mathbf {w}}]-v\) has exactly two connected components and every block of \([{\mathbf {w}}]\) containing v contains exactly two edges incident to v. Thus, each block is a cycle. \(\square \)

By Claim 5.3, it is clear that every vertex belongs to at most two blocks, which implies (i).

We show the ‘if’ part. Suppose that an even-signed closed walk \({\mathbf {w}}\) in \((G,\tau )\) satisfies (i) and (ii).

Claim 5.4

For each edge \(e\in E({\mathbf {w}})\), e divides exactly one of \(B_{{\mathbf {w}}}^+\) and \(B_{{\mathbf {w}}}^-\).

Proof

Suppose to contrary that an edge \(e\in E({\mathbf {w}})\) divides both \(B_{{\mathbf {w}}}^+\) and \(B_{{\mathbf {w}}}^-\). Then, e is repeated in \({\mathbf {w}}\) and so e is on a cycle of length two in \([{\mathbf {w}}]\) by (i). Moreover, \({\mathbf {w}}\) has at least two balanced sections, and let \({\mathbf {w}}_0+\cdots +{\mathbf {w}}_{2k-1}\) be a balanced section decomposition of \({\mathbf {w}}\). Then, we may assume that both \({\mathbf {w}}_0\) and \({\mathbf {w}}_{2i-1}\) contain e for some \(i\in [k]\). Then, there are section decompositions \({\mathbf {w}}_0={\mathbf {x}}_0+{\mathbf {y}}_0\) and \({\mathbf {w}}_{2i-1}={\mathbf {x}}_{2i-1}+{\mathbf {y}}_{2i-1}\) such that the first edge term of \({\mathbf {y}}_0\) and the last edge term of \({\mathbf {x}}_{2i-1}\) are e. Consider the section \({\mathbf {w}}'\) of \({\mathbf {w}}\) so that the first and the last edge terms are e. Then, by the structure of \([{\mathbf {w}}]\) from (i) and (ii), \({\mathbf {w}}'\) is a closed walk and \({\mathbf {w}}'={\mathbf {y}}_0+{\mathbf {w}}_1+\cdots +{\mathbf {w}}_{2i-2}+{\mathbf {x}}_{2i-1}\) is a balanced section decomposition (\({\mathbf {w}}_1+\cdots +{\mathbf {w}}_{2i-2}\) is dropped if \(i=1\)). Hence, \({\mathbf {w}}'\) is an even-signed closed section of \({\mathbf {w}}\), a contradiction to (ii). \(\square \)

Let \(A=A(G,\tau )\). By Claim 5.4, from the same way in (the proof of) Observation 2.11, we can find an integer vector \(\mathbb {b}=(b_e)_{e\in E(G)}\) such that \(\mathbb {e}^{\mathbb {b}^+}-\mathbb {e}^{\mathbb {b}^-}=B_{{\mathbf {w}}}\) and \(G_{\mathbb {b}}=[{\mathbf {w}}]\) (\(G_{\mathbb {b}}\) is the multigraph in Proposition 2.13). Suppose to contrary that \(B_{{\mathbf {w}}}\) is not primitive. Then, there is a binomial \(\mathbb {e}^{\mathbb {c}^+}- \mathbb {e}^{\mathbb {c}^-}\) in \(I_{(G,\tau )}\) (for some \(\mathbb {c}=(c_e)_{e\in E(G)}\), other than \(\mathbb {b}\)) such that \(\mathbb {e}^{\mathbb {c}^+}| \mathbb {e}^{\mathbb {b}^+}\), \(\mathbb {e}^{\mathbb {c}^-}| \mathbb {e}^{\mathbb {b}^+}\). It also holds \(A\mathbb {c}=\mathbb {0}\). By Proposition 2.13, each connected component of \(G_{\mathbb {c}}\) has an even-signed Eulerian. Now consider two multigraphs \(G_{\mathbb {b}}\) and \(G_{\mathbb {c}}\). Note that \(G_{\mathbb {c}}\) is a proper subgraph of \(G_{\mathbb {b}}\). By the condition (i) on \(G_{\mathbb {b}}\), each block B of \(G_{\mathbb {b}}\) is a cycle and so each block of \(G_{\mathbb {c}}\) is also a block of \(G_{\mathbb {b}}\). Thus, \(G_{\mathbb {c}}\) is made by taking some blocks of \(G_{\mathbb {b}}\).

Let \(\mathbb {d}=(d_e)_{e\in E(G)}\) be a vector such that \(d_e=b_e-c_e\) for every edge e. By definition,

$$\begin{aligned} \mathbb {e}^{\mathbb {d}^+}=\frac{\mathbb {e}^{\mathbb {b}^+}}{\mathbb {e}^{\mathbb {c}^+}}\qquad \text {and}\qquad \mathbb {e}^{\mathbb {d}^-}=\frac{\mathbb {e}^{\mathbb {b}^-}}{\mathbb {e}^{\mathbb {c}^-}}, \end{aligned}$$

and \(G_{\mathbb {d}}\) is the graph obtained from \(G_{\mathbb {b}}\) by deleting the edges of blocks of \(G_{\mathbb {c}}\). Take a nontrivial connected component D of \(G_{\mathbb {d}}\). Since \(A{\mathbb {d}}=\mathbb {0}\), by Proposition 2.13, D has an even-signed Eulerian \({\mathbf {w}}_D\). However, \({\mathbf {w}}_D\) is a nontrivial section of \({\mathbf {w}}\), which is an even-signed closed walk in \((G,\tau )\). This is a contradiction to (ii). \(\square \)

5.2 Proof of Theorem 3.9

We often use the fact that a graph in \({\mathcal {G}}^{cis}\) satisfies all statements in Theorem 2.5, since \({\mathcal {G}}^{cis}\subset {\mathcal {G}}^{ci}\).

Proof of Theorem 3.9

We show the ‘only if’ part first. Suppose to contrary that G is a 2-connected graph in \({\mathcal {G}}^{cis}\), none of (G1)-(G5) in Theorem 3.9. Since \({\mathcal {G}}^{cis} \subset {\mathcal {G}}^{cio}\), by Theorem 2.7(i) and Observation 3.8 it follows that G is constructed by clique sums of cycles. Note that since G is 2-connected, 1-clique sum cannot be done to make G. Thus, G is constructed by 2-clique sums of cycles. By Corollary 3.7, every induced subgraph which is constructed by 2-clique sums of cycles belongs to \({\mathcal {G}}^{cis}\). Not to be (G1) or (G2), G is constructed by clique sums of at least three cycles.

Claim 5.5

For each edge e, there are at most two induced cycles containing e.

Proof of Claim 5.5

Suppose that there are three induced cycles \(C^{(1)}\), \(C^{(2)}\), and \(C^{(3)}\) of G, containing the edge e. Let \(H=G[V(C^{(1)})\cup V(C^{(2)})\cup V(C^{(3)})]\). Since H is constructed by 2-clique sums of cycles, \(H\in {\mathcal {G}}^{cis}\) by Corollary 3.7. Moreover, all vertices of H except the endpoints of e have degree two in the graph H. By Proposition 3.11(i), by contracting ears of H, we obtain a graph \(H^*\in {\mathcal {G}}^{cis}\), which is a 2-clique sum of three triangles at one edge. But \(H^*\) contains \(K_{2,3}\), a contradiction to Theorem 2.5(ii).

Claim 5.6

An induced cycle of G shares an edge with at most two induced cycles.

Proof

For an induced cycle C of G, suppose that there are three induced cycles \(C^{(1)}\), \(C^{(2)}\), \(C^{(3)}\) of G, each of which shares an edge with C. Then, for each \(i\in [3]\) there is a unique edge \(e_i\) which belongs to both C and \(C^{(i)}\). By Claim 5.5, \(e_1\), \(e_2\), \(e_3\) are distinct. Now let \(H=G[V(C)\cup V(C^{(1)})\cup V(C^{(2)})\cup V(C^{(3)})]\), and then \(H\in {\mathcal {G}}^{cis}\) by Corollary 3.7. In addition, all vertices of H, except the endpoints of \(e_i\)’s, have degree two in the graph H. By Proposition 3.11(i), by contracting ears of H, we obtain a graph \(H^*\in {\mathcal {G}}^{cis}\). Note that \(H^*\) is 2-connected with three triangles. By Theorem 2.5(iii) and (iv), it follows that \(H^*\) must be the graph \(G_0\) in Fig. 9. By Example 3.12, \(G_0 \not \in {\mathcal {G}}^{ci}\) and so \(G_0\not \in {\mathcal {G}}^{cis}\), a contradiction. \(\square \)

By Claims 5.5 and 5.6 , there are induced cycles \(C^{(1)}\), \(C^{(2)}\), \(\ldots \), \(C^{(m)}\) (for some \(m\ge 3\)) such that G is constructed by 2-clique sums of those m cycles, where for each \(i\in [m-1]\), \(C^{(i)}\) and \(C^{({i+1})}\) share an edge \(e_i\). Note that \(e_1\), \(\ldots \), \(e_{m-1}\) are distinct. For each \(i\in [m-2]\) and \(\ell \in \{2,\ldots ,m-i+1\}\), let \(H^{(i)}_\ell =G[V(C^{(i)})\cup V(C^{(i+1)})\cup \cdots \cup V(C^{(i+\ell -1)})]\). Note that \(H_\ell ^{(i)}\in {\mathcal {G}}^{cis}\) by Corollary 3.7. In addition, Proposition 3.11(i) says that by contracting two ears of \(H_\ell ^{(i)}\) lying on the cycles \(C^{(i)}\) and \(C^{(i+\ell -1)}\), we obtain a graph \(F^{(i)}_\ell \) in \({\mathcal {G}}^{cis}\). In \(F^{(i)}_\ell \), the cycles corresponding to \(C^{(i)}\) and \(C^{(i+\ell -1)}\) are triangles.

Claim 5.7

Let \(i\in [m-2]\). Then, \(C^{(i+1)}\) has length at most four. Moreover, if \(C^{({i})}\), \(C^{(i+1)}\), and \(C^{(i+2)}\) share a vertex v, then \(C^{(i+1)}\) is a triangle and there is no more induced cycle containing v.

Proof

We firstly show the ‘moreover’ part. Suppose that \(C^{(i)}\), \(C^{(i+1)}\), and \(C^{(i+2)}\) share a vertex v. If \(C^{(i+1)}\) is not a triangle, then by contracting ears of \(F^{(i)}_3\) properly, we can obtain \(G_1 \) in Fig. 11, and note that \(G_1\not \in {\mathcal {G}}^{ci}\) by Theorem 2.5(iii). Hence, \(C^{(i+1)}\) is a triangle.

Suppose that there is another induced cycle \(C^{(j)}\) containing the vertex v. Since G is 2-connected, we may assume that \(j=i+3\). By the above argument, both \(C^{(i+1)}\) and \(C^{(i+2)}\) are triangles. Then, \(F^{(i)}_4\) has four triangles and so \(|V(F^{(i)}_4)|= 6\) and \(|E(F^{(i)}_4)|=9\). By deleting the vertex v, it becomes a bipartite graph, and so \(\sum _{x} b(F^{(i)}_4-x)\ge 1\). Applying Theorem 2.5(i), we have \(2|E(F^{(i)}_4)|< 3|V(F^{(i)}_4)|\), a contradiction.

It remains to show that \(C^{(i+1)}\) has length at most 4. Suppose that \(C^{(i+1)}\) has length at least 5. Then, by the previous argument, \(C^{(i)}\), \(C^{(i+1)}\), and \(C^{(i+2)}\) do not share one common vertex. By contracting ears of \(F^{(i)}_3\) properly, we obtain \(G_2\) in Fig. 11. By Theorem 2.5(iv), \(G_2\not \in {\mathcal {G}}^{ci}\), a contradiction. \(\square \)

Fig. 11
figure 11

Some graphs not in \({\mathcal {G}}^{cis}\)

Suppose that \(C^{(2)}\) is a cycle of at least length 4. By Claim 5.7, \(C^{(2)}\) has length 4. By the moreover part of Claim 5.7, \(C^{(1)}\) and \(C^{(3)}\) do not share a vertex. Not to be (G4), \(m\ge 4\), and so consider \(F^{(1)}_4\). Then, the triangles corresponding to \(C^{(1)}\) and \(C^{(4)}\) in \(F^{(1)}_4\) are disjoint by Claim 5.7. Then, there are no two disjoint edges connecting those two triangles, which is a contradiction to Theorem 2.5(iv). Suppose that \(C^{(2)}\) is a triangle. By Claim 5.7, not to be (G5), \(m\ge 5\). Consider \(F^{(1)}_5\) and then there are no two disjoint edges connecting two triangles corresponding to \(C^{(1)}\) and \(C^{(5)}\) in \(F^{(1)}_5\), a contradiction to Theorem 2.5(iv).

Now we prove the ‘if’ part of Theorem 3.9. By Proposition 3.11(ii), if (G\(i{}^{\prime }\)) is in \({\mathcal {G}}^{cis}\) then (Gi) is in \({\mathcal {G}}^{cis}\), where (G\({1}^{\prime }\))-(G\({5}^{\prime }\)) are shown in Fig. 12. Let G be one of (G\({1}^{\prime }\))-(G\({5}^{\prime }\)), and \(\tau \) be its sign.

Fig. 12
figure 12

Graphs (G\({1}^{\prime }\))-(G\({5}^{\prime }\))

(G\({1}^{\prime }\)) and (G\({2}^{\prime }\)) It is trivial that the graph (G\({1}^{\prime }\)) is in \({\mathcal {G}}^{cis}\), since either \(I_{(G,\tau )}=\{0\}\) and the triangle \({\mathbf {w}}\) is odd-signed in \((G,\tau )\), or \(I_{(G,\tau )}=\left\langle B_{{\mathbf {w}}}\right\rangle \) and \({\mathbf {w}}\) is even-signed in \((G,\tau )\). Suppose that G is (G\({2}^{\prime }\)). Let \({\mathbf {w}}\) and \({\mathbf {w}}'\) be two triangles of G. If one of \({\mathbf {w}}\) and \({\mathbf {w}}'\) is even-signed in \((G,\tau )\), then \(I_{(G,\tau )}\) is a complete intersection by Proposition 3.6. Suppose that \({\mathbf {w}}\) and \({\mathbf {w}}'\) are odd-signed in \((G,\tau )\). Then, \((G,\tau )\) has only one primitive walk, by Theorem 3.1, which is the cycle \({\mathbf {w}}''\) of length four. Thus, \(I_{(G,\tau )}=\left\langle B_{{\mathbf {w}}''} \right\rangle \), and so \(I_{(G,\tau )}\) is a complete intersection.

(G\({3}^{\prime }\)) Suppose that G is (G\({3}^{\prime }\)). If one of triangles having a vertex of degree two is even-signed in \((G,\tau )\), then \(I_{(G,\tau )}\) is a complete intersection by Proposition 3.6, since we already show that the graph in (G\({2}^{\prime }\)) is in \({\mathcal {G}}^{cis}\). Hence, suppose that both triangles having a vertex of degree two are odd-signed in \((G,\tau )\). We will find \(2(=r(G,\tau ))\) binomials which generate \(I_{(G,\tau )}\).

Fig. 13
figure 13

All possible primitive walks in \((G,\tau )\) when G is (G\(3^{\prime }\))

By Theorem 3.1, the set of primitive walks is a subset of \(\{{\mathbf {w}}_1,\ldots ,{\mathbf {w}}_5\}\), where \({\mathbf {w}}_1,\ldots ,{\mathbf {w}}_5\) are the closed walks in Fig. 13. If the triangle \({\mathbf {w}}_1\) is even-signed in \((G,\tau )\), then G has only three primitive walks \({\mathbf {w}}_1\), \({\mathbf {w}}_2\) and \({\mathbf {w}}_3\), and \(B_{{\mathbf {w}}_3}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2}\right\rangle \) by Corollary 4.5. If \({\mathbf {w}}_1\) is odd-signed in \((G,\tau )\), then G has only three primitive walks \({\mathbf {w}}_3\), \({\mathbf {w}}_4\) and \({\mathbf {w}}_5\), and \(B_{{\mathbf {w}}_3}\in \left\langle B_{{\mathbf {w}}_4},B_{{\mathbf {w}}_5}\right\rangle \) by Corollary 4.5.

(G\({4}^{\prime }\)) Suppose that G is (G\({4}^{\prime }\)). Similar to previous case, by Proposition 3.6, we may assume that two triangles are odd-signed in \((G,\tau )\). Then, we will find \(2(=r({G,\tau }))\) binomials which generate \(I_{(G,\tau )}\). Note that the six walks defined as Fig. 14 are all possible primitive walks.

Fig. 14
figure 14

All possible primitive walks in \((G,\tau )\) when G is (G\(4^{\prime }\))

If \({\mathbf {w}}_1\) is even-signed in \((G,\tau )\), then \((G,\tau )\) has only four primitive walks \({\mathbf {w}}_1\), \({\mathbf {w}}_2\), \({\mathbf {w}}_3\) and \({\mathbf {w}}_4\), and \(B_{{\mathbf {w}}_3},B_{{\mathbf {w}}_4}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2}\right\rangle \) by Corollary 4.5. If \({\mathbf {w}}_1\) is odd-signed in \((G,\tau )\), then \((G,\tau )\) has only four primitive walks \({\mathbf {w}}_3\), \({\mathbf {w}}_4\), \({\mathbf {w}}_5\) and \({\mathbf {w}}_6\), and \(B_{{\mathbf {w}}_3},B_{{\mathbf {w}}_4}\in \left\langle B_{{\mathbf {w}}_5},B_{{\mathbf {w}}_6}\right\rangle \) by Corollary 4.5.

(G\({5}^{\prime }\)) Suppose that G is (G\({5}^{\prime }\)). Similar to previous case, by Proposition 3.6, we may assume that two triangles having a vertex of degree two are odd-signed in \((G,\tau )\). We will find \(3(=r({G,\tau }))\) binomials which generate \(I_{(G,\tau )}\). Consider closed walks \({\mathbf {a}}\), \({\mathbf {b}}\), \({\mathbf {x}}_1\), \({\mathbf {x}}_2\), and \({\mathbf {x}}_3\), defined as Fig. 15.

Fig. 15
figure 15

Five closed walks in G when G is (G\(5^{\prime }\)), where \({\mathbf {x}}_1\sim {\mathbf {x}}_3\) are even-signed in \((G,\tau )\)

We consider cases according to \(\mu ({\mathbf {a}})\) and \(\mu ({\mathbf {b}})\), and then, in each case we will define six walks \({\mathbf {w}}_1\sim {\mathbf {w}}_6\) as Fig. 16.Footnote 4 Then, \((G,\tau )\) has only 9 primitive walks, \({\mathbf {w}}_1\), \(\ldots \), \({\mathbf {w}}_6\), \({\mathbf {x}}_1\), \({\mathbf {x}}_2\), and \({\mathbf {x}}_3\), and then \(B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_3}\) generate \(I_{(G,\tau )}\), since it follows from Corollary 4.5 that

$$\begin{aligned}&B_{{\mathbf {w}}_4}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2}\right\rangle ,\ \ B_{{\mathbf {w}}_5}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_3}\right\rangle ,\ \ B_{{\mathbf {w}}_6}\in \left\langle B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_3}\right\rangle , \\&\quad B_{{\mathbf {x}}_1},B_{{\mathbf {x}}_2}\in \left\langle B_{{\mathbf {w}}_3},B_{{\mathbf {w}}_4}\right\rangle ,\ \ B_{{\mathbf {x}}_3}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_6}\right\rangle . \end{aligned}$$

\(\square \)

Fig. 16
figure 16

Six primitive walks when G is (G\(5^{\prime })\)

5.3 Proof of Theorem 3.10

First, we note that each of \(G_1\sim G_8\) in Fig. 17 does not belong to \({\mathcal {G}}^{ci}\) by Algorithm 2.4.Footnote 5 Therefore, those eight graphs are not in \({\mathcal {G}}^{cis}\).

Fig. 17
figure 17

Eight graphs \(G_1\sim G_8\) whose toric ideals are not complete intersections

Proof of Theorem 3.10

It is sufficient to consider only connected graphs. We first show the ‘only if’ part. Suppose that G is a connected graph in \({\mathcal {G}}^{cis}\). For a nonedge block F of G, F is one of (G1)–(G5) by Proposition 3.5 and Theorem 3.9. If G has at most one nonedge block, then (i) or (ii) holds. Now suppose that G has at least two nonedge blocks.

Claim 5.8

Suppose that \(F_1\) and \(F_2\) are two nonedge blocks of G such that \(F_1\) is not (G1). Let \({\mathbf {p}}\) be a shortest path from a vertex of \(F_1\) to a vertex of \(F_2\), and \(C^{(i)}\) an induced cycle of \(F_i\) having a vertex of \({\mathbf {p}}\). Then, \(F_1\) is (G2), the cycle \(C^{(1)}\) is a triangle, and \(\deg _{F_1}(v_1)=2\), where \(v_1=V(F_1)\cap V({\mathbf {p}})\).

Proof

Since \(F_1\) is not (G1), we can take another induced cycle \(C^{(0)}\) of \(F_1\) which shares an edge with \(C^{(1)}\). Let \(H=G[V(C^{(0)})\cup V(C^{(1)})\cup V(C^{(2)})\cup V({\mathbf {p}})]\). Note that H is in \({\mathcal {G}}^{cis}\) by Corollary 3.7. Using Proposition 3.11(i), by contracting ears, we obtain a graph \(H^*\) in \({\mathcal {G}}^{cis}\). Let \(C^{(i)}_*\) and \({\mathbf {p}}^*\) be the cycle and the path of \(H^*\) corresponding to \(C^{(i)}\) and \({\mathbf {p}}\), respectively. Note that \({\mathbf {p}}^*\) is a path of length at most one. Since the graphs \(G_1\) and \(G_2\) in Fig. 17 are not in \({\mathcal {G}}^{cis}\), it follows that \(v_1\) has degree two in \(H^*[ V(C^{(0)}_*)\cup V(C^{(1)}_*)]\).

From the fact that the graphs \(G_3\) and \(G_4\) in Fig. 17 are not in \({\mathcal {G}}^{cis}\), together with Proposition 3.11(i), the cycle \(C^{(1)}\) must be a triangle. Similarly, from the fact that the graphs \(G_5\), \(G_6\), \(G_7\), and \(G_8\) in Fig. 17 are not in \({\mathcal {G}}^{cis}\), it follows that \(F_1\) must be (G2), and therefore, \(\deg _{F_1}(v_1)=2\). \(\square \)

By Claim 5.8, it is sufficient to show that G has at most two nonedge blocks. Suppose to contrary that G has three nonedge blocks \(F_1\), \(F_2\), \(F_3\). Without loss of generality, we may assume that the distance between \(F_1\) and \(F_2\) is maximum among the distances between two of \(F_1\), \(F_2\) and \(F_3\). Let \({\mathbf {p}}\) be a shortest path between \(F_1\) and \(F_2\). For each \(i\in \{1,2\}\), we take an induced cycle \(C^{(i)}\) of \(F_i\) having a vertex of \({\mathbf {p}}\). Let H be a smallest induced connected subgraph of G containing \(V(C^{(1)})\cup V(C^{(2)})\cup V({\mathbf {p}})\cup V(F_3)\). Note that \(H\in {\mathcal {G}}^{cis}\) by Corollary 3.7. In addition, there is a vertex \(w_i\) such that \(\deg _{H}(w_i)=2\) and \(w_i\in C^{(i)}\) for each \(i=1,2\). By Proposition 3.11(ii), by subdividing edges incident to \(w_1\) and \(w_2\) properly so that \(C^{(1)}\) and \(C^{(2)}\) become cycles of odd length, we can obtain a new graph \(H'\) in \({\mathcal {G}}^{cis}\) with two nonbipartite blocks. If \(F_3\) is not bipartite, then \(H'\) has three nonbipartite blocks, and so \(H'\not \in {\mathcal {G}}^{ci}\) by Theorem 2.5(v), a contradiction. Thus, \(F_3\) is bipartite. Then, we can find a vertex \(w_3\in F_3\) with \(\deg _{H'}(w_3)=2\) and let \(H''\) be the graph obtained from \(H'\) by subdividing an edge incident to \(w_3\) once. Then, \(H''\) has three nonbipartite blocks and so \(H'\not \in {\mathcal {G}}^{ci}\) by Theorem 2.5(v). On the other hand, \(H'\in {\mathcal {G}}^{cis}\) by Proposition 3.11(ii), and we reach a contradiction.

Now we show the ‘only if’ part. Note that for every sign \(\tau \) of G, any primitive walk in \((G,\tau )\) does not contain a pendent edge e by Theorem 3.1. Thus, each graph satisfying (i) or (ii) is in \({\mathcal {G}}^{cis}\) by Theorem 3.9. Consider graphs satisfying (iii). Together with Proposition 3.11(ii), it is sufficient to show that each of the six graphs (H1)-(H3) and (H\(1'\))-(H\(3'\)) in Fig. 18 is in \({\mathcal {G}}^{cis}\). We consider (H1)-(H3) first. Let G be one of (H1)-(H3), and \(\tau \) be its sign.

Fig. 18
figure 18

Graphs (H1)-(H3) and (H\(1'\))-(H\(3'\))

(H1) Suppose that G is (H1). Let \({\mathbf {w}}\) and \({\mathbf {w}}'\) be two triangles in G. By Proposition 3.6, it is sufficient to suppose that each of \(\mathbf {{\mathbf {w}}}\) and \(\mathbf {{\mathbf {w}}'}\) is odd-signed in \((G,\tau )\). Then, there is only one primitive walk \({\mathbf {w}}+{\mathbf {w}}'\) and \(r(G,\tau )=1\), which implies that \((G,\tau )\) is a complete intersection.

(H2) Suppose that G is (H2). Let \({\mathbf {a}}\) be the triangle without a vertex of degree two. Since we already show that (G\(2'\)) in Fig. 12 and (H1) are in \({\mathcal {G}}^{cis}\), by Proposition 3.6, we may assume that the two triangles other than \({\mathbf {a}}\) are odd-signed in \((G,\tau )\). We will find \(2(=r(G,\tau ))\) binomials which generate \(I_{(G,\tau )}\). By Theorem 3.1, the six walks defined as Fig. 19 are all possible primitive walks.

Fig. 19
figure 19

All possible primitive walks in \((G,\tau )\) when G is (H2)

If \({\mathbf {a}}\) is even-signed in \((G,\tau )\), then \((G,\tau )\) has only four primitive walks \({\mathbf {w}}_1\), \({\mathbf {w}}_2\), \({\mathbf {w}}_3\), and \({\mathbf {w}}_4\), and \(B_{{\mathbf {w}}_3},B_{{\mathbf {w}}_4} \in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2}\right\rangle \) by Corollary 4.5. If \({\mathbf {a}}\) is odd-signed in \((G,\tau )\), then \((G,\tau )\) has only four primitive walks \({\mathbf {w}}_3\), \({\mathbf {w}}_4\), \({\mathbf {w}}_5\), and \({\mathbf {w}}_6\), and \(B_{{\mathbf {w}}_3},B_{{\mathbf {w}}_4} \in \left\langle B_{{\mathbf {w}}_5},B_{{\mathbf {w}}_6}\right\rangle \) by Corollary 4.5.

(H3) Suppose that G is (H3). Since we already show that (H2) is in \({\mathcal {G}}^{cis}\), by Proposition 3.6, we may assume that both triangles having a vertex of degree two are odd-signed in \((G,\tau )\). Then, we will find \(3(=r(G,\tau ))\) binomials which generate \(I_{(G,\tau )}\). Consider six walks \({\mathbf {a}}\), \({\mathbf {b}}\), \({\mathbf {x}}_1\sim {\mathbf {x}}_4\) defined as Fig. 20.

Fig. 20
figure 20

Six closed walks in G when G is (H3), where \({\mathbf {x}}_1\sim {\mathbf {x}}_4\) are even-signed in \((G,\tau )\)

Now we divide cases according to \(\mu ({\mathbf {a}})\) and \(\mu ({\mathbf {b}})\). In each case, we define eight walks \({\mathbf {w}}_1\sim {\mathbf {w}}_8\) as Fig. 21.Footnote 6 Then, \((G,\tau )\) has only 12 primitive walks, \({\mathbf {w}}_1, \dots , {\mathbf {w}}_8\), \({\mathbf {x}}_1\),..., \({\mathbf {x}}_4\), and then \(B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_3}\) generate \(I_{(G,\tau )}\), since it follows from Corollary 4.5 that

$$\begin{aligned}&B_{{\mathbf {w}}_4}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_2}\right\rangle ,\quad B_{{\mathbf {w}}_5},B_{{\mathbf {w}}_6}\in \left\langle B_{{\mathbf {w}}_1},B_{{\mathbf {w}}_3}\right\rangle ,\quad B_{{\mathbf {w}}_7}, B_{{\mathbf {w}}_8}\in \left\langle B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_3}\right\rangle ,\\&B_{{\mathbf {x}}_1},B_{{\mathbf {x}}_2}\in \left\langle B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_6}\right\rangle ,\quad B_{{\mathbf {x}}_3},B_{{\mathbf {x}}_4}\in \left\langle B_{{\mathbf {w}}_2},B_{{\mathbf {w}}_5}\right\rangle . \end{aligned}$$
Fig. 21
figure 21

Eight primitive walks when G is (H3)

Let \((G,\tau )\) and \((G,\tau ')\) be such that G is (Hi), \(G'\) is (H\(i'\)) (\(i\in \{1,2,3\}\)), and the sign coincides on a cycle. Then, \(r(G,\tau )=r(G',\tau ')\) and the primitive walks are also corresponding. Similar to the argument of (Hi), we can conclude that (H\(i'\)) is in \({\mathcal {G}}^{cis}\).

\(\square \)