 # Coloring near-quadrangulations of the cylinder and the torus

Let G be a simple connected plane graph and let C_1 and C_2 be cycles in G bounding distinct faces f_1 and f_2. For a positive integer l, let r(l) denote the number of integers n such that -l<=n<=l, n is divisible by 3, and n has the same parity as l; in particular, r(4)=1. Let r_f_1,f_2(G) be the product of r(|f|) over all faces f of G distinct from f_1 and f_2, and let q(G)=1+sum_f:|f|≠ 4 |f|, where the sum is over all faces f of G. We give an algorithm with time complexity O(r_f_1,f_2(G)q(G)|G|) which, given a 3-coloring psi of C_1 and C_2, either finds an extension of psi to a 3-coloring of G, or correctly decides no such extension exists. The algorithm is based on a min-max theorem for a variant of integer 2- commodity flows, and consequently in the negative case produces an obstruction to the existence of the extension. As a corollary, we show that every triangle-free graph drawn in the torus with edge-width at least 21 is 3-colorable.

## Authors

##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Flows and disjoint non-contractible cycles

For a plane graph , let , , and denote the sets of its vertices, edges, and faces, respectively. For a function , let . Let be a connected plane graph and let be a function such that . Throughout the paper, we view paths in graphs as directed, i.e., having distinguished starting and ending vertices. A -linkage in is a system of pairwise edge-disjoint paths in such that

• if a path starts in a vertex and ends in a vertex , then and , and

• every vertex is the starting or ending vertex of exactly paths from .

Let and be distinct faces of . A cycle in is -non-contractible if the open disk in the plane bounded by contains exactly one of the faces and , and -contractible otherwise. An -circulation is a set of pairwise edge-disjoint -non-contractible cycles. The support of a -linkage or an -circulation is the set of edges of . The goal of this section is to answer the following question: Given the graph , its faces and , and the function as described, what is the maximum size of an -circulation whose support is disjoint from the support of some -linkage in ? We will not be able to give a full answer, however we will solve the special case arising in the context of Theorem 3, where the function satisfies the condition that and have the same parity for all .

It is more convenient to work in the setting of integral flows. Let us start by giving the necessary notation and describing their relationship to linkages and circulations. Consider an arbitrary orientation of . For a vertex , let and denote the sets of edges entering and leaving , respectively. We drop the subscripts when the directed graph is clear from the context. An (integral) -flow in is a function such that for all ; i.e., gives the amount of the flow originating in . The support of the flow is the set of edges of such that is non-zero on the corresponding directed edge of .

Let denote the plane dual of . For a vertex , a face , or an edge , let , , or denote the corresponding face, vertex, or edge of , respectively. For an orientation of and an edge , the edge of is directed so that, looking along the edge in its direction, the edge crosses from left to right. For a function or , let or be the corresponding function such that for every and for every .

Let be a connected plane graph and let be its orientation. For a (possibly closed) walk in and an edge , let denote the number of times traverses in the direction of minus the number of times traverses in the direction opposite to . In particular, if , , and is a path or a cycle, then for every , we have if crosses from right to left (as seen along the direction of ), if crosses from left to right, and if does not cross . For a function , we define . Let denote the function whose value is everywhere.

It is well-known that a flow can be expressed as a disjoint union of cycles and source-sink paths. Conversely, we can send a unit of flow along each of the paths and in any direction along each of the cycles to obtain a flow. Hence, the following claim holds.

###### Observation 8.

Let be a connected plane graph and let be a function such that . Let be a path in from a vertex to a vertex .

• If contains a -flow , then contains a -linkage with . If contains a -linkage , then contains a -flow with .

• For a non-negative integer , if contains a -flow with , then contains an -circulation of size with . If contains an -circulation of size , then for every integer , contains a -flow with and .

Let us now relate the values and for a -flow in and distinct paths and in its dual with the same starting and ending vertices. For a closed walk in a plane graph and a face of , let denote the winding number of around . Recall the winding number is defined as follows: Let be any half-line with the starting point inside which intersects only in edges. Then is equal to the number of times intersects from left to right, minus the number of times intersects from right to left. Let us remark that the value of is independent of the exact choice of the half-line . Indeed, the winding number (for ) can also be defined by the following properties.

###### Observation 9.

Let be an orientation of a connected plane graph and let be a closed walk in .

• The outer face of satisfies .

• For any edge , .

For a closed walk in a plane graph and a function , let us define

 ∇(R,b)=∑f∈F(G)ωR(f)b(f).
###### Lemma 10.

Let be a connected plane graph, let be a function such that , and let be a -flow in . For any closed walk in , we have , and in particular is the same for all -flows. Furthermore, if and are vertices of , and are paths from to in , and is the closed walk obtained as the concatenation of with the reversal of , then .

###### Proof.

Let be the orientation of with respect to which the -flow is defined. Using Observation 9(b), we have

 ∫Rh⋆ =∑e∈E(→H)σ(R,e⋆)h(e)=∑e=(v1,v2)∈E(→H)(ωR(v⋆1)−ωR(v⋆2))h(e) =∑v∈V(H)ωR(v⋆)[∑e∈N+→H(v)h(e)−∑e∈N−→H(v)h(e)]=∑v∈V(H)ωR(v⋆)d(v) =∑f∈F(H⋆)ωR(f)d⋆(f)=∇(R,d⋆),

as required. Furthermore, if is the concatenation of and the reversal of , then . ∎

Let be a connected plane graph and let be a function such that . Let and be faces of , and let be a path in from the vertex to the vertex . A -flow in is -circulation-maximum or -circulation-minimum if has the maximum or the minimum possible value, respectively, among all -flows. In view of Lemma 10, these notions are independent of the choice of the path . We now give a min-max condition for circulation-maximum and minimum flows. A function is even if has the same parity as the degree of for every vertex of .

###### Lemma 11.

Let be a connected plane graph, let be a function such that , and let and be faces of . Let and be -circulation-maximum and minimum -flows in , respectively, with maximal supports. Then there exist paths and in from to such that and . Furthermore and are formed by edge-sets of forests in , and in particular if is even, then .

###### Proof.

We prove the claims for ; the claims for follow by the same argument applied to the -circulation-maximum -flow . Let be any path from to in .

If there existed a cycle with , then note that there exists a -flow with support such that , obtained by sending one unit of flow along in an appropriate direction. Then is a -flow which contradicts either the assumption that is -circulation-maximum (when ) or that is maximal among -circulation-maximum flows. Hence, is an edge-set of a forest in . If is even, then each vertex is incident with even number of edges of , and thus the forest cannot have any leaf; this is only possible if .

Hence, we only need to find a path from to such that . Let be the orientation of with respect to which the -flow is defined. Let us form an auxiliary directed graph with the vertex set and edge set defined as follows. For each edge ,

• if , then we include in the reversal of ,

• if , then we include in the edge , and

• if , then we include both and its reversal in .

The graph is drawn in the plane in the same way as , with the two opposite edges in the last case drawn close next to each other. Let us remark that is defined so that sending a unit of flow along any directed cycle in and adding the flow to results in a valid -flow in .

Let be the set of faces for which there exists a path in from to such that all edges of intersect from left to right. If , then by the definition of we conclude that , and thus we can set .

Hence, suppose that . Let be the graph obtained from by deleting all vertices and edges that are only incident with faces in , and let be the face of containing . Since , the boundary of the face contains an -non-contractible cycle . All edges of separate a face in from a face not in , and thus all of them are in directed from right to left (looking from ). Let be defined as follows: For each edge corresponding to an edge , we let if and are directed in the same way and otherwise. On all other edges , we set . Then is a -flow with , and for every by the definition of the graph . Hence, is a -flow with , contradicting the assumption that is -circulation-maximum. ∎

The proof of Lemma 11 can be easily turned into an efficient algorithm to find the flows. For a function , let denote .

###### Lemma 12.

Let be a connected plane graph, let be an even function such that , and let and be distinct faces of . There exists an algorithm with time complexity which finds -circulation-maximum and minimum -flows in with support , or decides that contains no -flow.

###### Proof.

It suffices to find an -circulation-maximum -flow, an -circulation-minimum -flow is obtained using the same algorithm to find a -circulation-maximum -flow. We can assume that is the outer face of . It is possible to find a -flow in (or to decide that no -flow exists) in time using Ford-Fulkerson algorithm. Since is even, the complement of is Eulerian; we can partition it into cycles in linear time and add an arbitrary -flow on each of the cycles to . Hence, from now on is a -flow with support .

In time we construct the auxiliary graph as described in the proof of Lemma 11 (note that is an orientation of , since ). We initialize and as the subgraph of drawn in the boundary of the face . Then, we repeat the following steps:

• While there exists an edge of directed from left to right as seen from ,

• if is a bridge in (i.e., it is incident with from both sides), then delete from , otherwise

• let be the facial walk of the face of not contained in , delete from , and add to .

• If became the outer face of , then stop; otherwise, remove from all the edges not incident with its outer face, and all isolated vertices.

• Note that became a cycle in the previous step (since all its edges are incident with both and the outer face). Add two units of flow on the edges of the cycle to , and reverse the edges in and .

Note that the part (i) can be implemented efficiently by maintaining a queue of edges directed from left to right, updated whenever is added to in step (i) or when the direction of edges are altered in step (iii). Since each edge is added to at most twice (for each face of it is incident with) and deleted at most once, the total time complexity of (i) over the whole run of the algorithm is . As for the step (iii), note that the direction of each edge is changed at most once, and thus the total time complexity of (iii) over the whole run of the algorithm is also . ∎

Let be a connected plane graph and let be a function such that . For a cycle in , we define to be the set of faces of contained in the open disk in the plane bounded by , we let be the set of the corresponding vertices of , and we let . Note that if is even, then for every cycle in . Let and . For an edge of , we define , , and (i.e., is viewed as a cycle of length two). For a cycle or edge , we let . The max-flow min-cut theorem implies the following.

###### Observation 13.

Let be a connected plane graph and let be a function such that . Then contains a -flow (or equivalently, a -linkage) if and only if for every cycle in .

If for every cycle in , then we say that the function is feasible. For a set of cycles and edges of , we let . For an edge contained in cycles and edges from , we define . If and are faces of , we say that is -connecting if contains a path from to . We say that is laminar if for any cycles , the open disks in the plane bounded by and are either disjoint or one is a subset of the other.

If is feasible, then let denote the maximum integer such that there exists a -linkage and an -circulation of size in with disjoint supports. We are now ready to prove the main result of this section, the min-max theorem for . The argument used to prove the part (a) is based on the idea of Seymour  for -commodity flows.

###### Theorem 14.

Let be a connected plane graph, let and be faces of , and let be a feasible even function such that . Let and be -circulation-maximum and minimum -flows in , respectively. Then the following claims hold.

• For every path from to in , .

• for every -connecting set of cycles and edges of .

• There exists a laminar -connecting set of cycles and edges of such that .

Furthermore, there exists an algorithm with time complexity which given , , , and returns

• a -linkage and an -circulation of size in with disjoint supports, and

• a laminar -connecting set of cycles and edges of such that .

###### Proof.

Suppose that is a -linkage and is an -circulation in such that and is maximum, i.e., equal to . For any cycle in , the set forms an edge-cut in separating from . Clearly, contains at least paths with one end in and the other hand in , and thus all but at most edges of are intersected by paths in .

Consider now an -connecting set of cycles and edges of . Let be the multigraph obtained from by giving each edge the multiplicity (i.e., when constructing , the cycles of are made edge-disjoint and edges of are turned into -cycles by increasing the multiplicity of edges). According to the previous paragraph, all but at most edges of are intersected by paths in . All vertices of have even degree, and thus each component of is -edge-connected. Since is -connecting, it follows that contains two edge-disjoint paths from to , and thus every -non-contractible cycle in intersects at least two edges of . Since the supports of and are edge-disjoint, we conclude that . Therefore, (b) holds.

Let be any path from to in . By Observation 8, there exists a -flow and a -flow in with , , and . In particular, the supports of and are disjoint, and thus and are -flows in . Since and are -circulation-maximum and minimum, respectively, we have and . Consequently,

 circ(H,s,t,d) =|C|=∫Qh⋆c=∫Q12(h⋆a−h⋆b) =12(∫Qh⋆a−∫Qh⋆b)≤12(∫Qh⋆1−∫Qh⋆2).

On the other hand, by Lemma 11, since is even we can assume that . Let and . Since , all values of and

are odd, and thus all values of

and are integers. Consequently, is a -flow and is a -flow in . Furthermore, observe that . By Observation 8, we conclude that contains a -linkage and an -circulation with disjoint supports such that . Therefore, . Combining the inequalities, we conclude that (a) holds. Note that -circulation-maximum and minimum -flows with maximal supports can be found in time using the algorithm of Lemma 12, and they can be converted into a -linkage and an -circulation of size in with disjoint supports in time as described in this paragraph.

Finally, let us prove the part (c). By Lemma 11, there exist paths and in from to such that and . Let be the closed walk obtained as the concatenation of with the reversal of . By Lemma 10, we have , and thus

 2⋅circ(H,s,t,d) =∫Q1h⋆1−∫Q1h⋆2 =∫Q1h⋆1−∫Q2h⋆2−∑f∈F(H⋆)ωR(f)d⋆(f) =|E(Q1)|+|E(Q2)|−∑f∈F(H⋆)ωR(f)d⋆(f). (1)

For an integer , let be the set consisting of edges of such that is incident with faces and satisfying and (one can view as assigning heights to faces of , and then corresponds to the contour lines at height very slightly less than ). Let be the set of edges of through that both and pass in the same direction. We claim that can be chosen to consist of the edges of and of the cycles into which the sets naturally decompose. Let us describe the construction precisely.

By Observation 9(b), for an edge of incident with faces and and letting ,

• if , then belongs to exactly one of the sets , namely to ,

• if , then belongs exactly to two of the sets, namely to and , and

• if or , then does not belong to any of the sets.

It follows that

 |E(Q1)|+|E(Q2)|=2|A|+∑i|Li|. (2)

Let denote the subgraph of with the edge set and the vertex set consisting of the vertices incident with the edges of . Observe that if is a face of and faces and of satisfy , then either both and , or both and . Let and denote the sets of faces of for that the former or the latter, respectively, holds. For , let denote the subgraph of drawn in the boundary of . Note that faces in only share edges with faces in and vice-versa. Consequently, , and the graphs for are pairwise edge-disjoint and -edge-connected. For , let denote the set of -connected blocks of ; since is -edge-connected and all its edges are incident with , is a set of cycles. For , let if is contained in the open disk of the plane bounded by , and let otherwise. Since , for each face we have

 ∑f′∈F(H⋆),f′⊆fd⋆(f′)=−∑f′∈F(H⋆),f′⊈fd⋆(f′)=−∑C∈Kf∑f′′∈outf(C)d⋆(f′′)≤∑C∈Kfd(C). (3)

Let and . Clearly, is -connecting, since . Observe that if and , then there exists a face such that , and thus the set is laminar. It remains to argue that .

Let be the minimum of . Note that for any ,

 ωR(f′)=m+|{i>m:f′⊆f for some f∈F+i}|. (4)

By (4) and (3), and using the fact that , we have

 ∑f′∈F(H⋆)ωR(f′)d⋆(f′)=m⋅d⋆(F(H⋆))+∑i>m∑f∈F+i∑f′∈F(H⋆),f′⊆fd(f′)≤∑i>m∑C∈Kid(C),

and thus by (1),

 2⋅circ(H,s,t,d)≥|E(Q1)|+|E(Q2)|−∑i>m∑C∈Kid(C). (5)

By (2), we have

 ∑x∈X|x|=2|A|+∑i|Li|=|E(Q1)|+|E(Q2)|,

and the definition of gives

 ∑x∈Xd(x)=∑i>m∑C∈Kid(C).

By (5), we conclude that

 2⋅circ(H,s,t,d)≥|E(Q1)|+|E(Q2)|−∑i>m∑C∈Kid(C)=∑x∈X|x|−∑x∈Xd(x)=slackd(X).

By (b), we conclude that , and thus (c) holds. Furthermore, observe that this construction of the set from the -flows and can be performed in time . ∎

For the -coloring applications, we need the following consequence.

###### Corollary 15.

There exists an algorithm with time complexity which given a connected plane graph , faces and of , a path from to in , an even function such that , and an integer returns one of the following:

• A -flow in such that and , or

• a cycle in such that , or

• a laminar -connecting set of cycles and edges of with , and -flows and in such that and .

###### Proof.

If is not feasible, then a straightforward modification of Ford-Fulkerson algorithm returns a cycle in such that . We can return such a cycle and stop.

Hence, suppose that is feasible. Let be a