Alternating Signed Bipartite Graphs and Difference-1 Colourings

We investigate a class of 2-edge coloured bipartite graphs known as alternating signed bipartite graphs (ASBGs) that encode the information in alternating sign matrices. The central question is when a given bipartite graph admits an ASBG-colouring; a 2-edge colouring such that the resulting graph is an ASBG. We introduce the concept of a difference-1 colouring, a relaxation of the concept of an ASBG-colouring, and present a set of necessary and sufficient conditions for when a graph admits a difference-1 colouring. The relationship between distinct difference-1 colourings of a particular graph is characterised, and some classes of graphs for which all difference-1 colourings are ASBG-colourings are identified. One key step is Theorem 3.4.6, which generalises Hall's Matching Theorem by describing a necessary and sufficient condition for the existence of a subgraph $H$ of a bipartite graph in which each vertex $v$ of $H$ has some prescribed degree $r(v)$.


Introduction
In this article, we develop a theme introduced by Brualdi, Kiernan, Meyer, and Schroeder in [1], by investigating a class of bipartite graphs related to alternating sign matrices. In general, we may associate to any matrix the bipartite graph whose vertices correspond to rows and columns, and where an edge between the vertices representing Row i and Column j encodes the information that the (i, j) entry is non-zero. Additional features of the non-zero entries (for example, sign) might be indicated by assigning colours to the edges. In the case of alternating sign matrices, the special matrix structure translates to particular combinatorial properties of the resulting bipartite graphs. We introduce the main objects of interest in this opening section.

Alternating Sign Matrices and Alternating Signed Bipartite Graphs
Definition 1.1.1. An alternating sign matrix (ASM) is a (0, 1, −1)-matrix in which all row and column sums are 1, and the non-zero elements in each row and column alternate in sign.
It is easily observed that permutation matrices are examples of ASMs, and there are contexts in which the concept of an ASM arises as a natural extension of a permutation. Alternating sign matrices were first investigated by Mills, Robbins, and Rumsey [2], who observed their connection to a variant of the ordinary determinant function related to the technique of Dodgson condensation [3]. In their construction, the role of ASMs is similar to that of permutations in the usual definition of the determinant. This motivated the problem of enumerating the ASMs of size n × n, leading to the Alternating Sign Matrix Conjecture, namely that this number is 1!4!7! . . . (3n − 2)! n!(n + 1)! . . . (2n − 1)! .
Independent and very different proofs were published in 1996 by Zeilberger [4] and Kuperberg [5], respectively using techniques from enumerative combinatorics and from statistical mechanics. Zeilberger's article establishes that the number of n × n ASMs is equal to the number of totally symmetric self-complementary plane partitions in a 2n × 2n × 2n box, and the connection between these two classes of objects is further explored by Doran [6]. The connection to physics arises from the square ice model for two-dimensional crystal structures; square patches of

ASBG-Colourings
In this section, we consider properties of edge-colourings compatible with an ASBG structure.

Obstacles to ASBG-Colourability
We define a colouring c of a graph G to be a function c : E(G) → {r, b}, and denote the graph G endowed with the colouring c by G c . If H is a subgraph of G, then c restricts to a colouring c H of H. We denote by H c the graph H with edges coloured according to c H . If G c is an ASBG and v is a vertex of G c , then the numbers deg B (v) and deg R (v) of blue and red edges incident with v, respectively, must satisfy the following relation for all vertices v: Definition 2.1.1. A 2-edge colouring c of a graph G is an ASBG-colouring of G if G c is an ASBG. The graph G is ASBG-colourable if there exists an ASBG-colouring of G.
The following are some basic necessary (but not sufficient) criteria that a graph G must meet for it to be ASBGcolourable: • G must be bipartite and balanced.
• The degree of each vertex in G must be odd, from (1).

Example 2.1.2.
Let G be the following graph: We attempt to colour the edges of G with a colouring c, so that (1) is satisfied at every vertex: • All edges incident with vertices of degree 1 must be blue.
• Now 4 out of 5 edges incident with vertices A and B are blue, so it is not possible for G c to satisfy (1) at each vertex.
Therefore G is not ASBG-colourable.
Example 2.1.3. Now consider the following graph G with edge-colouring c.
We observer that G has a unique colouring that satisfies (1) at every vertex. However, we claim that there is no ordering of the vertices that satisfies the condition of Definition 1.1.3 for this colouring. The conditions of Definition 1.1.3, applied to the vertex A, requires that Y occurs between X and Z in an ordering of the vertices of G. The same condition applied to B requires that X occurs between Y and Z. Since these requirements are incompatible, we conclude that G is not ASBG-colourable.
Examples 2.1.2 and 2.1.3 demonstrate two different ways in which a graph can fail to be ASBG-colourable. If a graph G has an edge colouring c that satisfies (1) at every vertex, we say that G has a difference-1 colouring, and if the vertices of G c can be ordered such that the edges incident with each vertex alternate in colour, beginning and ending with blue, we say that G c is configurable.
In this paper, we will present necessary and sufficient conditions for a given graph to have a difference-1 colouring, as well as classes of graphs which are configurable for any difference-1 colouring. We will also give a generalisation of Hall's Matching Theorem, which will be needed further in the paper.

Difference-1 Colourings
NOTE: We have introduced the concept of a difference-1 colouring specifically to address the question of ASBGcolourability. Therefore, we will consider the existence of difference-1 colourings only for balanced bipartite graphs. Proof. Let c be a difference-1 colouring of G, and let b and r be the number of blue and red edges in G c , respectively. Let (P 1 , P 2 ) be the bipartition of V(G). Each vertex v of P 1 satisfies deg B (v) − deg R (v) = 1. Summing this expression over all v ∈ P 1 , we have

Definition 2.2.4.
A leaf is a vertex of degree 1.

Definition 2.2.5.
A twig is a configuration of three vertices, consisting of two leaves incident with the third vertex of the twig (called the base of the twig), which has degree 3.
One useful property of leaves and twigs is that the colouring of their edges in any difference-1 colouring is uniquely determined. All edges incident with leaves must be coloured blue, which means that the remaining edge incident with the base of a twig must be coloured red, to satisfy (1).

Definition 2.2.6.
A leaf-twig configuration at a vertex v is a configuration of four vertices (distinct from v), consisting of a leaf and a twig, where the base of the twig and the leaf are both incident with v.
NOTE: We refer to the operation of deleting the four vertices of a leaf-twig configuration, and their four incident edges, as removing a leaf-twig configuration from G. We also refer to the operation of adding four vertices to G in such a configuration, with the leaf and the base incident with a vertex v of G, as adding a leaf-twig configuration to G at v.
A leaf-twig configuration with its only difference-1 colouring. Lemma 2.2.7. Let G and G be graphs with the property that G is obtained from G by the addition of a leaf-twig configuration. Then G has a difference-1 colouring if and only if G has a difference-1 colouring.
Proof. Since the addition of a leaf-twig configuration involves one additional edge of each colour at a single vertex of G, it is easily observed that any difference-1 colouring of G extends in a unique way to a difference-1 colouring of G . On the other hand, any difference-1 colouring of G restricts to a difference-1 colouring of G.
A consequence of Lemma 2.2.7 is that repeated addition and/or removal of leaf-twig configurations does not affect the status of a graph with respect to the existence of a difference-1 colouring.
NOTE: For any graph with a difference-1 colouring that is not configurable, it is possible to add leaf-twig configurations so the resulting graph is configurable. Adding leaf-twig configurations to a configurable graph will always result in a configurable graph.
Definition 2.2.8. Given a graph G, we define the reduced form of G be the graph that results from deleting leaftwig configurations from G until none remain. We also refer to a graph as reduced if it possesses no leaf-twig configuration.
NOTE: Although the reduced form of G is not necessarily uniquely determined as a subgraph of G, it is uniquely determined as a graph, up to isomorphism.
It is a consequence of Lemma 2.2.7 that G has a difference-1 colouring if and only if its reduced form has a difference-1 colouring.

Configurability for Cactus Graphs
In this section, we examine a class of graphs for which any graph with a difference-1 colouring is configurable; namely cactus graphs.

Definition 2.3.1.
A cactus graph is a connected graph in which any pair of cycles share at most one vertex.
Equivalently, a cactus graph is a connected graph in which any edge belongs to at most one cycle. Our main result in this section is Theorem 2.3.3, which asserts that for a cactus graph, the existence of a difference-1 colouring is a sufficient condition for ASBG-colourability. Lemma 2.3.2 provides the key technical ingredient in the proof of our main theorem in this section. Our proof of this statement makes use of a partition of the vertex set of a bipartite cactus graph, which is explained in the following lemma. We denote the minimum distance in a graph between vertices v and u by d(v, u).

Lemma 2.3.2.
Let v be a vertex of a bipartite cactus graph G. Write k = max u∈V(G) d(v, u), and for i = 0, . . . , k define 1. If 1 i k and x ∈ V i , then x has at most two neighbours in V i−1 .
2. If 1 i k − 1 and x ∈ V i , then there is at most one vertex y in V i , distinct from x, for which x and y have a common neighbour in V i+1 . Moreover, if such a vertex y exists, then x has only one neighbour in V i−1 .
Proof. We note that V(G) is the disjoint union of the sets V i , and that, since G is bipartite, the neighbours of any vertex in V i belong to V i−1 ∪ V i+1 , for 1 i < k. For item 1, suppose that x has distinct neighbours u 1 , u 2 , u 3 in V i−1 . Each of the edges xu 1 , xu 2 , xu 3 is the intial edge of a path in G from x to v. It follows that xu 2 belongs to two distinct cycles, one including the edge xu 1 and one including the edge xu 3 , contrary to the hypothesis that G is a cactus graph. For item 2, suppose that y 1 and y 2 are two vertices of V i , distinct from x, with the property that z 1 is a common neighbour of y 1 and x in V i+1 , and z 2 is a common neighbour of y 2 and x in V i+1 . Let u be a neighbour of x in V i−1 . Then the edge xu belongs to two distinct cycles in G, one including the edges z 1 x and z 1 y 1 , and the other including the edges z 2 x and z 2 y 2 . Thus at most one element of V i \{x} shares a neighbour z with x in V i+1 . Suppose that y is such a vertex, and that x has two neighbours u 1 and u 2 in V i−1 . Then the edge u 1 x belongs to a cycle in G that includes the edges xz and zy, and also to a cycle in G that includes the edge xu 2 and no vertex of V i+1 . From this contradiction we conclude that if x shares a neighbour in V i+1 with another vertex of V i , then x has only one neighbour in V i−1 . Theorem 2.3.3. Let G be a cactus graph with difference-1 colouring c. Then G c is configurable.
Proof. We choose a vertex v of G and partition the vertex set of G into non-empty subsets V 0 = {v}, V 1 , . . . , V k as in the statement of Lemma 2.3.2. We note that (P 1 , P 2 ) is a bipartition of the vertex set of G, where P 1 = ∪ i even V i and P 2 = ∪ i odd V i . We let L and M be parallel lines embedded on the plane and position the vertex v on the line L. We configure G by positioning the vertices of P 1 and P 2 at distinct locations on L and M respectively, so that the order in which the vertices are positioned along the two lines satisfies the requirements of Definition 2.2.2. For 1 i k, the ith step in the process involves the positioning of the vertices of V i on L or M, according to whether i is even or odd. Suppose that r steps have been completed and that every vertex of ∪ r−1 i=0 V i has the property that its neighbours are positioned in a manner consistent with an ASBG-colouring. Let x 1 , . . . , x t be the vertices of V r . We position the vertices of V r+1 (on L or M) in t steps, the first of which is to position the neighbours of x 1 . At most two neighbours of x 1 (in V r−1 ) are already positioned; all further neighbours of x 1 belong to V r+1 and may be positioned in a manner that satisfies the alternating condition on colours of edges incident with x 1 . At step j we position the neighbours of x j in V r+1 . From Lemma 2.3.2 it follows that at most two neighbours of x j in G have already been assigned positions at this stage, potentially two from V r−1 or one each from V r−1 and V r+1 . In any case we may position the remaining neighbours of x j to satisfy the alternating condition on coloured edges. This iterative process results in a configuration of G.

Deciding the Existence of a Difference-1 Colouring
In this section, we develop methods of determining whether a given bipartite graph admits a difference-1 colouring. We consider this question first for trees and unicyclic graphs, where the analysis is considerably easier.

Trees
We now consider necessary and sufficient conditions for a tree to have a difference-1 colouring. As we have seen in Section 2.3, this will resolve the question of ASBG-colourability for trees, as every difference-1 colouring of a tree is configurable. We first note that the only connected ASBG that contains no red edges is P 2 , the path graph on two vertices (with its edge coloured blue). Theorem 3.1.1. Let T be a tree. Then T has a difference-1 colouring if and only if its reduced form is P 2 .
Proof. Suppose the reduced form of T is P 2 . Then T can be constructed by repeatedly adding leaf-twig configurations to P 2 . Hence, by Lemma 2.2.7, T has a difference-1 colouring. Now suppose that T has a difference-1 colouring c and is not P 2 . Choose any vertex r of T . Let u be a leaf of T which is furthest from r, and let b be the neighbour of u on the unique path from u to r. As T has a difference-1 colouring, every vertex of T has odd degree. Therefore u shares its neigbour b with at least one other vertex u 1 that is further from r than b. As u is a furthest leaf from r, this means that u 1 is also a leaf. As u and u 1 are both leaves, this means the edges ub and u 1 b must be blue in T c . This means that a third edge incident with b and another vertex v must be red. If v is not on the unique path from b to r, then v has a neighbour which is a leaf that is further from r than u, which is contrary to the choice of u. Therefore v is on the unique path from b to r. As c is a difference-1 colouring and bv is red in T c , v must be incident with at least two blue edges. Let l be a neighbour of v which is not on the unique path from v to r, such that lv is blue. As d(r, u) = d(r, l) + 1, this means that l must be a leaf, otherwise it would be incident with at least one red edge leading to a leaf further from r than u. This means that u, u 1 , b, and l make a leaf-twig configuration, with b being the base of the twig, and l the leaf. Removing this results in another tree with a difference-1 colouring (Lemma 2.2.7). Inductively, this means that leaf-twig configurations can be removed until there are no more red edges. As P 2 is the only connected ASBG with no red edges, this process will reduce T to P 2 .

Corollary 3.1.2.
A tree has an ASBG-colouring if and only if its reduced form is P 2 , and this colouring is unique.
Note that the process outlined in the proof of Theorem 3.1.1 not only gives an existence condition for an ASBGcolouring of a tree, it gives the colouring. The following observation will be needed later, for the proof of Lemma 3.2.6. Corollary 3.1.3. Let T be an ASBG-colourable tree and let r be a vertex of T . Then there is a sequence of leaf-twig removals that reduces T to a subgraph that consists of only leaves and twigs attached to r, with one more leaf than twig.
Proof. In the proof of Theorem 3.1.1, it was shown that a furthest vertex from r is always part of a removable leaf-twig configuration. So we succesively remove the furthest leaf-twig configuration from r until any remaining leaf-twig configurations are attached to r. We call the resulting tree T . Theorem 3.1.1 tells us that it is possible to remove leaf-twig configurations from T until only P 2 remains, where r is one of the vertices of this P 2 . Therefore T must be P 2 with extra leaf-twig configurations at r, which means that T consists only of leaves and twigs attached to r, with one more leaf than twig.

Unicyclic Graphs
Definition 3.2.1. A graph is unicyclic if it is connected and contains exactly one cycle.
When analysing the ASBG-colourability of graphs which are not trees, it is useful to define the skeleton of a graph.

Definition 3.2.2.
For a graph G (containing at least one cycle), we refer to the subgraph that results from repeatedly removing leaves and their incident edges, until none remain, as the skeleton Sk(G) of G.
NOTE: Sk(G) is determined as a subgraph of G. The process of repeatedly deleting leaves from a tree terminates with a single vertex, but which vertex remains depends on the order in which leaves are deleted. For this reason, we do not define the skeleton of a tree.
We also note that if G is the reduced form of G, then Sk(G ) = Sk(G).
NOTE: If G is unicyclic, then the skeleton Sk(G) is the graph consisting of the cycle in G, and G has no junctions.  Proof. The number of blue edges at v in H c is one greater than the number of red edges at v in H c . This also is the case for every vertex in T c v except possibly for v itself.
T v is an ASBG, which means that leaf-twig configurations can be removed from T v until only leaf-twig configurations attached to v remain (Corollary 3.1.3). If there are any leaf-twig configurations attached to v that are also in T v , we remove them. We have now removed all leaf-twig configurations in T v that are also in G, and the remaining graph consists of a copy of P 2 containing v with |d − 1| leaf-twig configurations attached to v. We can now delete the |d − 1| twigs or leaves that we attached to v to make T v that were not part of T v . We are now left with the reduced form of T v ; a subgraph of T v that consists either only of v, or of v with only leaves or only twigs incident with it. • Leaf-Type: A vertex of degree 3 in H, with a leaf incident with it. If a blue and red edge meet at a vertex of degree 2 in Sk(G c ), then v must be a leaf-type vertex in G.
• Twig-Type: A vertex of degree 3 in H, with the base of a twig incident with it. If two blue edges meet at a vertex of degree 2 in Sk(G c ), then v must be a twig-type vertex in G.
• Triple-Type: A vertex of degree 5 in H, with three leaves incident with it. If two red edges meet at a vertex of degree 2 in Sk(G c ), then v must be a triple-type vertex in G.
NOTE: We only use the terms leaf-type, twig-type, and triple-type to classify vertices of degree 2 in Sk(G). Vertices of higher degree in Sk(G) will be discussed later. We consider twig-type and triple-type vertices to be of opposite type to one another.
Definition 3.2.9. Let G be a graph whose skeleton contains at least one vertex that is not leaf-type. A limb of G is a subgraph H of Sk(G) such that the edges of H form a trail whose only non-leaf-type vertices are its (not necessarily distinct) endpoints.
We observe that every edge of Sk(G) belongs to exactly one limb, and that the skeleton of a graph is the edgedisjoint union of its limbs. Proof. Let v 1 and v k be vertices of the same or opposite type to one another. This means that each is a twig-type or triple-type vertex. As v 1 is either a twig-type or triple-type vertex, both edges incident with v 1 are the same colour.
The same is true for v k . As v 2 , . . . , v k−1 are all leaf-type vertices, they are each incident with an edge of each colour, which means that edge colours alternate along P. Therefore, if k − 1 is odd, the colours of the edges incident with v 1 are the same as those incident with v k , meaning that v 1 and v k are of the same vertex type. If k − 1 is even, then the colours of the edges incident with v 1 are different to those incident with v k , meaning that v 1 and v k are of opposite vertex type.
Proposition 3.2.11. Let G be a bipartite unicyclic graph. Then G is ASBG-colourable if and only if G satisfies the following: • Each vertex in Sk(G) is either a leaf-type, twig-type, or triple-type vertex; • Each limb has odd (even) length if its endpoints are the same (opposite) type.
Proof. Suppose G satisfies the above conditions. We now give G a colouring c, as follows. At any twig-type vertex v of Sk(G), we colour the edges of Sk(G) incident with v blue, we colour the edge between v and the base of the twig red, and the other two edges of the twig blue. So v is incident with one more blue edge than red. At any triple-type vertex v of Sk(G), we colour the edges of Sk(G) incident with v red, and we colour the edges between v and the three leaves blue. So v is incident with one more blue edge than red. As all vertices of Sk(G) that are of the opposite type are an even distance apart, vertices of the opposite type cannot be neighbours, and so it is possible to colour G in this way. Along each limb of Sk(G), the first edge is now coloured red or blue according to the type of vertex it is incident with. If the other vertex incident with this edge is of leaf-type, we colour the next edge along the limb the opposite colour to the previous edge. We continue to do this until we reach the other end of the limb.
As the limb has odd (even) length if the vertices are of the same (opposite) type, the colour of the last two edges of the limb are the opposite to one another, and the vertex incident with these two edges are of leaf-type. Finally, we colour all edges between all leaf-type vertices and leaves blue. Now all leaf-type vertices are inciden with one more blue edge than red, and c is a difference-1 colouring of G. As G is unicyclic, we know that G c is configurable (Theorem 2.3.3). So G is ASBG-colourable.
On the other hand, suppose G has an ASBG-colouring c. From Corollary 3.2.8 and Lemma 3.2.10, we have that each vertex in Sk(G) is of leaf, twig, or triple-type, and that each limb has odd (even) length if its endpoints are the same (opposite) type.

Graphs With Junctions
We now turn our attention to bipartite graphs possessing junctions, where the problems of determining the existence of a difference-1 colouring and configurability are both considerably more complicated.
We have identified necessary and sufficient conditions for trees and unicyclic graphs to admit difference-1 colourings. In this section, we extend our analysis to the situation of graphs whose skeletons include junctions. We note that Lemma 3.2.6, Corollary 3.2.8, and Lemma 3.2.10 provide a partial test for difference-1 colourability, in the sense that a bipartite graph whose reduced form fails to satisfy the conditions of these results does not have a difference-1 colouring. The main content of this section is an algorithm whose purpose is to detect obstacles to a graph that passes these conditions having a difference-1 colouring, or to confirm the existence of a difference-1 colouring. We may restrict our attention to reduced graphs satisfying these conditions.
We now describe the operation of the algorithm on a reduced graph G satisfying the conditions of Lemma 3.2.6, Corollary 3.2.8, and Lemma 3.2.10. The algorithm initializes J to be the empty set and then iterates the following step. Each iteration involves at least one addition of a new element to J. A junction j with j ∈ J is chosen, and added to the set J. Integer weights are assigned in turn to each edge e incident with j as follows.
• If e is not in Sk(G), either e is incident with a leaf and is assigned the weight 1 (indicating that e must be blue in any difference-1 colouring of G), or e is incident with the base of a twig and is assigned the weight −1 (indicating red).
• If e is in Sk(G), and the limb to which e belongs ends in a vertex of twig/triple-type, then the colour of e in any difference-1 colouring is determined by this limb, and e is assigned the weight 1 or −1 accordingly.
• The remaining possibility is that the non-leaf type vertex on the other end of the limb starting at j along e is a junction j 1 . In this case, the algorithm proceeds as follows: -If j 1 ∈ J, then the weight 0 is assigned to e.
-If j 1 ∈ J (which means, in particular, that j 1 = j), then j 1 is adjoined to the set J, and the assignment procedure is applied recursively to all edges of G incident with j 1 , with the exception of the edge e 1 that belongs to the same limb as e. An integer weight is then assigned to e 1 by the requirement that the sum of weights on all edges incident with j 1 must be 1. Then x e , the weight assigned to e is assigned by x e = ±x e 1 , according to whether the limb containing e and e 1 requires that these two edges have the same or opposite colours.
This iteration of the algorithm concludes when weights have been assigned to all edges incident with junctions that can be reached from j via limbs of Sk(G) that do not include twig or triple-type vertices. No more iterations of the algorithm are run when all junctions of G are included in J.
If the algorithm identifies a junction for which the sum of the incident weights is not 1, then the algorithm returns False to indicate that G does not admit a difference-1 colouring. Otherwise, it returns True, and the algorithm proceeds to assign weigths to all edges of the graph that are not incident with junctions, so that all edges of G have now been assigned a weight. If all assigned weights are 1, −1, or 0, then G admits a difference-1 colouring, which we can easily determine from the output of the algorithm. Otherwise, the algorithm has assigned some surplus weights; weights which have magnitude greater than 1. In this case, the existence or not of a difference-1 colouring depends on properties of the graph consisting of those limbs of Sk(G) that include edges that have been assigned surplus or zero weights. This theme is developed in Section 3.4. We now present the details of the algorithm in a pseudocode format. if e.next = "leaf" then if e ∈ Sk(G), e.next is the type of the other vertex incident with e 5: e.weight ← 1 6: else if e.next = "base of twig" then 7: e.weight ← −1 8: else if e.next = "twig-type" then e.next is type of last vertex of limb L from j along e 9: e.weight ← (−1) e.distance+1 e.distance returns the length of L 10: else if e.next = "triple-type" then 11: e.weight ← (−1) e.distance 12: else if e.next = "junction" then  Proof. G has a difference-1 colouring, which means that there is some function c 1 (e) that assigns weights of ±1 to all edges e of G such that for each vertex v of G, the sum of weights w (v) incident with v is 1. Algorithm 1 implies a function c 2 : E(G) → Z of integer weight assignments to each edge e in G. If c 2 (e) = ±1 to some edge e, this means that e must be blue/red in any difference-1 colouring of G. If we remove these edges and any vertices which are now isolated, the resulting graph H consists of connected components which are all subgraphs of Sk(G) and are composed of limbs whose ends are both junctions. On each iteration of the algorithm, a junction j is chosen, and any other junction j encountered while trying to assign weights to j is assigned weights first such that w(j ) = 1. This process partitions the junctions in the same way as the connected components of H. For a component K of H, because w (v) = w(v) = 1 in G for any vertex v = j, the fact that H results from removing only the edges e with c 2 (e) = ±1 from G means that w (v) = w(v) in H for any vertex v = j. We also know that w (j) = 1 in G. If (P 1 , P 2 ) is the bipartition of K such that j ∈ P 1 , because each edge is incident with a vertex in both parts of the bipartition, we have And because w (v) = w(v) for all vertices in Q, we have Which therefore gives us And because w (v) = w(v) for all v = j, this implies that w (j) = w(j). Therefore the algorithm has assigned w(j) = 1 for all junctions j in G.
Note that the weights assigned to each edge incident with a junction can vary depending on the order in which the algorithm deals with the junctions and edges, but the result (whether or not the algorithm concludes that G has a difference-1 colouring) is independent of such choices.
It is possible that a graph will have only junctions whose incident weights sum to 1 but have no difference-1 colouring. This is because Algorithm 1 can assign weights to edges x(e) that have magnitude greater than 1. We call these weights surplus weights, and they (as well as zero weights) arise in the case of edges whose colour may differ in distinct difference-1 colourings of a graph, if any such colourings exist. In order to assign a particular colouring to a graph, these surplus weights must be redistributed so that every edge has weight 1 or −1, while maintaining w(j) = 1 for each junction j. If this is possible, we say that the surplus weights are redistributable, and we have a criterion for exactly when the surplus weights of any graph are redistributable, which will be outlined in Section 3.4.

Example 3.3.2.
Here, some edges of G have been assigned surplus weights. These surplus weights are redistributable, as the sum of the weights at each junction in Sk(G) before and after redistribution remain constant.

Redistributability
We now consider the situation where Algorithm 1 cannot decide on the existence of a difference-1 colouring for a graph G. This means that the algorithm assigns weights to the edges of G such that w(j) = 1 for each junction j in G, but some of the weights assigned to the edges are surplus weights.

Definition 3.4.1.
Let G be a graph for which Algorithm 1 could not determine the existance of a difference-1 colouring, and let e be an edge of G that has been assigned a surplus weight. A redistribution of the weight of e is a redefining of the weight of e and of some set S of the other edges of G such that every weight that has been redefined now has a value of 1 or −1, the sum of the weights of all edges incident with each vertex remains 1, and there is no proper subset of S for which this is possible. We say the surplus weights of a graph are redistributable if it is possible to redistribute all surplus weights in G successively.
In order to determine whether or not the surplus weights of a graph are redistributable, we can partition the edge set of the graph into equivalence classes and consider each equivalence class separately, as follows.

Lemma 3.4.3. ∼ is an equivalence relation on E (G).
Proof. It is immediate that ∼ is reflexive and symmetric. For transitivity, let e 1 = u 1 v 1 , e 2 = u 2 v 2 , and e 3 = u 3 v 3 be edges of G with e 1 ∼ e 2 and e 2 ∼ e 3 . Let C 1 be a cycle containing both e 1 and e 2 , and C 2 be a cycle containing both e 2 and e 3 . If C 1 = C 2 , then e 1 ∼ e 3 . Assume C 1 = C 2 . Let P u 1 be the path in C 1 starting at u 1 and ending at a vertex u in C 2 , that does not include e 1 and contains no other vertex in C 2 . Let P v 1 be the path in C 1 starting at u 1 and ending at a vertex v in C 2 that does include e 1 and contains no other vertex in C 2 . We know that u and v are distinct, because e 2 is common to both C 1 and C 2 . Let P u 3 be the path in C 2 starting at u and ending at u 3 which does not include e 2 , and let P v 3 be the path in C 2 starting at v and ending at u 3 which does not include e 2 . P u 1 , P v 1 , P u 3 , and P v 3 form a cycle which contains e 1 and e 3 . Therefore e 1 ∼ e 2 , e 2 ∼ e 3 =⇒ e 1 ∼ e 3 ; the relation is transitive.
NOTE: We refer to the equivalence classes of ∼ as the common cycle classes of E (G).

Lemma 3.4.4.
Let G be a graph with a difference-1 colouring whose edges have been assigned weights by Algorithm 1. Then all distinct difference-1 colourings of G can be obtained by redistributing any surplus and zero weights of G within common cycle classes.
Proof. Define x : E(G) → Z to be a function that sends edges of G to the weights that they were assigned by Algorithm 1, and x : E(G) → {1, −1} to be a redistribution of the surplus weights of G. We know that at any junction j, the sums of the values assigned by each of these functions to the edges incident with j are 1, and we also have that Note that for all edges in D, the δ-weight is a non-zero integer, and the sum of the δ-weights of edges incident with a vertex in D is 0. Thus each vertex of D is incident with at least one edge of positive δ-weight and one of negative δ-weight.
Choose any neighbouring vertices u 0 and u 1 in D and then repeat the following step; on step i, choose a vertex u i+1 such that δ(u i u i+1 ) is of the opposite sign to δ(u i−1 u i ). This process terminates at some step j when we choose a vertex u j+1 = u k , where 0 k j. Because G is bipartite, the cycle u k u k+1 . . . u j u k that results from this process is of at least length 4 and each vertex of the cycle has incident edges with δ-weight of opposite sign. We now define the graph D to be the graph D with the δ-weight of each edge in this cycle reduced in magnitude by 1 while retaining its sign, and any edge that now has weight 0 is deleted. Note that all δ-weights in D are non-zero integers and the sum of all δ-weights incident with a vertex of D is 0, and thus we can repeat this process until we are left with an empty graph. Therefore D can be decomposed into cycles, which implies that surplus weights can be redistributed to other edges in the same common cycle class.
We now consider when it is possible to redistribute surplus weights in a cactus graph.

Lemma 3.4.5.
Let G be a cactus graph that passes Algorithm 1 and whose edges have been assigned weights. For a cycle C in G, let w C (v) denote the sum of the weights assigned to the edges of C incident with a vertex v in C. Then the surplus weights of G are redistributable if and only if w C (v) ∈ {−2, 0, 2} for all cycles C in G and vertices v in C, and for every path Proof. First, assume that the surplus weights of G are redistributable. From Lemma 3.4.4, the surplus weights of G can be redistributed within the common cycle classes of G. G is a cactus graph, which means that the common cycle classes of G are the cycles of G. Let C be a cycle of G. As any redistribution of the surplus weights involves all edges being assigned weights of ±1, this means that w C (v) ∈ {−2, 0, 2} for any vertex v in C. If there is a path and w C (v i ) = 0 for all 1 < i < k − 1, this means that v i is incident with one edge of each colour in any difference-1 colouring, while v 1 and v k are incident with two edges of the same colour. If v 1 v 2 is the same colour as v k−1 v k , then k must be even and w C (v 1 ) = w C (v k ). If v 1 v 2 is the opposite colour to v k−1 v k , then k must be odd and w C (v 1 ) = −w C (v k ).
Now assume w C (v) ∈ {−2, 0, 2} for all cycles C in G and vertices v in C, and for every path We can redistribute the weights incident with v 1 and v k by assigning a weight of Therefore the surplus weights of G are redistributable.
To determine in general when surplus weights can be redistributed in a graph G that passes Algorithm 1 and whose edges have been assigned weights, let G be a subgraph of G consisting of all edges from one common cycle class of G and their incident vertices. For each vertex v of G , let r(v) denote the number of edges of G incident with v which are required to be red in any difference-1 colouring of G (as determined by Algorithm 1). Therefore r(v) is 0, 1, or 2, if v is a twig-type, leaf-type, or triple-type vertex, respectively, and r if v is a junction. If we can find a subgraph H of G for which deg H (v) = r(v) for each vertex v in G , then an edge colouring of G where all edges of H are coloured red and the remaining edges are coloured blue is consistent with a difference-1 colouring of G. Therefore, in order to determine if all surplus weights of a graph are redistributable, we need to find a subgraph H of G , for each common cycle class G , such that deg H (v) = r(v) for all vertices of H. The following theorem tells us when this is possible. Note that the problem of redistributability is precisely the case where v∈P 1 r(v) = v∈P 2 r(v), as we require all vertices of v in P 2 to satisfy deg H (v) = r(v) as well as for all v in P 1 . Therefore the surplus weights in a common cycle class G with bipartition (P 1 , P 2 ) are redistributable if and only if every subset S of P 1 in G satisfies v∈S r(v) if v is a junction.
Before we prove this result, we recall some concepts relating to flow networks. For our purposes, a flow network is a directed graph G in which every arc is assigned a positive integer weight, called its capacity. The network has exactly one vertex s of indegree zero and positive outdegree, called the source, and exactly one vertex t of outdegree zero and positive indegree, called the sink. A flow is an assignment to every arc of a non-negative integer at most equal to its capacity, with the property that for every vertex v ∈ {s, t}, the total of the flows on arcs directed into v is equal to the total of the flows on arcs directed out of v. The total flow is the sum of the flows on all arcs directed out of s. The maximum flow of G is the maximum possible total flow over all flows that can be assigned to G (for a fixed assignment of capacity).
A cut of a flow network G is a partition (X, Y) of the vertex set of G, such that s ∈ X and t ∈ Y. The cut capacity of a cut (X, Y) is the sum of the capacities of all arcs (u, v) from vertex u to vertex v such that u ∈ X, v ∈ Y. We now prove Theorem 3.4.6 by interpreting G as a flow network, and applying the Max-Flow Min-Cut Theorem [10], which states that the maximum flow in a flow network is bounded above by all cut capacities and is equal to the minimum cut capacity.
We define a flow network structure on G * by assigning the capacity r(u) to each arc of the form (s, u), 1 to each arc from P 1 to P 2 , and r(v) to each arc of the form (v, t). The assignment of a flow to G * determines a subgraph H of G whose edges are the pairs u, v for which the arc (u, v) of G * has flow 1.
For a vertex u ∈ P 1 , the degree of u in H is equal to the flow assigned to su in G * . Therefore we can find a subgraph H of G where every vertex v of H has degree equal to r(v) if and only if we can assign a flow to G * such that the total flow is equal to v∈P 1 r(v). As this desired total flow is equal to the sum of the capacities of all the arcs out of s, this is the maximum flow that we could possibly achieve. Therefore G has a subgraph H with the required properties if and only if, for G * , From the Max-Flow Min-Cut Theorem, this is equivalent to the condition that, for every cut, cut capacity To complete the proof of Theorem 3.4.6, we need to show that (2) is equivalent to for every subset S of P 1 .
Let S be a subset of P 1 , and choose a cut (X, Y) such that S = P 1 ∩ X. We now consider the arcs that contribute to the cut capacity: • If a vertex v in P 1 is in Y, then the arc (s, v) is from X to Y and has capacity r(v).
• If a vertex v in P 2 is in Y, then any arc (u, v) where u ∈ S is from X to Y. Each such arc has capacity 1, and therefore the sum of these capacities for a given v is equal to the number of neighbours of v in S.
• If a vertex v in P 2 is in X, then the arc (v, t) is from X to Y and has capacity r(v).
We therefore have the following: Using this and (2), our condition for the existence of the required subgraph H becomes for every proper subset S of P 1 , and every choice of cut (X, Y) with S = P 1 ∩ X.
The function f depends on the choice of cut, and v∈P 2 f(v) is minimized by the cut (X , Y ) where Therefore the condition for the existence of H becomes the following. For all S ⊂ P 1 , v∈S r(v) n∈Γ (S) min{r(n), |Γ (n) ∩ S|}.
As previously shown, Theorem 3.4.6 is a special case of the Max-Flow Min-Cut Theorem. It is also true that Hall's Matching Theorem [11] is a special case of Theorem 3.4.6. A matching in a bipartite graph is a subgraph where every vertex (in the smaller part of the bipartition) has degree 1, and no vertex has degree exceeding 1. We note that this is equivalent to Theorem 3.4.6, where r(v) = 1 for all vertices v in the graph. In this case, v∈S r(v) = |S|, and n∈Γ (S) min{r(n), |Γ (n) ∩ S|} = |Γ (S)|.
We now have the following full set of necessary and sufficient conditions for when a graph has a difference-1 colouring, which follows from Lemma 3.  • Each vertex in Sk(G) is either a leaf-type, twig-type, triple-type vertex, or a junction j for which the local tree at j in the reduced form of G consists of only leaves or twigs attached to j and which is assigned w(j) = 1 by Algorithm 1; • For each path P = v 1 v 2 . . . v k in Sk(G) where v 1 and v k are both non-leaf type vertices, and v 2 , . . . , v k−1 are all leaf-type vertices, P has odd (even) length if v 1 and v k are the same (opposite) type; • Surplus weights in each common cycle class of G are redistributable.
Recall from Theorem 2.3.3 that if a cactus graph G has a difference-1 colouring c, then G c is configurable. Therefore the Theorem 3.4.8 determines when a cactus graph is ASBG-colourable. The problem of determining necessary and sufficient conditions for configurability of difference-1 colourings for wider classes of graphs is an ongoing topic of investigation.

Uniqueness and Difference-k Colourings
In this last section, we examine what it means for one graph to have more than one distinct difference-1 colouring, and how these difference-1 colourings can differ from one another. We also explore generalising the concept of a difference-1 colouring to a difference-k colouring.

Uniqueness of Difference-1 Colourings
Definition 4.1.1. We say that a graph G has a unique colouring if there is only one difference-1 colouring of G.
It is possible that a graph can have multiple difference-1 colourings, some of which are configurable and some of which are not.

Example 4.1.2.
The following graph has two distinct difference-1 colourings, only one of which is configurable: 3. An alternating cycle is a cycle in a graph which has been coloured such that each vertex of the cycle is incident with two edges in the cycle of opposite colour. Proof. Let G be a graph with two distinct colourings c and d, and let H be the subgraph of G c containing only the edges which differ in colour from those in G d and only vertices which are incident with these edges. Since both c and d are difference-1 colourings, every vertex of H is incident with the same number of red and blue edges, and so every vertex of H has even degree. We may start at any edge of H, and construct a trail consisting of edges of alternating colours until a repeated vertex v is encountered for the first time. This completes an alternating cycle from v to itself, since every cycle in G has even length. Removal of this cycle from H results in another graph in which every vertex is incident with an equal number of blue and red edges. So we can remove alternating cycles until no edges remain, and therefore two distinct colourings of a graph G differ only by alternating cycle rotations.
Corollary 4.1.6. A difference-1 colouring of a tree T is the unique ASBG-colouring of T .

Difference-k Colourings
The definition and exploration of difference-1 colourings leads very naturally to the more general definition of a difference-k colouring. We propose the problem of determining when a graph admits a difference-k colouring, and note some preliminary observations in the bipartite case. The following is a characterisation of bipartite graphs with a difference-0 colouring.

Theorem 4.2.2.
A bipartite graph G has a difference-0 colouring if and only if every vertex of G has even degree.
Proof. First, assume that G has a difference-0 colouring. Then . So every vertex of G has even degree. Now assume that every vertex of G has even degree. As G is Eulerian, the edges of G can be decomposed into edge-disjoint cycles. We now colour the edges of G so that each cycle is an alternating cycle. Therefore deg B (v) = deg R (v) at each vertex v. So G has a difference-0 colouring.
We can use Theorem 3.4.6 to give a general characterisation for all bipartite graphs with difference-k colourings, for a given k as follows. . This is because if we find such a subgraph H, the colouring c of the edges of G such that all edges of H c are red and all edges of (G \ H) c are blue is a difference-k colouring of G. From Theorem 3.4.6, we know that this is equivalent to every strict subset S of one bipartition of G satisying While Theorem 4.2.3 arises directly from Theorem 3.4.6, and can be applied to the case of difference-1 colourings, its practical utility is limited. Algorithm 1 and partitioning the edge set into common cycle classes simplifies the analysis considerably in the case k = 1. At present, we have no version of these approaches for difference-k colourings in general. The problem of determining when a non-bipartite graph admits a difference-k colouring remains largely unexplored, even in the case k = 1.