Switching Checkerboards

In order to study $\mathbf{M}(R,C)$, the set of binary matrices with fixed row and column sums $R$ and $C$, we consider sub-matrices of the form $\begin{pmatrix} 1&0 \\ 0&1 \end{pmatrix}$ and $\begin{pmatrix} 0&1 \\ 1&0 \end{pmatrix}$, called positive and negative checkerboard respectively. We define an oriented graph of matrices $G(R,C)$ with vertex set $\mathbf{M}(R,C)$ and an arc from $\mathbf{A}$ to $\mathbf{A'}$ indicates you can reach $\mathbf{A'}$ by switching a negative checkerboard in $\mathbf{A}$ to positive. We show that $G(R,C)$ is a directed acyclic graph and identify classes of matrices which constitute unique sinks and sources of $G(R,C)$. Given $\mathbf{A},\mathbf{A'}\in\mathbf{M}(R,C)$, we give necessary conditions and sufficient conditions on $\mathbf{M}=\mathbf{A'}-\mathbf{A}$ for the existence of a directed path from $\mathbf{A}$ to $\mathbf{A'}$. We then consider the special case of $\mathbf{M}(\mathcal D)$, the set of adjacency matrices of graphs with fixed degree distribution $\mathcal D$. We define $G(\mathcal D)$ accordingly by switching negative checkerboards in symmetric pairs. We show that $Z_2$, an approximation of the spectral radius $\lambda_1$ based on the second Zagreb index, is non-decreasing along arcs of $G(\mathcal D)$. Also, $\ll$ reaches its maximum in $\mathbf{M}(\mathcal D)$ at a sink of $G(\mathcal D)$. We provide simulation results showing that applying successive positive switches to an Erd\H os-R\'enyi graph can significantly increase $\lambda_1$.


Introduction
In the study of diffusion processes along a network, the largest eigenvalue of the adjacency matrix, called the spectral radius of the network and denoted by λ 1 , plays a critical role.For instance, in epidemic models, having a reproduction number R 0 greater or smaller than 1/λ 1 determines whether the epidemic will die out or keep spreading.Also, in the problem of synchronisation of coupled oscillators on a network, a key threshold criterion for the stability of the synchronised solution is based on λ 1 .The largest eigenvalue similarly affects other percolation processes such as wildfires or rumors spreading in social networks and is also of interest in the study of random matrices.
The parameter which has the greatest impact on the value of λ 1 is the degree distribution of the network.Indeed, some lower bounds and approximations of λ 1 are entirely determined by the degree distribution [14].Such approximations can be very precise for the vast majority of cases, but tend to become wildly inaccurate in extreme cases of networks with very particular topological properties.In this article, we consider the degree distribution fixed in order to analyse how the topology of the network affects λ 1 .The study of matrices with fixed degree distribution has applications to epidemic models [6], synchronisation problems [11], ecology [5], LT codes [8] and many other areas.Once the degree distribution is fixed, the degree assortativity is the most important parameter of real networks [16,12].
When working with a fixed degree distribution, we rely on a basic operation which consists in switching the 1s and 0s in a 2 × 2 sub-matrix of the adjacency matrix of the form 1 0 0 1 or 0 1 1 0 , called a checkerboard.Any such switching amounts to rewiring two edges in a way that leaves the degree distribution invariant.This allows us to visualise the set of binary matrices with a given degree distribution as the vertex set of a graph where two matrices are adjacent if they differ by one switch.It was shown in [15] that this graph of matrices is connected.
In this paper, we call the two above sub-matrices positive and negative checkerboards.This polarisation of checkerboards defines an orientation of the edges of the graph of matrices.In Section 1, we introduce the basic definitions surrounding checkerboards.Then, in Section 2, we show that the oriented graph of matrices is a directed acyclic graph and discuss its sources and sinks as well as when A can be reached from A by following an oriented path.Finally, in Section 3, we describe how the second Zagreb index, an approximation of λ 1 , evolves throughout the graph of matrices.We then show that λ 1 reaches its global maximum at a sink of the graph of matrices and describe the evolution of λ 1 through simulations.The proofs of two theorems from Section 2 have been placed in the appendix for the sake of improving readability.In order to maximise the generality of our results, we have considered non-symmetric binary matrices with fixed row and column sums in all sections except Section 3, where we consider only adjacency matrices.Note that a non-symmetric matrix A can be interpreted as a characteristic sub-matrix of M = 0 A t A 0 , where M is the adjacency matrix of a bipartite graph.

Positive and Negative Switches
Given a (0, 1)-matrix A, a checkerboard of A is a 2 × 2 sub-matrix of A of the form either 1 0 0 1 or 0 1 1 0 .A checkerboard found on rows i and j and columns k and l, with i < j and k < l, is said to have coordinates (i, j, k, l).
A unitary checkerboard is a checkerboard of area 1 and has coordinates (i, i + 1, k, k + 1).Switching a checkerboard refers to replacing one form with the other.Note that row and column sums are invariant under this operation.The following result was shown by Ryser in 1957: Theorem 1 ( [15]).Given two matrices A and A in the class of (0, 1)-matrices having specified row and column sums, one can pass from A to A by a finite sequence of switches.
This property makes switching checkerboards an essential tool for studying classes of matrices with fixed row and column sums as well as classes of graphs with fixed degree distributions.Applying successive random switches to a binary matrix creates a Markov chain which visits all possible matrices with the same row and column sums.This Markov chain can then be used to sample randomly matrices with a fixed degree distribution [2].
In this paper, we attribute a sign to checkerboards and switches: a checkerboard of the form 1 0 0 1 is said to be positive while a checkerboard of the form 0 1 1 0 is said to be negative.A positive switch corresponds to replacing a negative checkerboard with a positive one while a negative switch is the reverse.We define a switching matrix C i,j,k,l , with i < j and k < l, as having coefficients c ik = c jl = 1, c il = c kj = −1 and 0 elsewhere.Thus, a positive (resp.negative) switch of coordinates (i, j, k, l) corresponds to adding (resp.subtracting) C i,j,k,l .Note that C i,j,k,l = i≤p<j,k≤q<l C p,p+1,q,q+1 ; i.e. any switching matrix is a sum of unitary switching matrices.Note also that the unitary switching matrices are linearly independent and form a basis of the space of zero-sum (for rows and columns) matrices.
2 Oriented Graph of Matrices

Sources and Sinks
Given vectors R ∈ N p and C ∈ N q , let M(R, C) denote the set of binary matrices with row and column sums R and C. We assume M(R, C) = ∅.Let G(R, C) denote the oriented graph with vertex set M(R, C) and there is an arc from A to A if A can be obtained from A with a positive switch.
As mentioned in the introduction, the undirected graph underlying G(R, C), called interchange graph in [4], is well-studied in the literature.In [2], multiple algorithms which generate random networks with a fixed degree distribution are based on this graph.Our purpose here, however, is to focus on properties which derive from the orientation.Proposition 1.The graph G(R, C) is connected and acyclic.
Proof.For A ∈ M(R, C), let I(A) = i,j ija ij .Let A be obtained from A with a positive switch of coordinates (i, j, k, l) where i < j and k < l; i.e there is an arc from A to A in G(R, C).Then, Since I increases along arcs, and therefore along directed paths, G(R, C) is acyclic.
The connectedness property is Ryser's theorem: a sequence of (positive or negative) switches leading from A to A corresponds to an undirected path in G(R, C).
Recall that directed acyclic graphs have sources and sinks which are vertices with zero in-degree and out-degree, respectively.In G(R, C), sources and sinks are, respectively, matrices with no positive checkerboards and no negative checkerboards.
A matrix A ∈ M(R, C) is said to be nested (resp.anti-nested) if the sequence 01 (resp.10) does not appear in any row or column; i.e if the 1s occur before the 0s (resp.0s before 1s) in every row and column.Nested graphs have important applications, in particular in ecology [5].For our purpose, the nested case is both trivial and theoretically important, as indicated by the following proposition and its corollary.Proof.If A is nested, the sequence 01 does not appear in any row or column of A. Hence, there is no checkerboard in A.
Conversely, if A is not nested, there is a row or column containing the sequence 01.Say it is a row; since the column with the 0 has degree at least equal to that with the 1, there is another row containing 10 in the same two columns.Hence, there is a checkerboard.Corollary 1.The set M(R, C) is a singleton if and only if it includes a matrix which becomes nested after reordering its rows and columns by non-increasing degree.
Proof.This result derives from Proposition 2 by using Theorem 1 and the fact that the number of checkerboards in a matrix is invariant under row and column permutation.
We define a zebra as a matrix in M(R, C) which is the sum of two matrices, one nested and one anti-nested.The name zebra refers to the three stripes formed by the 1s and 0s in the matrix, as shown in Example 1.We say that a zebra is split vertically (resp.horizontally) if no column (resp.row) has 1s from both the nested and anti-nested parts (see Example 1).In other words, a split zebra can be split along a vertical (or horizontal) axis so that the left (resp.top) half is nested while the right (resp.bottom) half is anti-nested.Note that the two "halves" need not be of equal size.Also, we define an anti-zebra as the complement of the vertical reflection of a zebra; i.e. b ij = 1 − a n−i,j (see Example 1).
Example 1 (Zebras and Anti-zebras).The matrices A and A are zebras.In A, the nested and anti-nested parts overlap horizontally and vertically, so A is not split.Meanwhile, A is a horizontally split zebra, where the top three rows are nested and the bottom three anti-nested.Matrices B and B are antizebras which are the complement of the vertical reflection of A and A , so B is horizontally split and B is not split.
Like nested graphs, zebras and anti-zebras can be characterised by the absence of certain sub-matrices: Proof.The absence of those sub-matrices derives from the geometry of the zebra.The converse, which is not needed to prove the theorem, we leave as an exercise.
Note that the forbidden sub-matrices include negative checkerboards; thus zebras and anti-zebras form sinks of G(R, C).Proof.This derives from the geometry of the split zebra and anti-zebra.
Theorem 2. If M(R, C) contains a split zebra or a split anti-zebra, then that split zebra or anti-zebra is the only element of M(R, C) without negative checkerboards; i.e it is the unique sink in G(R, C).
(Proof in the appendix) Corollary 2. Let B ∈ M(R, C) be a split zebra or a split anti-zebra.For all A ∈ M(R, C), B can be reached from A via a sequence of positive switches.
Proof.The complement of a unique sink is a unique source.

Adapting Ryser's Theorem to the Oriented Graph of Matrices
It follows from Theorem 1 that the undirected version of G(R, C) is connected.
Having introduced an orientation naturally raises the question of when can a matrix A be reached from matrix A via a sequence of positive switches.The remainder of this section is devoted to answering this question.We will denote by A → A that there is a directed path connecting Proof.Each positive switch corresponds to adding a switching matrix and each switching matrix is a sum of unitary switching matrices.The unicity of T follows from the linear independence of the unitary switching matrices.
• Note that T is uniquely determined by M, even when multiple switching sequences lead from A to A (see Example 2).
• Given M = A − A which satisfies condition (i), if we switch a negative checkerboard in A to positive, then the coefficients of T inside a rectangle corresponding to the checkerboard are all decreased by 1.The new matrix M still satisfies condition (i) if and only if the coefficients of T all remain non-negative.Reaching A via successive switches corresponds to reducing T to 0 in this fashion.(See examples below for more details.) We denote by (i) the necessary condition given in Proposition 3. Unfortunately, condition (i) is not sufficient to ensure A → A , as shown in Example 3.
A .In the first case, we add the switching matrices In both of these sums, the first switching matrix can be split into two unitary switching matrices.So M is the sum of three unitary switching matrices: Matrix A has only one negative checkerboard, with coordinates (1, 4, 1, 4).After switching it to positive, reaching A now requires a negative switch of coordinates (2, 3, 2, 3).Indeed, switching that checkerboard decrements all coefficients of T , leaving a -1 in the centre.Hence A → A .
While the matrix M is the sum of eight unitary switching matrices, and can be written as a sum of (not all unitary) switching matrices in many ways, none of these sums includes C 1,4,1,4 .So none of the switches appearing in these sums is feasible in A.
Let us extend T so that t ij = 0 if i = 0 or p, or if j = 0 or q.Then, for all i, j, we have: Proof.Each switching matrix has four non-zero coefficients.So in condition (i), exactly four terms in the sum contribute to m ij .If M satisfies (i), we create a (p − 1) × (q − 1) grid, with the coefficients of T inside the cells and the coefficients of M at the corners (see Figure 1).Each cell corresponds to a unitary switching matrix and each coefficient of T indicates how many times its cell needs to be switched in order to go from A to A .Let m = max t ik .For 1 ≤ i ≤ m, we define P i (M) as the reunion of the cells of the grid with coefficients at least i (see Example 4).Note that P i (M) is formed by one or several polyominoes.We recall that a polyomino is a shape formed by a finite number of orthogonally connected cells in a square grid.

Example 4. Let
pentomino (see Figure 2) and P 3 (M) and P 4 (M) are monominoes surrounding only the central cell.Note that we have A → A and going from A to A requires at minimum four switches.
Lemma 2. If P i (M) contains two diagonally adjacent cells, then at least one of the two common neighbouring cells is also in P i (M).
Proof.Say the cells of coordinates (i, j) and (i − 1, j − 1) are in P i (M) and the cells of coordinates (i − 1, j) and (i, j − 1) are not in P i (M) (or vice versa).Then, t ij , t i−1,j−1 ≥ i (resp.≤ i − 1) and follows from Lemma 1 that m ij ≥ 2 (resp.≤ −2).Since M = A − A and A and A have binary coefficients, the coefficients of M are in {−1, 0, 1}.This is impossible.
Remark 2. This means that P i (M) cannot contain two polyominoes connected by a corner.
If M satisfies the following conditions: (Proof in the appendix) Note that the third condition says that the coefficients inside orthogonally or diagonally adjacent cells must be equal or successive integers.Condition (iii) in Theorem 3 is probably unnecessary and it seems that if for some i, P i (M) is not simply connected, it should be possible to create an instance where A → A , like in Example 3. Combining these two observations yields the following conjecture: ) For all i, each connected component of P i (M) is simply connected.
3 Spectral Radius and Second Zagreb index

Extrema
In this section, we consider the class of adjacency matrices of simple graphs with fixed degree distribution D. We investigate how the topology of simple graphs affects their spectral radius.To this purpose, we analyse the effect of successive positive checkerboard switches on the spectral radius λ 1 as well as on the second Zagreb index M 2 , which was used in [1] to create an approximation of λ 1 : Z 2 = M2 m .Amongst all the existing approximations for λ 1 , we chose to focus on Z 2 because we are able to map very precisely how it varies throughout the set of adjacency matrices of fixed degree distribution.In contrast, most other commonly used approximations are determined by the degree distribution, meaning that they are invariant under checkerboard switching.[13,14].
Let G = (V, E) be a simple graph with |V | = n and |E| = m and adjacency matrix A. Let d i denote the degree of vertex i ∈ V .The spectral radius of G, denoted by λ 1 (G) or λ 1 (A), is the largest eigenvalue of A. The first and second Zagreb indices are defined as M 1 = i∈V d 2 i and M 2 = ij∈E d i d j and we have Z 1 = M1 n and Z 2 = M2 m .Note that Z 1 is the quadratic average over V of the degrees, while Z 2 is the quadratic average over E of d i d j .It is well-known that λ 1 ≥ Z 1 , with equality if G is a regular graph [7].Thus, it is the heterogeneity of D that allows λ 1 and Z 2 to vary among the class of graphs with degree distribution D. Also, for a fixed degree distribution, M 2 is proportional to the degree assortativity coefficient r, which is the standard Pearson coefficient for correlation between the degrees [10]: Let D ∈ N n be the degree distribution of a simple graph.We now consider the class M(D) of adjacency matrices of simple graphs of order n with fixed degree distribution D; i.e. symmetric binary matrices with zeroes on the diagonal and row and column sums D. Due to the absence of loops, we only consider, in this section, checkerboards with no coefficient on the diagonal.Also, given the symmetry of the matrices, checkerboards always come in symmetric pairs which are always switched together.In terms of graphs, a checkerboard corresponds to a 4-cycle of alternating edges and non-edges.Switching a checkerboard means switching the edges and non-edges.We define the symmetric switching matrix C ijkl = C ijkl + t C ijkl .Note that we now require the coordinates (i, j, k, l) to be all different.The distinction between positive and negative checkerboards for graphs is dependent on an ordering of the vertices.We will always sort the vertices by non-increasing degree; i.e D is non-increasing.A positive (resp.negative) switch of coordinates (i, j, k, l) now corresponds to adding (resp.subtracting) C ijkl to the adjacency matrix.We define G(D) as the directed graph with vertex set M(D) and an arc joins A to A when A can be obtained from A by a positive switch.Proof.The connectedness is shown in [3].The acyclicity follows from the acyclicity in the asymmetric case.Lemma 3. Let A, A ∈ M(D) be such that A can be obtained from A by a positive switch of coordinates (i, j, k, l).We have M Proof.A is obtained from A by adding the edges ik and jl and removing il and kj.
Proposition 5. M 2 and Z 2 are non-decreasing along arcs of G(D).
Proof.This follows from Lemma 3 and D being non-decreasing.
Note that M 2 and Z 2 are constant only along arcs of G(D) which correspond to a checkerboard of coordinates (i, j, k, l) where Corollary 4. The sources and sinks of G(D) are, respectively, the local minima and maxima of M 2 and Z 2 .
The above results give a clear picture of the variations of M 2 and Z 2 along G(D).Unfortunately, the variations of λ 1 are not quite so neatly organised.The following lemma gives a lower bound to the effect of a single positive switch on the spectral radius: Lemma 4. Let A, A ∈ M(D) such that A can be obtained from A by a sequence of positive switches of coordinates (i p , j p , k p , l p ).Let X denote the normalised principal eigenvector of A. We have Proof.Let X denote the normalised principal eigenvector of A .Recall that where || || is the L 2 -norm.We have: Unfortunately, the coefficients of the principal eigenvector are not always in the same order as the degrees.They are, however, strongly correlated [9]; so λ 1 increases along most arcs of G(D).In fact, they are perfectly correlated in the case where λ 1 is maximum: Proposition 6.If A realises the maximum of λ 1 over M(D), then the coefficients of the principal eigenvector X of A are in the same order as the degrees; i.e. d i > d j ⇒ x i ≥ x j .
Proof.Assume we have d i > d j and x i < x j .Let E be a set of d i − d j vertices adjacent to i and not j, with j / ∈ E. Let A be obtained from A by replacing the edges between i and E with edges between j and E. Note that all the non-zero coefficients of A −A are in rows and columns i and j.Let X be the normalised principal eigenvector of A .We have: Consider the case where 2(x j − x i ) k∈E x k = 0.According to the Perron-Froebenius theorem for non-negative matrices, X has non-negative coefficients.Thus, since Since all terms in l a kl x l are non-negative and k is adjacent to i, we deduce that x i = 0. Similarly, any vertex l in the connected component of i has x l = 0. Since x j > 0, λ 1 (A) is the spectral radius of the connected component of j, to which i does not belong.Thus, the connected component of j in A is a proper sub-graph of that in A .So λ 1 (A ) > λ 1 (A) in this case and in all cases.
Let A be obtained from A by switching the i-th and j-th rows and the i-th and j-th columns.A has the same row and column sums as A and we have λ 1 (A ) = λ 1 (A ) > λ 1 (A).Thus, A does not maximise λ 1 .
From this, we deduce the following: Theorem 4. The maximum of λ 1 is reached at a sink of G(D).
Proof.Let A maximise λ 1 over M(D).For each set of same-degree vertices, we can reorder the rows and columns of A so that within these sets, the coefficients of the principal eigenvector are non-increasing.This operation does not affect λ 1 .It follows from Proposition 6 that all the coefficients of X are now nonincreasing.Let A be obtained from A by a sequence of positive switches of coordinates (i p , j p , k p , l p ).It follows from Lemma 4 that Since λ 1 (A) is maximum, any matrix A ∈ M(D) such that A → A also maximises λ 1 , including the sinks that can be reached from A.

Switching Algorithm Simulations
While Theorem 4 tells us that at least one sink of G(D) realises the global maximum of λ 1 , it gives no indications for identifying which sink to aim for when G(D) contains several, as is usually the case.In this section, we showcase how applying successive random switches to Erdős-Rényi and Small-World graphs, after ordering its vertices by degree, leads to an increase in λ 1 , which is significant when the edge density is low.Instead of using a Monte-Carlo method as in the Xulvi-Brunet Sokolov algorithm [16], we only apply positive switches selected randomly in the adjacency matrix.Simulations that begin with an Erdős-Rényi graph E(N, p) with vertices ordered by degree are shown in Figure 3 and Small World graphs appear in Figure 4.In both cases, the end result of the switching process is a zebra with some noise when p > 0.5 and an anti-zebra with some noise when p < 0.5.When p = 0.5, the end point is simultaneously almost a zebra and almost an anti-zebra.In the Erdős-Rényi case with p = 0.2, the spectral radius increases by more than 15%, which is very impressive for a fixed degree distribution.Conversely, when p = 0.7, the spectral radius increases only by a few decimal points.
Figure 4: Same as Figure 3 with Small-World graphs obtained from a 10 × 10 regular grid after a random rewiring of 10% of the edges.

Conclusion
Our analysis of the oriented graph of matrices has given us the tools needed to study how the topology of graphs impacts their spectral radius λ 1 .We have shown that the global maximum of λ 1 is reached for a matrix without negative checkerboards.Our simulations show that successively switching negative checkerboards to positive can yield a high increase in λ 1 , especially for sparse graphs.
Appendix: Proofs of Theorems 2 and 3

Proof of Theorem 2
Theorem.If M(R, C) contains a split zebra or a split anti-zebra, then that split zebra or anti-zebra is the only element of M(R, C) without negative checkerboards; i.e it is the unique sink in G(R, C).
Proof of theorem 2. Let A ∈ M(R, C) be a zebra with a horizontal split (i.e. the top half is nested and the bottom anti-nested) and let A ∈ M(R, C), A = A. We will show that A has a negative checkerboard.Let M = A − A. Since A and A have the same row and column sums, M has as many 1s and -1s in each row and column.We can thus choose in each row and column of M a matching associating each 1 to a -1.Let us now choose a -1 in M as a starting point for the sequence defined by the following rules: a -1 is followed by its paired 1 in the same row; a 1 is followed by its paired -1 in the same column.Since the matrix M is finite, the sequence must form a cycle.A 1-11 sub-sequence in M corresponds to a 010 sequence in A, with the first 0 in the same column as the 1 and the second 0 in the same row.Thus, it follows from Claim 1 that at a -1, the cycle must form a right turn.Also, after turning right (resp.left) at a 1 in M (0 in A), the following -1 is located in the same column on the other side (resp.the same side) of the split in A.
If the cycle turns left at every 1 (and right at every -1), it forms an infinite staircase pattern, which is impossible.Assume that there is at least one left turn at a 1.There must be a left turn at a 1 followed by a right turn at the next 1 somewhere in the cycle.This yields a -11-11-1 sequence with a left turn at the first 1 and a right turn at the second, as shown in Figure 5.Note that the first four digits are located on the same side of the split while the final -1 is on the other side.We now consider the coefficient located at the intersection point A of the row containing the first two digits and the column with the last two.Note that A must be positioned between those last two digits due to the final -1 being on the other side of the split.If that coefficient is a 0 in A , then it forms a negative checkerboard in A together with the middle three coefficients of our sequence; and thus A is not a sink.Assume now that it is a 1 in A .
The first two terms of our sequence are respectively 1 and 0 in A. According to Claim 2, there is no 1 0 1 sub-matrix in A. So the coefficient at A is 0 in A and 1 in M. Thus, we can shorten our cycle by replacing the middle three coefficients of our sequence with this 1.The resulting cycle has one fewer left turns.By repeating this operation, we obtain a cycle with no left turn.
Let us now consider the corresponding cycle in A .It satisfies the following properties: • It alternates between 0s and 1s, going from 0 to 1 horizontally and 1 to 0 vertically.
• It always turns to the right.
• All vertical segments cross the split.
If this cycle self-intersects, it forms one of the patterns shown in Figure 6 (possibly rotated by 180 • ).In case a) (resp.b)), if the coefficient located at intersection point A is a 0 (resp 1), it forms a negative checkerboard with the second, third and fourth (resp.fourth, fifth and sixth) terms of the sequence.Else, if the coefficient located at B is a 0 (resp.1), A, B and the fifth and sixth terms (resp.second and third terms) form a negative checkerboard.Else, if B is a 1 (resp.0), the sequence can be shortened by replacing the five middle terms with B. This removes the intersection at A while maintaining the three properties of the cycle.By repeating this operation, we obtain a cycle with no left turn and no intersection; i.e. a negative checkerboard.Thus A must have a negative checkerboard.The case of vertically split zebras follows by symmetry along the main diagonal.The vertical reflection of a unique sink is a unique source; and the complement of a unique source is a unique sink.Thus, the same property holds if A is a split anti-zebra.

Proof of Theorem 3
In order to prove Theorem 3, we will first prove that one of the shapes described in Figure 7 must appear on the contour of any simply connected polyomino.We will then show that where this shape appears on P m (M), we can locate a checkerboard to switch.Repeating the operation will create a directed path from A to A .Lemma 5. On the contour of any simply connected polyomino, there appears at least one of the three motifs described in Figure 7.
Proof.Let P be a simply connected polyomino.If P is a rectangle, we have motif 1.We will now assume that P is not a rectangle.
We define left (resp.right) corners of P as corners where the contour of P, when followed clockwise, turns left (resp.right).Note that P is locally non-convex (resp.convex) around left (resp.right) corners.
) Motif 1 occurs when the entire polyomino is a rectangle.
2) In motif 2, the two vertical sides must have equal length; i.e.AB = CD.Also, the inside of rectangle ABCD must be entirely included in the polyomino.
The lengths are variable and the motif may be rotated.
3) In motif 3, the rightmost side is longer than AB.The inside of rectangle ABCD must be entirely included in the polyomino.The lengths are variable and the motif may be rotated or reflected.
Figure 7: Motifs from the contour of a polyomino For x, y ∈ P, we define an orthogonal path from x to y as a line joining x and y consisting of only horizontal and vertical segments included inside P. We denote by OP (x, y) the set of orthogonal paths joining x and y.We then define the length of an orthogonal path L as the pair (N L , l L ), where N L is the number of segments of L and l L is the length of the last segment.We define d(x, y), the distance between x and y, as the length of the minimal orthogonal path, going by lexicographic order (ie.d(x, y) = (N 0 , l 0 ) with N 0 = min L∈OP (x,y) N L and l 0 = min L∈OP (x,y);N L =N0 l L ). 1Since P is not a rectangle, it is not convex; so we may choose a point x 0 ∈ P such that P is not starred in x 0 .The set of points in P which maximise the distance to x 0 comprises one or several segments from the contour of P. Let B and C be the ends of one such segment.Both B and C must be corners of P, else points on (B, C) outside of [B, C] would be at an equal or greater distance from x 0 .Let A and D be the other two corners adjacent to B and C, respectively.B and C must be right corners, otherwise points inside of [AB] or [CD] would be at a greater distance from x 0 .The rectangle ABCD must be included inside of P: if a part of ABCD was outside P, since P is simply connected, the minimal orthogonal path from x 0 to B would need to go around one side of the missing part, and reaching the other side from x 0 would require a path with more turns.
We may assume w.l.o.g that AB ≤ CD.Then, A must be a left corner, else reaching [AB] from x 0 would require one more turn than [BC].If AB = CD, D must similarly be a left turn, and we have the second motif.If AB < CD, we have the third motif.
We may now prove Theorem 3.
Proof of Theorem 3. Let A, A and M satisfy the conditions of Theorem 3; let T satisfy (i) and let m = max t ik .It follows from applying Lemma 5 to a connected component of P m (M) that there is a rectangle ABCD corresponding to one of the three motifs described in Figure 7 included inside P m (M).Since m is the maximum coefficient, all cells in P m (M) have coefficient m.It follows from (iii) and Remark 2 that all cells orthogonally or diagonally adjacent to P m (M) have coefficient m − 1.From Lemma 1, we have m ij = t ij + t i−1,j−1 − t i,j−1 − t i−1,j , where t ij = 0 if i = 0 or p or j = 0 or q.For a right (resp.left) corner of P m (M), three (resp.one) of the incident cells have coefficient m − 1 and one (resp.three) has coefficient m.Thus coefficients of M located at corners of P m (M) must be 1 or −1.More precisely, regardless of the orientation of ABCD, the coefficients of M located at the corners are 1 for the top left and bottom right corners and −1 for the top right and bottom left, except for D in motif 3 which has a 0.
A 1 in M means a 0 in A and 1 in A ; a −1 in M is the reverse; and a 0 in M means either two 0s or two 1s in A and A .So, a 1 −1 −1 1 sub-matrix in M means there is a negative checkerboard in A and a positive checkerboard in A .If any one of the four coefficients is replaced by 0, then there is either a negative checkerboard in A or a positive checkerboard in A .Switching that checkerboard, either in A or in A , results in a new instance where ABCD has been cropped from P m (M).Thus, the new instance still satisfies the three conditions of Theorem 3. Repeating the process terminates with M = 0, as t ik is reduced at each step.This constructs a directed path from A to A in G(R, C).

Proposition 2 .
If R and C are non-increasing, then A ∈ M(R, C) is nested if and only if it has no checkerboards.

Figure 1 :
Figure 1: Relation between coefficients of M and T

Figure 2 :
Figure 2: Polyomino P 2 (M) of Example 4. Coefficients of M are placed at the intersections of the grid and coefficients of T are inside the cells.

Proposition 4 .
The graph G(D) is connected and acyclic.

Figure 3 :
Figure 3: Spectral radius (plain) and Z 2 (dotted) as functions of the number of positive switches, starting from Erdős-Rényi graphs with N = 100 vertices.From left to right, the edge density p ranges from 0.2 to 0.7.Both the initial (Erdős-Rényi with vertices ordered by degree) and the final matrices are shown in each case.

Figure 5 :
Figure 5: Section of a cycle with a left turn.The dotted line indicates the horizontal split of the zebra.

Figure 6 :
Figure 6: Section of a self-intersecting cycle with no left turn.The dotted line indicates the horizontal split of the zebra.