On the discrepancies of graphs

In the literature, the notion of discrepancy is used in several contexts, even in the theory of graphs. Here, for a graph $G$, $\{-1, 1\}$ labels are assigned to the edges, and we consider a family $\mathcal{S}_G$ of (spanning) subgraphs of certain types, among others spanning trees, Hamiltonian cycles. As usual, we seek for bounds on the sum of the labels that hold for all elements of $\mathcal{S}_G$, for every labeling.


Introduction
The thorough study of discrepancy theory started with Weyl [14] and quickly gained several applications in number theory, combinatorics, ergodic theory, discrete geometry, statistics etc, see the monograph of Beck and Chen [3] or the book chapter by Alexander and Beck [1].
We touch upon only the combinatorial discrepancy of hypergraphs. Given a hypergraph (X, E), and a mapping f : X → {−1, 1}, for an edge A ∈ E let f (A) := x∈A f (x).
The discrepancy of f is D(X, E, f ) = max A∈E |f (A)|, while the discrepancy of the hypergraph (X, E) D(X, E) := min f D(X, E, f ).
In our case X = E(G) and E = S G ⊂ 2 E(G) , and with a slight abuse of notation we write D(G, S G ) for short.
Erdős, Füredi, Loebl, and Sós [11] studied the case G = K n , the complete graph on n vertices, and S G is the set of copies of a fixed spanning tree T n with maximum degree ∆. They showed the existence of a constant c > 0, such that D(G, S G ) > c(n − 1 − ∆).
Erdős and Goldberg [10] defined dis(A, B) := e(A, B) − e(G)|A||B|/ n 2 , where A, B ⊂ V (G) and A ∩ B = ∅. They showed that for every ε > 0 there exists an ε > 0 such that in every graph G with e = e(G) > v(G) = n, there are disjoint sets A, B ⊂ V (G), |A|, |B| εn, and dis(A, B) > ε √ en. Here we investigate the discrepancy of (spanning) trees, paths and Hamilton cycles. That is for a graph G let S G be the set of spanning trees (T n ), trees (T ), Hamiltonian paths (P n ), paths (P), or Hamilton cycles (H).
Usually, one expects big discrepancy if the hypergraph has many edges. Since for every graph G, either G or G is connected, we have D(K n , T n ) = n − 1. Beck [2] showed that there is a graph F on n vertices and 2n edges such that in every two-coloring of its edge set there exists a monochromatic path of length cn, that is D(F, P) = cn. Another example for this is the interpretation of the result of Burr, Erdős and Spencer [6], namely that R(mK 3 , mK 3 ) = 5m. That is if k · K 3 is the set of triangle factors in K n , n = 3k and n is divisible by 5, then D(K n , k · K 3 ) = n/5.
We first consider the discrepancy of Hamilton cycles, and show that, roughly speaking, if G has sufficiently large minimum degree then for every labeling of E(G) with +1, −1 there is a Hamilton cycle with linear discrepancy. Theorem 1. Let c > 0 be an arbitrarily small constant and n be sufficiently large. Let G be a graph of order n with δ(G) (3/4 + c)n. Then we have D(G, H) cn/32. Figure 1 below shows that the minimum degree condition in Theorem 1 is the best possible. In this example, let G = K n − K n/4 , i.e., |V (G)| = n is divisible by 4, |V 1 | = n/4, |V 2 | = 3n/4, δ(G) = 3n/4. Assign −1 to all edges incident to V 1 and +1 to the rest of the edges. As each Hamilton cycle in G touches V 1 exactly n/4 times, they all have zero discrepancy. For the existence of a Hamilton cycle, Dirac's Theorem requires only minimum degree n/2. We could also push down the minimum degree requirement for the existence of a linear discrepancy Hamilton cycle, if we have some local restriction on the coloring.
For ν > 0 real number, we say a vertex is ν-balanced if it has at least νn edges with label +1, and at least νn edges of label −1, otherwise it is ν-unbalanced.
Theorem 2. Let c, d, ν be positive numbers satisfying c 8ν and d 4ν. Let G be a graph of order n, where δ(G) (1/2 + c)n. Assume that the edges of G are labelled by either +1 or −1, such that the number of ν-balanced vertices is at least (3/4 + d)n. Then there exists a Hamilton cycle in G with discrepancy at least ν 2 n/2000.
The number of the balanced vertices in the graph in Figure 1 is 3n/4, hence the condition on the size of the balanced set in Theorem 2 is tight.
In both of the theorems above, G is dense. However, the sparsity of a graph does not imply small discrepancy, the expansion is a more important factor. Let G ∈ G n,d be a randomly, uniformly selected d-regular graph on n vertices. A property P holds with high probability, w.h.p., if for every ε > 0 there exist an n ε such that Pr(G ∈ G n,d , G ∈ P) 1 − ε. Similarly, property P holds asymptotically almost surely, a.a.s., if lim n→∞ Pr(G ∈ G n,d , G ∈ P) = 1.
Theorem 3. Let G ∈ G n,3 . Then there exists a constant c > 0 such that a.a.s. we have D(G, T n ) cn.
For planar graphs, one can expect sublinear discrepancy of spanning trees; we managed to give asymptotically sharp bounds.
Theorem 4. Let G be a planar graph on n vertices. Then there exists a real number The bounds, up to the constant factor are best possible. Let P 2 k := P k P k be the k × k grid.
If we drop the condition of spanning subgraph, then the discrepancies can be linear in the number of vertices. Proposition 6. Let k, be some positive integers. Then We have the following corollary since paths are also trees.
Let us make some easy observations which nevertheless give motivations for the above theorems and to those proofs. The graph P 2 P k has exponentially many spanning trees, but still D(P 2 P k , T 2k ) 3. To see this, we partition the graph into a 2 × k/2 grid and a 2 × k/2 grid, and label the edges of the first grid by −1, of the second grid by +1. We label the edge shared by two sub-grids arbitrarily. The situation for P k P k , the k × k grid, is similar: cut the grid into two halves and label +1 the upper, and −1 the lower region. Since any spanning tree is cut at most k times, D(P k P k , T n ) k − 1. For not necessarily spanning trees, obviously, D(G, T ) ∆(G)/2 .

Notation
We let N + (v) to denote the set of neighbors u of v such that uv is labelled by +1.

Structure of the paper
The paper is organized as follows. In Section 2, we discuss the discrepancy of Hamilton cycles. In Section 3, we prove Theorem 3 for random 3-regular graphs. Section 4 contains some results of discrepancies for grids and planar graphs.

Discrepancy of Hamilton cycles
In this section, we study the discrepancy of Hamilton cycles. The first tool we use is the following generalization of Dirac's Theorem [13].
Lemma 8. Let G = (V, E) be a graph and let c > 0 be a real number. Suppose E ⊆ E such that E induces a linear forest in G. If δ(G) ( 1 2 + c)n and |E | 2cn, then there exists a Hamilton cycle in G which contains all the edges in E .
We will use the following simple lemma at various points: the electronic journal of combinatorics 27(2) (2020), #P2.12 Lemma 9. Let ν, γ > 0. Suppose U ⊆ V (G) with |U | νn such that for every u ∈ U , we have |N (u)| γn. Then there exists a path P of length at least νγn/2, such that every edge in P contains at least one vertex in U . Moreover, if for every u ∈ U we have |N (u) \ U | γn, then there exists a path of length at least νγn whose vertices are alternating between U and N (U ) \ U .
Proof. Let H be the collection of edges incident to the vertices in U . We have e(H) νγn 2 /2. This implies H contains a path P of length at least νγn/2. It is clear that P satisfies all the requirements. The second part of the statement follows very similarly, considering edges only having exactly one endpoint in U .
Let G be an n-vertex simple graph with δ(G) (3/4 + c)n, where c > 0 is a (possibly small) constant and the edges of G are labelled by either +1 or −1.
Proof of Theorem 1. Let a = c/4. The proof is split into two cases.
Suppose there exists a vertex v such that less than cn/2 vertices in N (v) have more than cn negative neighbors in N (v). Let M ⊆ N (v) be the set of such vertices, hence, Now suppose that such vertex does not exist. Let S ⊆ V (G) be the set of balanced vertices which have more positive neighbors. We may assume |S| (3/4 + c)n/2. Then for every v ∈ S, each vertex in N + (v) has at least (1/8 + 3c/2)n neighbors in N + (v). Every vertex of S has at least a negative neighbors, hence, using Lemma 9 we get that there exists a negative path P , such that each edge of P contains at least one vertex in S, and both of the end vertices of P are in S. Moreover, the length of P is at least an 2 ( 3 4 + c). We denote the end vertices of P by x, y.
Next for each vertex v in V (P ) ∩ S, we pick an edge in N + (v). For each vertex in P but not in S, we pick a negative edge from its neighborhood. We also pick an edge ab such that a ∼ x and b ∼ y. We require that all the edges we picked are disjoint from P and they form a linear forest in G. This is doable, since in each step we forbid edges incident to the vertices in V ⊆ V (G) with |V | < cn/2.
Let G be the graph after we delete P from G. By Lemma 8, there is a Hamilton cycle H in G containing all the edges we picked. First, we insert the entire path P by removing the ab edge and adding edges ax and by. We obtain a Hamilton cycle H 1 , such that If f (H) 3cn/64, then the above implies that f (H 1 ) −3cn/64. If f (H) > 3cn/64, then we can insert the vertices in P one by one to obtain H 2 , such that we have Therefore, G contains a Hamilton cycle with discrepancy at least 3cn/64. Now we need some preparation to prove Theorem 2. Let T be the set of triangles in G. We define a function For T = uvw, we let g(v, T ) be the change in the discrepancy if the edge uw is changed to the path uvw. To be more precise, we let g(v, T ) be −1, 1, −3, 3 if the triangle T has type red, blue, dark red, dark blue, respectively, see Figure 2.
We color the vertex v red if there exist at least νn 2 triangles T in T such that g(v, T ) = −1, it is blue, dark red, dark blue if there exist at least νn 2 triangles T in T such that g(v, T ) = 1, −3, 3, respectively. Note that when c > 8ν, every vertex is colored, since the neighborhood of every vertex spans at least cn 2 /2 edges. Some vertices may have multiple colors under this definition, but we may assume most of them have only one color, using the following lemma.
Lemma 10. Suppose more than νn/3 vertices have more than one colors. Then there exists a Hamilton cycle of discrepancy at least νn/3.
Proof. Let M ⊆ V (G) be the set of vertices having more than one colors, and x 1 , x 2 , . . . , . We further require that, all the edges we picked do not contain x i , and they form a linear forest in G. We can do this, since in each step we forbid less than νn 2 edges, but we have at least νn 2 triangles by the definition. Now we remove x 1 , x 2 , . . . , x νn/3 from G, and call the resulted graph G . By Lemma 8, we can find a Hamilton cycle H in G containing all the edges we picked. In order to insert x i back to H, we can remove either a i b i or c i d i , and in each step, the discrepancies differ by at least 2, since |g( Type dark blue. The following Lemma is our main tool in the proof. Lemma 11. Let c, ν > 0 with c > 8ν. Let G be a graph with δ(G) (1/2 + c)n. Let R, Q ⊆ {red, blue, dark red, dark blue}. Suppose, there is a path P of length φ(ν)n for some function φ and all edges of it have labels in I ⊆ {+1, −1}, where 0 < φ(ν) < ν/2, and each edge of P contains at least one vertex with colors in R, and the other vertices on P have colors in Q. Assume that one of the following holds: Then G contains a Hamilton cycle with discrepancy at least φ(ν)n/2 − 3/2.
Proof. Let X be the set of vertices on P with colors in R, and let Y be the set of vertices with colors in Q. Suppose x, y are the first and the last vertices in P .
Let us focus on (i) first. For every vertex v ∈ X, we pick an edge a v b v inside the neighborhood of v, such that a v , b v / ∈ V (P ), and g(v, va v b v ) = 3. We require that the edges we picked form a linear forest. This is possible, and we can pick the edges one by one. For each step, the edge we chose cannot contain a vertex which already used twice in the previously chosen edges, and two end vertices of the new edge cannot both already used. Clearly, the number of edges that cannot be chosen is strictly less than νn 2 , but we have νn 2 options, by the definition of the dark blue vertices.
For every vertex u in Y , we pick an edge a u b u in N (u), and we pick the edge ab such that a ∼ x and b ∼ y, so for the endpoints x and y we pick two edges. Together with the edges we picked for the vertices in X, we further require that all the edges we picked are disjoint from P and they form a linear forest in G. Note that the number of edges we picked is less than cn.
Let G be the graph after removing all the vertices in P from G, we have δ(G ) (1/2+c/2)n. Now we apply Lemma 8, and suppose H is a Hamilton cycle in G containing all the edges we picked. We have two different ways to construct a Hamilton cycle in G.
We remove the edge ab and add ax, by to insert the entire path P , we denote the resulted Hamilton cycle by H 1 . Clearly, We can also insert the vertices in P one by one. That is, for every v ∈ V (P ), we remove the edge a v b v in H and add the edges va v , vb v . We then obtain a Hamilton cycle H 2 , and we have since the worst case is when all the vertices in Y are dark red. Therefore, we obtain a Hamilton cycle in G with discrepancy at least 1 2 (φ(ν)n − 3). Now we consider (ii). The ideas are similar: For every vertex v in X, we pick an edge We also pick ab adjacent to the end vertices of P , and we require all the edges we picked are disjoint from P , and they form a linear forest.
We now remove all the vertices in P from G. Let H be the Hamilton cycle in the resulted graph which contains all the edges we picked. We can either insert the entire path to H, or insert the vertices one by one. In the second situation, the worst case is when all the vertices in Y are red. This gives us a Hamilton cycle with discrepancy at least 1 2 (φ(ν)n − 3). Note that (ii) implies (v), since we can map −1 to +1, blue to red, and dark blue to dark red. For cases (iii) and (iv), for vertices in X, we pick edges as we did in (i). For the vertex u in Y , we pick a u b u in N (u) such that g(u, ua u b u ) is 3 and 1, respectively. Again, we construct a new graph G by removing vertices in the path P , and we find a Hamilton cycle H 1 in G containing all the edges we picked. We still have two ways to obtain the Hamilton cycle in G, insert the entire path, or insert the vertices one by one. If we insert the entire path, denote the resulted Hamilton cycle by H 1 , we get If we insert the vertices in P one by one, denote the resulted Hamilton cycle by H 2 , we have f (H 2 ) f (H) + 3|X| + |Y | f (H) + 2φ(ν)n.
Thus we obtain a Hamilton cycle in G with discrepancy at least 1 2 (φ(ν)n − 3).
Remark. Note that if we reverse the colors and the labels simultaneously, the same conclusions in Lemma 11 still hold.
With all tools in hand, we are going to prove Theorem 2.
Proof of Theorem 2. Let M ⊆ V (G) be the set of vertices having more than 1 colors. By Lemma 10, we have |M | < νn/3. Let A, B, C, D ⊆ V (G) \ M be the set of blue, red, dark blue and dark red vertices, respectively. By Lemmas 9 and 11, we may assume the following properties of G.
(i) At most νn/30 vertices in C (D) have more than νn/4 neighbors in C (D). Otherwise by Lemma 9 we can find a path P of length ν 2 n/240 either inside C, or inside D. In both cases, condition (iii) in Lemma 11 gives us a Hamilton cycle of discrepancy at least ν 2 n/480 − 3/4.
(ii) At most νn/30 vertices in C (D) have more than νn/4 neighbors in A (B). If not, there is a path of length ν 2 n/120 whose vertices alternate between C and A (between D and B), and condition (iv) in Lemma 11 gives us a Hamilton cycle of discrepancy at least ν 2 n/240 − 3/2.
(iii) At most νn/3 vertices in A (B) have more than νn/6 negative (positive) neighbors inside A (B). By the same reason as above, otherwise condition (v) in Lemma 11 gives us a Hamilton cycle of discrepancy at least ν 2 n/72 − 3/2.
(iv) At most νn/30 vertices in C (D) have more than νn/4 neighbors in D (C). If, say, at least νn/30 vertices in C have more than νn/4 neighbors in D, then suppose νn/60 of them have more positive neighbors in D. By Lemma 9, there is a positive path P of length ν 2 n/960 whose vertices alternate between C and D. We now apply condition (i) in Lemma 11, but in the form that I = {+1} and R = {dark red}. Thus there exists a Hamilton cycle with discrepancy at least ν 2 n/1920 − 3/2.
(v) At most νn/3 vertices in A (B) have more than νn/6 neighbors in B (A). By the same reason as above, if we have more than νn/3 vertices in A having more than νn/6 neighbors in B, we may suppose that νn/6 of them have more positive neighbors in B. Thus by Lemma 9 there is a path of length ν 2 n/144 whose vertices alternate between A and B.  We say a vertex in a set is typical if it behaves as almost all the vertices in this set, otherwise it is untypical. More precisely, a vertex v ∈ A (B) is typical if it has less than νn/6 negative (positive) neighbors in A (B), less than νn/6 neighbors in B (A), less than νn/6 neighbors in C (D), and less than νn/6 positive neighbors in D (C). A vertex v ∈ C (D) is typical if it has less than νn/4 neighbors in C (D), less than νn/4 neighbors in A (B), less than νn/4 neighbors in D (C), and less than νn/4 negative (positive) neighbors in B (A).
The rest of the proof is based on analyzing the number of dark vertices. Case 1: There exist at most νn/6 dark blue vertices and at most νn/6 dark red vertices.
Suppose |C| νn/6. By (i), (ii), (iv), and (vi), we have that at most 2νn/15 vertices in C are untypical, which implies that all the other vertices in C are ν-unbalanced. Hence |C| ( 1 4 − d + 2ν 15 )n, and |B| ( 1 2 + c − 3 4 ν)n, since the typical vertices in C have at most 3ν/4 vertices outside of B. This also gives us |D| νn/6, otherwise we would also have |A| ( 1 2 + c − 3ν 4 )n, and this contradicts with A ∩ B = ∅. Thus, we have |A| ( 1 2 −c+ 7ν 12 )n, and actually this implies |A| 4νn/3. The reason for this is, first by (iii), (v), (vii), and (viii), A contains at most 4νn/3 untypical vertices. By (1 − 3ν)n, since besides B \ B and C \ C , we have |A| 4νn/3, |D| νn/6, and |M | νn/3. Also, for every v ∈ V (K), δ K (v) ( 1 2 + c − 3ν)n. This is because, for every u ∈ B , by (v) and the size of D and M , all but at most 2νn/3 neighbors of u are in B ∪ C. By (iii) and (viii), u has at most νn/6 positive neighbors in B and at most νn/6 negative neighbors in C. By the size of B \ B and C \ C , we have δ K (u) ( 1 2 + c)n − 2νn − 2νn 15 . Similarly, for every w ∈ C , by (i), (ii), (iv), (vi), and the size of M and B \ B , δ K (w) ( 1 2 + c)n − 2νn − νn 3 . Therefore, K contains a Hamilton cycle H. Since C is an independent set in K by (i), the number of positive edges in H is at most 2|C | 2|C| ( 1 2 − 2d + ν)n. Now we go back to G. Note that H is also a Hamilton cycle in G[B ∪ C ]. In the final step, we are going to insert all the vertices in We have |J| 3νn. Then after we insert all vertices in J to H, we obtain a Hamilton cycle in G, which contains at most ( 1 2 − 2d + ν)n + 2|J| = ( 1 2 − 2d + 7ν)n positive edges. Therefore, G contains a Hamilton cycle with discrepancy at least (4d − 14ν)n > 2νn.
(ii) Bollobás [4] showed for 3 j k, where k is fixed, and X j stands for the number of cycles of length j in G ∈ G n,3 , that X 3 , . . . , X k are asymptotically independent Poisson random variables with means λ j = 2 j /(2j).
(iii) Wormald proved (see [15,Lemma 2.7]) that for a fixed d and every fixed graph F with more edges than vertices, G ∈ G n,d a.a.s. contains no subgraph isomorphic to F .
Fix an arbitrary f : E(G) → {−1, 1}, denote N and P the subsets of edges, where f takes −1 and 1, respectively. We may assume that |N | |P |, i.e., |N | 3n/4. Denote by G + the subgraph of G spanned by P , and let A i be the set of components with size i in G + , while a i := |A i |. The number of components in G + is t = n i=1 a i . Note that (i) means that G is connected w.h.p. so G has a spanning tree T satisfying that |E(T ) ∩ N | t − 1. Hence if t (1/2 − 2 −12 )n + o(n) or t (1/2 + 2 −12 )n + o(n) then D(G, T n ) 2 −12 n − o(n).
Three edges of N are incident to each element of A 1 , four edges to each of A 2 . The number of edges incident to a component of size at least 3 could be less than four only if the component contains a cycle, i.e., w.h.p. only in O(1) many components A i for i = 3, . . . , 2 9 . For every component larger than 2 9 , and smaller than n/2, w.h.p. the number of incident edges is at least four by (i).
That is, w.h.p. 4 Discrepancies of planar graphs Lemma 12. Let C be a vertex cut of a connected graph G, that is V (G) = A ∪ B ∪ C such that there are no edges between A and B, and, say, |A| |B|. Then D(G, T n ) |B| − |A| + |C|.
and arbitrary in E(C). Every spanning tree T of G has at most |C| components restricted to A ∪ C. It means the number of edges labeled by 1 is at least |A| + |C|− 1 −|C| = |A|− 1 in T , and the edges labeled by −1 at most |B| + |C| − 1.
Proof of Theorem 4. To deduce Theorem 4 we need to recall the celebrated planar separation theorem of Lipton and Tarjan in [12]. It says if G is a planar graph on n vertices then G has a vertex cut of size O( √ n) partitioning the graph into two parts A and B, where n/3 |A|, |B| 2n/3. A well-known consequence [9,Theorem 5] of that theorem is that there exists a cut C and constants c 1 , c 2 , c 3 such that n/2 − c 1 √ n |A|, |B| n/2 + c 2 √ n and |C| = c 3 √ n. Having the partition above we can use Lemma 12 getting that for a planar graph G, Lemma 13 ([8]). Let S ⊆ P k P k such that (k 2 − k)/2 |S| (k 2 + k)/2. Then we have |∂S| k.
Proof of Theorem 5. Assume there exists an f : E(P k P k ) → {−1, 1} such that D(P k P k , T n , f ) k/4. Let P, N and M be the subset of vertices, such that v ∈ P if all edges incident to v are positive, v ∈ N if all edges incident to v are negative, and M = V − N − P . Consider an arbitrary Hamiltonian path in P k P k , from the assumption on f it follows that |P |, |N | k 2 /2 + k/8 + 2.
We identify the vertices of P k P k with coordinate pairs such that (0, 0) belongs to the bottom left vertex, (k − 1, k − 1) to the upper right vertex. For r, s ∈ {0, 1} let X r,s be those vertices (i, j) (0 i, j k − 1) for which i = r (mod 2) and j = s (mod 2). At least one of these sets X r,s contains at least k/4 vertices of M , say X 0,0 . Consider an arbitrary tree T spanned on the vertices X 0,1 ∪ X 1,0 ∪ X 1,1 .
Note that we can extend T to the entire P k P k such that the vertices of X 0,0 will be leaf vertices in the extension. Moreover for (i, j) ∈ X 0,0 ∩ M we can connect (i, j) to T with either an edge labeled by −1 or 1. Fixing any extension to X 0,0 \ M , let T + (T − ) be the extension where we use the edge labeled by 1 (−1) for the vertices X 0,0 ∩ M . Obviously, | e∈T + f (e) − e∈T − f (e)| k/2, so either | e∈T + f (e)| or | e∈T − f (e)| is at least k/4.
Proof of Proposition 6. We show first that D(P k P 2 , P) k/2. Let us refer to the graph P k P 2 as a rectangle with horizontal length k in which the edges are labeled by f . Let X and Y be the set of the vertical edges labeled by +1 and −1 respectively. Without loss of generality, we may assume |X| |Y | and let x := |X| k/2, y := |Y |. We consider four paths: P (X) starts from the left-upper corner goes to right except when it meets an edge e ∈ X at which point it goes down or up, depending on which one is possible. The path P (X) is almost the same, but it starts from the left-lower corner. Finally the paths P (Y ) and P (Y ) are drawn analogously, those also start from left and go to right, but rise and fall at the edges belonging to Y . Note that P (X) and P (X) each contain X, P (Y ) and P (Y ) each contain Y . P (X) ∪ P (X) and P (Y ) ∪ P (Y ) have the same set of horizontal edges.
Let z 1 := e∈P (X)\X f (e), and z 2 := e∈P (X)\X f (e). If max{z 1 , z 2 } 0, then we are done since one of e∈P (X) f (e) or e∈P (X) f (e) is at least k/2. If both z 1 and z 2 are negative, we have D(P k P 2 , P, f ) x + z 1 , and D(P k P 2 , P, f ) x + z 2 . Considering the paths P (Y ) and P (Y ) we also have 2D(P k P 2 , P, f ) 2y − z 1 − z 2 , since the horizontal edges in those carry exactly z 1 + z 2 negative surplus. Adding those up, we get 4D(P k P 2 , P, f ) 2x + 2y, that is D(P k P 2 , P, f ) k/2 since x + y = k.
In the general case we may assume that k and P k P is referred as a rectangle with k rows and columns. We cut out k/2 non-touching stripes P 2 P . For every f : E(P k P ) → {−1, 1}, applying our construction of paths above, without loss of generality, at least half of the rectangles have a path with more positive edges, and with discrepancy at least /2 . Note also, that these paths can be joined into one path by adding at most k − 1 edges. Thus, we create a path with discrepancy at least 1 2 and the result is proved.