A note on counting flows in signed graphs

Tutte initiated the study of nowhere-zero flows and proved the following fundamental theorem: For every graph $G$ there is a polynomial $f$ so that for every abelian group $\Gamma$ of order $n$, the number of nowhere-zero $\Gamma$-flows in $G$ is $f(n)$. For signed graphs (which have bidirected orientations), the situation is more subtle. For a finite group $\Gamma$, let $\epsilon_2(\Gamma)$ be the largest integer $d$ so that $\Gamma$ has a subgroup isomorphic to $\mathbb{Z}_2^d$. We prove that for every signed graph $G$ and $d \ge 0$ there is a polynomial $f_d$ so that $f_d(n)$ is the number of nowhere-zero $\Gamma$-flows in $G$ for every abelian group $\Gamma$ with $\epsilon_2(\Gamma) = d$ and $|\Gamma| = 2^d n$. Beck and Zaslavsky had previously established the special case of this result when $d=0$ (i.e., when $\Gamma$ has odd order).


Introduction
Throughout the paper we permit graphs to have both multiple edges and loops. Let G be a graph equipped with an orientation of its edges and let Γ be an abelian group written additively. We say that a function ϕ : E(G) → Γ is a Γ-flow if it satisfies the following equation (Kirchhoff's law) for every vertex v ∈ V (G).
where δ + (v) (δ − (v)) denote the set of edges directed away from (toward) the vertex v. We say that ϕ is nowhere-zero if 0 ∈ ϕ(E(G)). If ϕ is a Γ-flow and we switch the direction of an edge e of G, we may obtain a new flow by replacing ϕ(e) by its additive inverse. Note that this does not affect the property of being nowhere-zero. So, in particular, whenever some orientation of G has a nowhere-zero Γ-flow, the same will be true for every orientation. More generally, the number of nowhere-zero Γ-flows in two different orientations of G will always be equal, and we denote this important quantity by Φ(G, Γ). Tutte [8] introduced the concept of a nowhere-zero Γ-flow and proved the following key theorem about counting them. Theorem 1.1 (Tutte [8]) Let G be a graph.
Our interest in this paper is in counting nowhere-zero Γ-flows in signed graphs, so we proceed with an introduction to this setting. A signature of a graph G is a function σ : E(G) → {−1, 1}. We say that a subgraph H is positive if e∈E(H) σ(e) = 1 and negative if this product is −1, in particular we call an edge e positive (negative) if the graph e induces is positive (negative). We say that two signatures σ and σ are equivalent if the symmetric difference of the negative edges of σ and the negative edges of σ is an edge-cut of G. Let us note that two signatures are equivalent if and only if they give rise to the same set of negative cycles; this instructive exercise was observed by Zaslavsky [9]. Observe that if σ is a signature and C is an edge-cut of G, then we may form a new signature σ equivalent to σ by the following rule: So, in particular, for any signature σ and a non-loop edge e, there is a signature σ equivalent to σ with σ (e) = 1. We define a signed graph to consist of a graph G together with a signature σ G . As suggested by our terminology, we will only be interested in properties of signed graphs which are invariant under changing to an equivalent signature. Following Bouchet [2] we now introduce a notion of a half-edge so as to orient a signed graph. For every graph G we let H(G) be a set of half edges obtained from the set of edges E(G) as follows. Each edge e = uv contains two distinct half edges h and h incident with u and v, respectively. Note that if u = v, e is a loop containing two half-edges both incident with u. For a half-edge h ∈ H(G), we let e h denote the edge of G that contains h. To orient a signed graph G we will equip each half edge with an arrow and direct it either toward or away from its incident vertex. Formally, we define an orientation of a signed graph G to be a function τ : H(G) → {−1, 1} with the property that for every edge e containing the half edges h, h we have We think of a half edge h with τ (h) = 1 (τ (h) = −1) to be directed toward (away from) its endpoint. Note that in the case when σ G is identically 1, both positive negative Figure 1: Orientations of edges in a signed graph arrows on every half edge are oriented consistently, and this aligns with the usual notion of orientation of an (ordinary) graph.
We define a Γ-flow in such an orientation of a signed graph G to be a function ϕ : E(G) → Γ which obeys the following rule at every vertex v As before, we call ϕ nowhere-zero if 0 ∈ ϕ(E(G)). Note that in the case when σ G is identically 1, this notion agrees with our earlier notion of a (nowherezero) flow in an orientation of a graph. Also note that, as before, we may obtain a new flow by reversing the orientation of an edge e (i.e., by changing the sign of τ (h) for both half edges contained in e) and then replacing ϕ(e) by its additive inverse. This new flow is nowhere-zero if and only if the original flow had this property. In light of this, we may now define Φ(G, Γ) to be the number of nowhere-zero Γ-flows in some (and thus every) orientation of the signed graph G.
As we remarked, we are only interested in properties of signed graphs which are invariant under changing to an equivalent signature, and this is indeed the case for Φ(G, Γ). To see this, suppose that τ is an orientation of the signed graph G and that ϕ is a nowhere-zero Γ-flow for this orientation. Assume that the signature σ G is obtained from σ G by flipping the sign of every edge in the edge-cut δ(X) (here X ⊆ V (G) and δ(X) is the set of edges with exactly one end in X). Modify the orientation τ to obtain a new orientation τ by switching the sign of h for every half edge incident with a vertex of X. It is straightforward to verify that τ is now an orientation of the signed graph given by G and σ G , and ϕ is still a Γ-flow for this new oriented signed graph.
Beck and Zaslavsky [1] considered the problem of counting nowhere-zero flows in signed graphs and proved the following analogue of Tutte's Theorem 1.1 for groups of odd order. Theorem 1.2 (Beck and Zaslavsky [1]) Let G be a signed graph.

2.
There exists a polynomial f so that for every odd integer n, every abelian group Γ with |Γ| = n satisfies f (n) = Φ(G, Γ).
The purpose of this note is to extend the above theorem to allow for groups of even order by incorporating another parameter. For any finite group Γ we define 2 (Γ) to be the largest integer d so that Γ contains a subgroup isomorphic to Z d 2 (here Z 2 = Z/2Z). The proof of the above theorem is a straightforward adaptation of Tutte's original method, so it may seem surprising it was not proved earlier. The cause of this may be some confusion over whether or not it was already done. The paper by Beck and Zaslavsky [1] includes a footnote with the following comment: "Counting of flows in groups of even order has been completely resolved by Cameron et al.". This refers to an interesting paper of Cameron, Jackson, and Rudd [3] which concerns problems such as counting the number of orbits of nowhere-zero flows under a group action. However, the methods developed in this paper only apply to counting nowhere-zero flows in (ordinary) graphs for the reason that the incidence matrix of an oriented graph is totally unimodular. Since the corresponding incidence matrices of oriented signed graphs are generally not totally unimodular (and not equivalent to such matrices under elementary row and column operations), our result does not follow from Cameron et al.
Before giving the proof of our theorem, let us pause to make one further comment about nowhere-zero flows in signed graphs which consist of a single loop edge e. For a loop edge e with signature 1 we may obtain a nowhere-zero flow by assigning any nonzero value x to the edge e. So, two groups Γ and Γ will have the same number of nowhere-zero flows for this graph if and only if |Γ| = |Γ |. If, on the other hand, our graph consists of a single loop edge e which is negative, then the number of nowhere-zero Γ-flows in this graph will be precisely the number of nonzero group elements y for which 2y = 0 (i.e., the number of elements of order 2). All elements of order 2 form (together with the zero element) a subgroup isomorphic to Z 2(Γ) 2 , thus this number is precisely 2 2(Γ) − 1. So, in order for two groups Γ and Γ to have the same number of nowhere-zero flows on this graph, they must satisfy 2 (Γ) = 2 (Γ ). By our main theorem, two groups Γ and Γ will satisfy Φ(G, Γ) = Φ(G, Γ ) for every signed graph G if and only if this holds for every one edge graph. This statement is in precise analogy with the situation for flows in ordinary graphs.
x y Figure 2: Two graphs that determine Φ(G, Γ) for every other graph G.
We close the introduction by mentioning related results about the number of integer flows. Tutte [7] defined a nowhere-zero n-flow to be a Z-valued flow that only uses values k with 0 < |k| < n. Surprisingly, a graph has a nowhere-zero nflow if and only if it has a nowhere-zero Z n -flow. Let us use Φ(G, n) to denote the number of nowhere-zero n-flows on G. While Φ(G, n) and Φ(G, Z n ) are either both zero or both nonzero, the actual values differ. An analogical statement to the second part of Theorem 1.1 is again true, by a result of Kochol [5]; that is, Φ(G, n) is a polynomial in n. His result has already been extended for bidirected graphs. Beck and Zaslavsky [1] prove that for a signed graph G, Φ(G, n) is a quasipolynomial of period 1 or 2; that is, there are polynomials p 0 and p 1 such that Φ(G, n) is equal to p 0 (n) for even n and to p 1 (n) for odd n. Both the Kochol's and the Beck and Zaslavsky's result is proved by an illustrative application of Ehrhart's theorem [4,6].

The proof
The proof of our main theorem requires the following lemma about counting certain solutions to an equation in an abelian group.
Lemma 2.1 Let Γ be an abelian group with 2 (Γ) = d and |Γ| = 2 d n. Then the number of solutions to 2x 1 + · · · + 2x t = 0 with x 1 , . . . , x t ∈ Γ \ {0} is given by the formula Proof. We claim that for every abelian group of order m, the number of solutions to x 1 + · · · + x t = 0 with x 1 , . . . , x t = 0 is given by the formula We prove this by induction on t. The base case t = 1 holds trivially. For the inductive step, we may assume t ≥ 2. The total number of solutions to the given equation for which x 1 , . . . , x t−1 are nonzero, but x t is permitted to have any value is exactly (m − 1) t−1 since we may choose the nonzero terms x 1 , . . . , x t−1 arbitrarily and then set x i to obtain a solution. By induction, there are exactly We conclude that the number of solutions with all variables nonzero is Now, to prove the lemma, we consider the group homomorphism ψ : Γ → Γ given by the rule ψ(x) = x + x. Note that the kernel of ψ, denoted ker(ψ), is isomorphic to Z d 2 . Now x 1 , . . . , x t satisfy 2x 1 + · · · + 2x t = 0 if and only if ψ(x 1 ), . . . , ψ(x t ) satisfy ψ(x 1 ) + · · · + ψ(x t ) = 0. So, to count the number of solutions to 2x 1 + · · · + 2x t = 0 in Γ with all variables nonzero, we may count all possible solutions to y 1 + · · · + y t = 0 within the group ψ(Γ) and then, for each such solution, count the number of nonzero sequences x 1 , . . . , x t in Γ with ψ(x i ) = y i . For every y i ∈ ψ(Γ), the pre-image ψ −1 (y i ) is a coset of ker(ψ). So the number of nonzero elements x i with ψ(x i ) = y i will equal 2 d if y i = 0 and 2 d − 1 if y i = 0. Now we will combine this with the claim proved above. For every 0 ≤ s ≤ t, the number of solutions to y 1 + · · · + y t = 0 in the group ψ(Γ) with exactly s nonzero terms is given by Each such solution will be the image of exactly (2 d ) s (2 d − 1) t−s nonzero sequences x 1 , . . . , x t ∈ Γ. Summing over all s gives the desired formula.
We also require the usual contraction-deletion formula for counting nowherezero flows.
Observation 2.2 Let G be an oriented signed graph and let e ∈ E(G) satisfy σ G (e) = 1.  Proof. The first part follows from the observation that every nowhere-zero flow in G is obtained from a nowhere-zero flow in G \ e by choosing an arbitrary nonzero value for e. The second part follows from the usual contraction-deletion formula for flows. Suppose ϕ is a nowhere-zero flow in G/e, and return to the original graph G by uncontracting e. It follows from elementary considerations that there is a unique value ϕ(e) we can assign to e so that ϕ is a flow. It follows that Φ(G/e, Γ) is precisely the number of Γ-flows in G for which all edges except possibly e are nonzero. This latter count is exactly Φ(G, Γ) + Φ(G \ e, Γ) and this completes the proof.
Equipped with these lemmas, we are ready to prove our main theorem about counting group-valued flows.
Proof of Theorem 1.3. For the first part, we proceed by induction on |E(G)|. Our base cases will consist of one vertex graphs G for which every edge has signature −1. In this case we may orient G so that every half-edge is directed toward its endpoint. If the edges are e 1 , . . . , e t , then to find a nowhere-zero flow we need to assign each edge e i a nonzero value x i so that 2x 1 + · · · + 2x t = 0. By Lemma 2.1, the number of ways to do this is the same for Γ and Γ .
For the inductive step, we may assume G is connected, as otherwise the result follows by applying induction to each component. If G has a loop edge e with σ G (e) = 1, then the result follows from the previous lemma and induction on G \ e. Otherwise G must have a non-loop edge e. By possibly switching to an equivalent signature, we may assume that σ G (e) = 1. Now our result follows from the previous lemma and induction on G \ e and G/e. The second part of the theorem follows by a very similar argument. In the base case when G is a one vertex graph in which every edge has signature −1, the desired polynomial is given by Lemma 2.1. For the inductive step, we may assume G is connected, as otherwise the result follows by applying induction to each component and taking the product of these polynomials. If we are not in the base case, then G must either have a loop edge with signature 1 or a non-loop edge e which we may assume has signature 1. In either case, Observation 2.2 and induction yield the desired result.