Skip to main content
Advertisement
Browse Subject Areas
?

Click through the PLOS taxonomy to find articles in your field.

For more information about PLOS Subject Areas, click here.

  • Loading metrics

Efficiently sampling the realizations of bounded, irregular degree sequences of bipartite and directed graphs

  • Péter L. Erdős ,

    Contributed equally to this work with: Péter L. Erdős, Tamás Róbert Mezei, István Miklós, Dániel Soltész

    Roles Writing – original draft, Writing – review & editing

    erdos.peter@renyi.mta.hu

    Current address: Reáltanoda u 13-15, Budapest, H-1053, Hungary

    Affiliation Alfréd Rényi Institute of Mathematics, Hungarian Academy of Sciences, Budapest, Hungary

  • Tamás Róbert Mezei ,

    Contributed equally to this work with: Péter L. Erdős, Tamás Róbert Mezei, István Miklós, Dániel Soltész

    Roles Writing – original draft, Writing – review & editing

    Affiliation Alfréd Rényi Institute of Mathematics, Hungarian Academy of Sciences, Budapest, Hungary

  • István Miklós ,

    Contributed equally to this work with: Péter L. Erdős, Tamás Róbert Mezei, István Miklós, Dániel Soltész

    Roles Writing – original draft, Writing – review & editing

    Affiliation Alfréd Rényi Institute of Mathematics, Hungarian Academy of Sciences, Budapest, Hungary

  • Dániel Soltész

    Contributed equally to this work with: Péter L. Erdős, Tamás Róbert Mezei, István Miklós, Dániel Soltész

    Roles Writing – original draft, Writing – review & editing

    Affiliation Alfréd Rényi Institute of Mathematics, Hungarian Academy of Sciences, Budapest, Hungary

Abstract

Since 1997 a considerable effort has been spent on the study of the swap (switch) Markov chains on graphic degree sequences. All of these results assume some kind of regularity in the corresponding degree sequences. Recently, Greenhill and Sfragara published a breakthrough paper about irregular normal and directed degree sequences for which rapid mixing of the swap Markov chain is proved. In this paper we present two groups of results. An example from the first group is the following theorem: let be a directed degree sequence on n vertices. Denote by Δ the maximum value among all in- and out-degrees and denote by the number of edges in the realization. Assume furthermore that . Then the swap Markov chain on the realizations of is rapidly mixing. This result is a slight improvement on one of the results of Greenhill and Sfragara. An example from the second group is the following: let d be a bipartite degree sequence on the vertex set UV, and let 0 < c1c2 < |U| and 0 < d1d2 < |V| be integers, where c1d(v) ≤ c2: ∀vV and d1d(u) ≤ d2: ∀uU. Furthermore assume that (c2c1 − 1)(d2d1 − 1) < max{c1(|V| − d2), d1(|U| − c2)}. Then the swap Markov chain on the realizations of d is rapidly mixing. A straightforward application of this latter result shows that when a random bipartite or directed graph is generated under the Erdős—Rényi G(n, p) model with mild assumptions on n and p then the degree sequence of the generated graph has, with high probability, a rapidly mixing swap Markov chain on its realizations.

Introduction

An important problem in network science is to algorithmically construct typical instances of networks with predefined properties, often expressed as graph measures. In particular, special attention has been devoted to sampling simple graphs (in our paper only graphs without parallel edges and loops are considered) with a given degree sequence. In 1997 Kannan, Tetali, and Vempala ([1]) proposed the use of the so-called switch Markov chain approach, which had already been used in statistics. We call this the swap Markov chain approach.

The swap operation exchanges two disjoint edges ac and bd in the realization G with ad and bc if the resulting configuration G′ is again a simple graph (we denote this operation by ac, bdad, bc). (For details see the next section). It is a well-known fact that the set of all possible realizations of a graphic degree sequence is connected under this operation. (See, for example, Petersen [2] or Havel [3] and Hakimi [4]). An analogous result applies for the swap operation defined on bipartite graphs. (See, for example, Gale [5]). Here we have to be careful, as not every edge exchange is eligible: on a bipartite graph we must ensure that vertices a and d belong to different vertex classes.

In the literature, the name switch operation is also used, however, in our approach this latter is an operation on integer matrices slightly generalizing the swap operation. (See the sections on the analysis of the swap sequences).

The situation is more complicated in case of directed degree sequences. In this case for every vertex the number of incoming edges (in-degree) and the number of outgoing edges (out-degree) is given in the degree bi-sequence. Here the ac, bdad, bc type exchange preserves the degree bi-sequence if both before and after the swap operation a and b are tails of the directed edges. However, imagine that our graph is a directed triangle while is the oppositely directed . Both graphs have the same degree bi-sequence d = ((1, 1, 1); (1, 1, 1)). It is clear that there is only one way to transform the first one into the second one: if we exchange three edges and three non-edges in . We will call this operation a triple swap and the previously defined “classical” one as a double swap. Kleitman and Wang proved in 1973 ([6]) that any two realizations of a given graphic degree bi-sequence can be transformed into each other using these two operations. The same fact was re-discovered in 2010 (see [7]).

The swap Markov chains corresponding to the most common graph models are irreducible, aperiodic, reversible (obey detailed balance), have symmetric transition matrices, and thus have uniform global stationary distributions.

In their paper [1], Kannan, Tetali and Vempala conjectured that all these Markov chains are rapidly mixing. The first rigorous proof in this topic is due to Cooper, Dyer and Greenhill for regular graphs ([8]). Now, twenty years after the KTV conjecture, we are still far, probably very far, from proving it in its full generality. However, many partial results have been proved; those which play some role in this paper are summarized in the following theorem:

Theorem 1. The swap Markov chain mixes rapidly for the following degree sequences:

  1. (A). d is a regular directed degree sequence.
  2. (B). d is a half-regular bipartite degree sequence.
  3. (C). d belongs to an almost-half-regular bipartite graph.
  4. (D). d is an almost-half-regular bipartite degree sequence, where every realization must avoid a fixed (partial) matching.
  5. (E). d is a directed degree sequence with , where M is the sum of the in-degrees (or out-degrees), and where the set of all realizations under study is irreducible under the double swap operation.

There exist similar results on (normal) degree sequences as well, but their proofs are not fully “compatible” with the proof of the above results (except case D). To our knowledge there does not exist a fully developed proof machinery which is applicable for all three cases, that is, for normal, bipartite, and directed degree sequences.

The result (A) was proved by Greenhill ([9]). In the proof it is assumed that the set of all realizations of the regular directed degree bi-sequence is irreducible under the double swap operations. (B) is due to Miklós, Erdős, and Soukup ([10]). Half-regularity means that in one class the degrees are the same (i.e., regular), while in the other class the only restrictions are those imposed by graphicality. (C) is due to Erdős, Miklós, and Toroczkai ([11]). Here almost-half-regular means that for any pair of vertices on one side we have |d(v1) − d(v2)| ≤ 1. (D) was proved by Erdős, Kiss, Miklós, and Soukup ([12]). This model will be introduced in detail and its intrinsic connection with directed graphs will be fully explained in the section starting with Lemma 12. Papers [9] and [12] are using slightly different Markov chains on regular directed degree sequences, therefore (D) does not supersede (A). Finally, (E) was proved recently by Greenhill and Sfragara ([13]). Their result has vastly extended the set of (normal and directed) degree sequences for which the rapid mixing of the Markov chain is known (e.g., power-law density-bounded normal degree sequences with parameter γ > 2.5). The papers [14] and [15] fully characterize those degree bi-sequences where the set of all realizations is irreducible under the double swap operation.

In this paper we improve on the result of Greenhill and Sfragara on directed degree sequences, and we prove the bipartite analogue of their degree sequence result for simple graphs. We achieve this by applying our technique described in [12]. In addition, we further extend the set of bipartite and directed degree sequences with rapidly mixing Markov chain processes, using a condition on minimum and maximum degrees.

Let d be a bipartite degree sequence on the underlying set UV. (So the underlying set is equal to the disjoint union of the two classes).

Theorem 2. Let d be a bipartite degree sequence on U and V as classes, let |E| be half of the sum of the degrees, and let Δ = max d. If (1) then the swap Markov chain on the realizations of d is rapidly mixing.

The following result describes another wide range of bipartite degree sequences with rapidly mixing swap Markov chain.

Theorem 3. Let 0 < c1c2 < |U| = n and 0 < d1d2 < |V| = m be integer parameters and assume that d satisfies the following properties: (2)

Furthermore, assume that (3) holds. Then the swap Markov chain on the realizations of d is rapidly mixing.

We conjecture that a very similar result should apply to the case of normal degree sequences.

Our next two results are about directed degree sequences on the n element vertex set X. The first one improves the constant in the result of Greenhill and Sfragara to . Moreover, because both double and triple swaps are allowed, the irreducibility condition can be omitted from the theorem.

Theorem 4. Let be a directed degree sequence on the n element V as its vertex set. Let be half of the sum of the degrees, and let Δ = max{max dout, max din}. If (4) then the swap Markov chain on the realizations of is rapidly mixing.

Lastly, we show that conditions similar to that of Theorem 3 guarantee rapid mixing of the swap Markov chains on a wide class of directed degree sequences.

Theorem 5. Let 0 < c1c2 < n and 0 < d1d2 < n be integer parameters and assume that graphic degree bi-sequence satisfies the following properties: (5)

Furthermore, assume that (6) holds. Then the swap Markov chain, using double and triple swap operations, is rapidly mixing on the realizations of .

The proofs of our results strongly support Greenhill’s observation about the existing arguments ([16]): “In each known case, regularity (or half-regularity) was only required for one lemma, which we will call the critical lemma. This is a counting lemma which is used to bound the maximum load of the flow (see [8, Lemma 4], [9, Lemma 5.6], [10, Lemma 6.15])”—and some newer examples—([16, Section 3], [12, Lemma 18], [13, Lemma 2.5 and Lemma 3.6]). The main task is to prove the critical lemmas (Lemma 11 and 12) for our new conditions (26). To that end, we first list the fundamental details from [12].

We would like to mention that after submitting a preprint of an earlier version of this paper on arXiv, Amanatidis and Kleer have contacted us, claiming to have proved that the degree sequences studied here are also “strongly stable” (see [17]).

The next 3 sections lay down the foundations of the swap Markov chain on bipartite and directed degree sequences. These have been originally described in our own paper [12]. For the sake of readability and convenience, we recall in more detail some results from paper [12], as they are crucial in understanding the presented approach.

Definitions and useful facts

In this section, we recall some well-known definitions and results, furthermore we define our swap Markov chains for the bipartite degree sequences and for the directed degree sequences.

Let G be a simple bipartite graph on UV, where U = {u1, …, un} and V = {v1, …, vm}, and let its bipartite degree sequence be (7)

For a ac, bdad, bc swap operation to be valid it is not enough that ac, bdE(G) and ad, bcE(G), we also need that ad can be an edge in some realization. In other words, we need that a and d are in different vertex classes. We will use the name chord for any vertex pair u, v where uv can be an edge in a realization, even if we do not know or do not care whether it is an edge or a non-edge in the current realization. We can reformulate the definition of the swap operation: it can be done if ac, bdE(G) and ad, bc are chords.

Now denote by the set of all possible realizations of the graphic bipartite degree sequence (d(U), d(V)). Consider two different realizations, G and H, of this bipartite degree sequence. As we already mentioned in the introduction, it is a well-known fact that the first realization can be transformed into the second one (and vice versa) with a sequence of swap operations. Formally, there exists a sequence of realizations G = G0, …, Gi−1, Gi = H, such that for each j = 0, …, i − 1 there exists a swap operation which transforms Gj into Gj+1. We denote the swap Markov chain as where the transition matrix P is the following:

In any realization with probability we stay in the current state (i.e., the chain is lazy) and with probability we uniformly choose two-two vertices u1, u2;v1, v2 from classes U and V, respectively. We perform the swap u1v1, u2v2u1v2, u2v1 if u1v1, u2v2E(G) and the resulting graph G′ is simple. Otherwise we do not perform a move. The swap moving from G to G′ is unique, therefore the jumping probability from G to G′ ≠ G is: (8)

The transition probabilities are time- and edge-independent and are also symmetric. The chain is lazy, therefore aperiodic. It is also reversible, and so its globally stable stationary distribution is uniform.

Now we turn our attention to the notions and notation to describe Theorems 4 and 5. Literally these theorems are about directed graphs, however, we will use the machinery developed in the paper [12], turning these statements into theorems about bipartite graphs with some restriction on which edges can be used in the realizations.

Let be a simple directed graph (parallel edges and loops are forbidden, but oppositely directed edges between two vertices are allowed) with vertex set and edge set . For every vertex xiX we associate two numbers: the in-degree and the out-degree of xi. These numbers form the directed degree bi-sequence D.

We transform the directed graph into the following bipartite representation: let be a bipartite graph where each class consists of one copy of every vertex from . The edges adjacent to a vertex ux in class U represent the out-edges from x, while the edges adjacent to a vertex vx in class V represent the in-edges to x (so a directed edge xy corresponds the edge uxvy). If a vertex has zero in- (respectively out-) degree in , then we delete the corresponding vertex from . (Actually, this representation is an old trick used by Gale [5], but one can find it already in [2]). The directed degree bi-sequence D gives rise to a bipartite degree sequence.

Here we make good use of the notion of chords: since there are no loops in our directed graph, there cannot be any (ux, vx) edge in its bipartite representation—these vertex pairs are non-chords. It is easy to see that these forbidden edges form a forbidden (partial) matching in the bipartite graph , or in more general terms, in B(D). To make it easier to remember the nature of restriction, we will denote this restricted bipartite degree sequence with .

We consider all realizations which avoid the non-chords from . Now it is easy to see that the bipartite graphs in are in one-to-one correspondence with the possible realizations of the directed degree bi-sequence.

Consider now again our example about two oppositely oriented triangles, and . Consider the bipartite representations and , and take their symmetric difference ∇. It contains exactly one alternating cycle (the edges come alternately from and ), s.t. each vertex pair of distance 3 along the cycle in ∇ forms a non-chord. Therefore, in this alternating cycle a “classical” swap cannot be performed. To address this issue, we introduce a new swap operation: we exchange all edges coming from with all edges coming from in one operation. The corresponding operation for directed graphs is exactly the triple swap operation.

In general: if the current symmetric difference ∇ contains a length-6 alternating cycle C6 such that all opposite vertex pairs form non-chords, then we allow performing the corresponding C6-swap. In this notation, the original swap should properly be called a C4-swap (for obvious reasons), but for the sake of simplicity we only write swap instead of C4-swap. By the constraints posed by the forbidden partial matching, only a subset of all bipartite swaps can be performed. These swaps together with the possible C6-swaps we just defined are called the -compatible swaps or -swaps for short.

Lemma 6 ([18], [12]). The set of all realizations is irreducible under -swaps.

We are ready to define our swap Markov chain for the restricted bipartite degree sequence .

The transition (probability) matrix P of the Markov chain is defined as follows: let the current realization be G. Then

  1. with probability 1/2 we stay in the current state, so our Markov chain is lazy;
  2. with probability 1/4 we uniformly choose two-two vertices u1, u2;v1, v2 from classes U and V respectively and perform the swap if it is possible;
  3. finally, with probability 1/4 we choose three-three vertices from U and V and check whether they form three pairs of forbidden chords. If this is the case, then we perform a C6-swap if it is possible.

The swap moving from G to G′ is unique, therefore the probability of this transformation (the jumping probability from G to G′ ≠ G) is: (9) and (10)

(These probabilities reflect the fact that G′ should be derived from G by a C4-swap or by a C6-swap). The probability of transforming G to G′ (or vice versa) is time-independent and symmetric. Therefore, P is a symmetric matrix, where the entries in the main diagonal are non-zero, but (possibly) distinct values. Our Markov chain is irreducible (by Lemma 6), and it is clearly aperiodic, since it is lazy. Therefore, as it is well-known, the Markov process is reversible with the uniform distribution as the globally stable stationary distribution.

The general properties of the swap Markov chain on bipartite degree sequences

The proofs of our theorems closely follow the proof of Theorem 10 in [12], which, in turn, is based on the proof method developed in [10]. Suppose is a directed degree sequence and d is the degree sequence of bipartite representations corresponding to the realizations of . As we saw earlier the sets of all realizations and are slightly different: while but there are realizations in that contain edges which are forbidden in the realizations in However, the following reasoning from [12] applies to both bipartite and directed degree sequences. Therefore the notation is used to refer either of the two realization sets.

Consider two realizations , and take the symmetric difference ∇ = E(XE(Y). Now for each vertex in the bipartite graph (U, V; ∇) the number of incident X-edges (= E(X)\E(Y)) and the number of the incident Y-edges are equal. Therefore ∇ can be decomposed into alternating circuits and later into alternating cycles. The way the decomposition is performed is described in detail in Section 5 of the paper [10]. Here we just summarize the highlights:

First, we decompose the symmetric difference ∇ into alternating circuits in all possible ways. In each case we get an ordered sequence W1, W2, …, Wκ of circuits. Each circuit is endorsed with a fixed cyclic order.

Now we fix one circuit decomposition. Each circuit Wi in the ordered decomposition has a unique alternating cycle decomposition: . (This unique decomposition is a quite delicate point and was discussed in detail in Section 5.2 of the paper [10]).

The ordered circuit decomposition of ∇ together with the ordered cycle decompositions of all circuits provide a well-defined ordered cycle decomposition C1, …, Cl of ∇. This decomposition does not depend on any swap operations, only on the symmetric difference of realizations X and Y.

This ordered cycle decomposition singles out l − 1 different realizations H1, …, Hl−1 from with the following property: for each j = 0, …, l − 1 we have E(HjE(Hj+1) = Cj+1 if we apply the notation H0 = X and Hl = Y. This means that

It remains to design a unique canonical path from X to Y determined by the circuit decomposition, which uses the realizations Hj as milestones along the path. In other words, for each pair Hj, Hj+1 we should design a swap sequence which turns Hj into Hj+1.

Here we slightly abuse the general naming conventions: in the original canonical path method for any pair exactly one XY path is defined. In Sinclair’s multicommodity flow method ([19]) a (usually large) set of paths is defined, equipped with a probability distribution. In our presentation we use the expression canonical path to denote these paths, differentiating the paths in and the paths in some realizations.

So, the canonical path under construction is a sequence of realizations, where each Gi can be derived from Gi−1 with exactly one swap operation, and there exists an increasing subscript subsequence 0 = n0 < n1 < n2 < ⋯ < n = m, such that we have for every 0 ≤ k.

The construction of swap sequences between consecutive milestones

Next we define the canonical path corresponding to the cycle Ci. The procedure described here is slightly different from the one in [12], since the excluded edge set in [12] is slightly larger than the one used here.

For convenience, we will use the names instead of Hi and Hi+1. These two graphs have almost the same edge set:

We refer to the elements of CiE(X) as X-edges, while the rest of the edges of Ci are Y-edges. We denote the cycle Ci by , which has 2 edges and its vertices are u1, v1, u2, v2, …, u, v. Finally, w.l.o.g. we may assume that the chord u1v1 is a Y-edge (and, of course, vu1 is an X-edge).

We will build our canonical path from G towards G′. At any particular step, the last constructed realization is denoted by Z. (At the beginning of the process we have Z = G). We are looking for the next realization, denoted by Z′. We will control the canonical path system with an auxiliary structure, originally introduced by Kannan, Tetali and Vempala in [1]:

The matrix MG denotes the adjacency matrix of the bipartite realization G where the rows and columns are indexed by the vertices of U and V, respectively, with the slight alteration that a position corresponding to a forbidden edge (a non-chord) is indicated with a *. There is a natural correspondence between the entries of matrices on U × V and the chords of G. Our auxiliary structure is the matrix

Summation does not change the positions with a *. Since the non-* entries of a bipartite adjacency matrix are 0 or 1, the possible entries of are *, −1, 0, 1, 2. An entry is * if it corresponds to a forbidden edge, and it is −1 if the edge is missing from both X and Y but it exists in Z. It is 2 if the edge is missing from Z but exists in both X and Y. It is 1 if the edge exists in all three graphs (X, Y, Z) or it is there only in one of X and Y but not in Z. Finally, it is 0 if the edge is missing from all three graphs, or the edge exists in exactly one of X and Y and in Z. (Therefore, if an edge exists in exactly one of X and Y then the corresponding chord in is always 0 or 1). It is easy to see that the row and column sums of are the same as the row and column sums in MX (or MY, or MZ).

Now we are ready to determine the -swap sequence between G and G′ and this is the point where realizations from and start behave slightly differently. From now on we will work with realizations from but we will point out those turning points where there are real differences. The first such difference is that in the case of a directed realization there may be a vertex vi along the cycle C s.t. u1vi is a non-chord, while for a simple bipartite realization this does not happen.

We determine the -swap sequence between G and G′ from through an iterative algorithm. In the first iteration we check, step by step, the positions (u1, v2), (u1, v3), …, (u1, v) and take the smallest j for which (u1, vi) is an actual edge in G. Since (u1, v) is an edge in G, such an i always exists. A typical configuration is shown in Fig 1.

We call the chord u1vi the start-chord of the current sub-process and u1v1 is the end-chord. We will sweep the alternating chords along the cycle. The vertex u1 will be the cornerstone of this operation. This process works from the start-chord u1vi, viui (non-edge), uivi−1 (an edge) toward the end-chord v1u1 (non-edge)—switching their status in twos and fours. We check positions u1vi−1, u1vi−2 (all are non-edges) and choose the first chord among them, which we call the current-chord. (Since u1 belongs to at most one non-chord we never have to check more than two positions to find a chord).

Case 1: As we just explained the typical situation is that the current-chord is the “next” one, so when we start this is typically u1vi−1. Assume that this is a chord. Then we can proceed with the swap operation vi−1ui, viu1u1vi−1, uivi. We just produced the first “new” realization in our sequence, this is . For the next swap operation this will be our new current realization. This operation will be called a single-step.

In a realization Z we call a chord bad if its state in Z (being edge or non-edge) is different from its state in G, or equivalently, different from its state in G′, since G and G′ differ only on the chords along the cycle (recall that in our nomenclature a chord is a pair of vertices which may form an edge). After the previous swap, we have two bad chords in , namely u1vi−1 and viu1.

Consider now the auxiliary matrix (here ). As we saw earlier, any chord not contained in has the same state in X, Y and Z. Accordingly, the corresponding matrix value is 0 or 1 in . We call a position bad in if this value is −1 or 2. (A bad position in always corresponds to a bad chord). Since we switch the start-chord into a non-edge, it may become 2 in (in case the start-chord is an edge in both X and Y). Furthermore, the current-chord turned into an edge. If it is a non-edge in both X and Y then its corresponding value in becomes −1. After this step, we have at most two bad positions in the matrix, at most one with 2-value and at most one with −1-value. Finishing our swap operation, the previous current-chord becomes the new start-chord, so it is the edge u1, vi−1.

Case 2: If the position below the start-chord (this is now u1vi−2) is a non-chord, then we cannot produce the previous swap. Then the non-edge u1vi−3 is the current-chord. For sake of simplicity we assume that i − 3 = 2 so we are in Fig 1. (That is, i − 1 = 4). Consider now the alternating C6 cycle: u1, v2, u3, v3, u4, v4. It has altogether three vertex pairs which may be used to perform an -swap operation. We know already that u1v3 is a non-chord. If neither v2u4 nor u3v4 are chords, then this alternating cycle provides an -compatible circular C6-swap. Again, we found the valid swap v2u3, v3u4, v4u1u1v2, u3v3, u4v4. After that we again have 2 bad chords, namely u1v2 and v4u1, and together we have at most two bad positions in the new , with at most one 2-value and at most one −1-value.

Finally, if one position, say v2u4, is a chord then we can process this C6 with two swap operations. If this chord is, say, an actual edge, then we swap v2u4, v4u1u1v2, u4v4. After this we can take care of the v2, u3, v3, u4 cycle. Along this sequence we never create more than 3 bad chords: the first swap makes chords v2u4, v4u1, and u1v2 bad ones, and the second cures v2u4 but does not touch u1v2 and v4u1. So, along this swap sequence we have 3 bad chords, and in the end we have only 2. On the other hand, if the chord v2u4 is not an edge, then we can swap v2u3, v3u4u3v3, u4v2, creating one bad edge, then by swapping the four cycle u1, v2, u4, v4 we cure v2u4 but we switch u1v2 and v4u1 into bad chords. We finished our double-step along the cycle.

In a double-step we create at most three bad chords. When the first swap uses three chords along the cycle then we may have at most one bad chord (with -value 0 or −1) and then the next swap switches back the chord into its original status, and makes two new bad chords (with at most one 2-value and one −1-value). When the first swap uses only one chord from the cycle, then it creates three bad chords (changing two chords into non-edges and one into an edge), therefore it may create at most two 2-values and one −1-value. After the second swap, there will be only two bad chords, with at most one 2-value, and at most one −1-value.

When only the third position corresponds to a chord in our C6 then after the first swap we may have two −1-values and one 2-value. However, after the next swap we will have at most one of both types.

After finishing our single- or double-step, the previous current-chord becomes the new start-chord and we look for the new current-chord. Then we repeat our procedure. There is one important point to be mentioned: along the step, the start-chord switches back into its original status, so it will not be a bad chord anymore. So even if we face a double-step the number of bad chords will never be larger than three (together with the chord viu1 which is still in the wrong state, so it is a bad chord), and we always have at most two 2-values and at most one −1-value in .

When our current-chord becomes v1u2 then the last step will switch back the last start-chord into its correct state, and the last current-chord cannot be in a bad state. So, when we finish our sweep from u1vi to v1u1, we will only have one bad chord (with a possible 2-value in ). This concludes the first iteration of our algorithm.

For the next iteration, we seek a new start-chord between viu1 and vu1 and the chord viu1 becomes the new end-chord. We repeat our sweeping procedure until there are no more unprocessed chords. Upon completion, we find a realization sequence from G to G′. If in the first sweep we had a double-step, then such a step will never occur later, so altogether with the (new) bad end-chord we never have more than three bad chords (corresponding to at most two 2-values and at most one −1-value).

However, if the double-step occurs sometime later, for example in the second sweep, then we face to the following situation: if we perform a circular C6-swap, then all together we have at most two 2-values and one −1-value. Thus, we may assume that there is a chord suitable for a swap in our C6. If this chord is a non-edge, then the swap around it produces one bad chord, and at most one bad position in . The only remaining case is when that chord is an edge. After the first swap there will be four bad chords, and there may be at most three 2-values and at most one −1 value. However, after the next swap (finishing the double step) we annihilate one of the 2-values, and after that swap there are at most two 2-values and at most one −1-value along the entire swap sequence. When we finish our second sweep, then chord viu1 will be switched back into its original state and it will not be bad anymore.

Iteratively applying the algorithm, the entire cycle is processed after at most sweep sequences. This finishes the construction of the required -swap sequence (and the required realization sequence).

Meanwhile we also proved the following important observations:

Lemma 7. For the Markov chain , we always have at most two 2-values and at most one −1-value in our auxiliary matrix along our procedure.

Lemma 8. For the Markov chain , each auxiliary matrix occurring along our procedure is at most swap-distance one from a matrix with at most three bad positions: with at most two 2-values and with at most one −1-value in the same column.

Now we are ready to describe the following, highly technical theorem from [10] which is required to show that the defined swap Markov-chains are rapidly mixing.

Theorem 9 (Section 4 in [10]). If the designed canonical path system satisfies the three conditions below, then the MCMC process is rapidly mixing. The conditions are:

  1. (Θ). For each i < l the constructed path satisfies m′ ≤ c ⋅ |Ci+1| for a suitable constant c.
  2. (Ω). j there exists a realization s.t. ≤ Ω2, where MG is the bipartite adjacency matrix of G, denotes the Hamming distance, and Ω2 is a small constant.
  3. (Ξ). For each vertex in the path being traversed the following three objects together uniquely determine the realizations X, Y and the path itself:
    • The auxiliary matrix ,
    • the symmetric difference ∇ = E(X)△E(Y),
    • and a polynomial size parameter set .

The meaning of condition (Ξ) is that these structures can be used to control certain features of the canonical path system; namely, their numbers give a bound on the number of canonical paths between any realization pair X, Y which traverses .

Condition (Ω) implies that the space of auxiliary matrices is larger than by a multiplicative factor of at most .

To use this theorem we have to show that the defined swap sequences between Hi and Hi+1, using the cornerstone u1 chosen in (Φ), satisfy conditions (Θ), (Ω), and (Ξ) of Theorem 9. The first one is easy to see, since we can process any cycle of length 2 in − 1 swaps. Therefore, we may choose c = 1 in (Θ). Condition (Ξ) holds for the same reason as it holds in paper [12]. Thus only condition (Ω) remains to be checked.

Until this very moment the choice of the cornerstone vertex u1 was arbitrary. Before we turn to the analysis of the swap sequences, we choose which particular vertex of the cycle will serve as its cornerstone.

Let the submatrix A contain those positions from any adjacency or any auxiliary matrix which correspond to the positions uivj defined by the vertices from . Furthermore, denote by A[Z] the submatrix of spanned by the vertices of . Then:

  1. (Φ). Let u1 be a vertex which has the lowest row sum in the submatrix A[Hi] = A[G].

The analysis of the swap sequences between milestones in

In this section, we will analyze the undirected case. We introduce the new switch operation on integer matrices: we fix the four corners of a submatrix, and we add 1 to two corners in a diagonal, and add −1 to the corners on the other diagonal. This operation clearly does not change the column and row sums of the matrix. (We will use this operation on adjacency matrices or on auxiliary matrices of realizations). For example, if we consider the adjacency matrix MG of a realization of d and make a valid swap operation, then this is equivalent to a switch in this matrix. The next statement is trivial but very useful:

Claim 10. If two matrices have switch-distance 1, then their Hamming distance is 4. Consequently, if the switch-distance is c then the Hamming distance is bounded by 4c.

The next lemma shows that property (Ω) holds for the auxiliary matrices along the swap sequence from G toward G′ for degree sequences corresponding to Theorem 3 and Theorem 2.

Lemma 11. For any realization Z along the constructed swap sequence from G to Gin there exists a realization K = K(Z) such that

Proof. The swap sequence transforming G to G′ only touches chords induced by . Therefore, the row and column sums in A[Z] are the same as that of A[G], so the cornerstone has the minimum row sum in A[Z] as well.

Any entries of 2’s and −1’s in are in the row of u1, moreover, they are contained in A[Z]. Suppose . The sum of entries of A[Z] in the column vj is , therefore such that . Since the sum of the entries in row u1 is minimum among the rows of A[Z], there must such that . Obviously, , so . The switch operation u1vj, ukvlu1vl, ukvj (decrease the entries of the matrix by one at positions u1vj and ukvl, and increase the entries at positions u1vl and ukvj by one) in (and in A[Z]) eliminates the entry of 2 at u1vj, and creates an entry of 1 at both u1vj and ukvj. In the column vl three scenarios are possible: either the entry −1 and a 0 exchange their positions, or a 0 and a 1 exchange their positions; finally, it is also possible that the −1 and a 1 both become 0.

By repeating the previous argument, we may eliminate one more entry 2, if necessary, from A[Z]. (Recall that at the beginning we had at most two 2s in ). Although it is possible that the entry −1 is not in the u1-row anymore, it does not cause any hardship. Let be the matrix we get after performing these at most two switches that eliminate the 2’s. Each entry of is a 0 or a 1, except at most one −1 entry.

The proof now diverges into two cases corresponding to Theorem 2 and Theorem 3, respectively.

Case of Theorem 2: Sequence d satisfies Eq 1

Suppose that . Since both u0 and v0 are at least 1, there ∃v1V and ∃u1U such that . If , there is a switch which transforms into a realization of d. Otherwise, observe that

The number of entries of 1 in that are incident on the same row as u0 or u1, on the same column as v0 or v1, or in the above counted set is at most

The last inequality follows from Equality 1. Therefore there exists u2U, v2V such that {u0, v0, u1, v1, u2, v2} is a set of 6 vertices where and . Switching along the six positions determined by the cyclically successive pairs, we get an adjacency matrix corresponding to a realization of d.

Case of Theorem 3: Sequence d satisfies Eqs 2 and 3

From now on we will consider the entire matrix and not only A. Suppose that . Let and . If ∃(u, v) ∈ U′ × V′ such that , then switch operation u0v, uv0u0v0, uv transforms into an adjacency matrix.

Suppose from now on, that ∀(u, v)∈U′ × V′ we have . Let

Clearly, U″ ∩ U′ = V″ ∩ V′ = ∅. Suppose there ∃(u2, v2) ∈ U″ × V″ such that . By definition, there ∃(u1, v1) ∈ U′ × V′ such that and . Clearly, applying first the switch operation u1, u2 and v1, v2, and then the operation u0, u1 and v0, v1 transforms into an adjacency matrix.

Lastly, suppose that ∀(u, v)∈U″ × V″ we have . This case is shown in Fig 2.

thumbnail
Fig 2. is shown; each of the entries in the regions marked with 0/1 may be 0 or 1.

https://doi.org/10.1371/journal.pone.0201995.g002

In addition to the zeroes in U″ × V″, for any uU″. We have (11)

The right-hand side can be estimated from below as follows. Since the row and column sums of are the same as that of MX, we have

For any vV′ and uU\U″, we have . Also, for any uU′ and vV\V″, we have . Therefore

Clearly, if c2c1 + 1 or d2d1 + 1 (i.e., G is almost half-regular), we already have a contradiction. We also have (12)

Combining Eqs 11 and 12,

Further simplifying:

Since we may suppose that c2c1 + 2, we can substitute |V″| ≥ md2 and |U″| ≤ nc1 − 2 into the inequality, yielding

Symmetrically, a similar derivation gives

The last two inequalities clearly contradict the assumptions of this claim.

In summary, in every case there exist at most 4 switches which transform into a 0 − 1 matrix, which is a matrix with suitable row- and column sums, therefore it is the adjacency matrix of a realization K of the degree sequence d.

The analysis of the swap sequences between milestones in

Now we turn to discussing the directed case. As in the previous section, condition (Ω) is the only remaining assumption of Theorem 9 which does not immediately follow from the construction of swap sequences between consecutive milestones.

Lemma 12. For any realization Z along the constructed swap sequence from G to Gthere exists a realization K = K(Z) such that

Proof. As described by Lemma 8, it is possible that realization Z is derived by an -swap which is a first C4-swap to resolve an alternating C6 cycle along the sweep. It may introduce an extra 2-value and/or a −1-value into the auxiliary structure. But Lemma 8 also shows that the next C4 swap will revert these extra bad positions. Therefore let ZS denote the realization Z itself if this extra swap is not needed, or the new realization if it is needed. Then has at most two entries of 2 and at most one entry of −1. Now we have to show that there is a realization K such that

As before we will use the shorthand

The swap sequence transforming the bipartite representation G to G′ (also, the previous extra swap) only touches chords induced by . Therefore, the row and column sums in A[Z] are the same as that of A[G], so the cornerstone has the minimum row sum in A[Z] as well.

Any entries of 2’s and −1’s in are in the row of u1, moreover, they are contained in A[Z]. Suppose . The column of vj in A[Z] contains at least one zero, therefore there exist two vertices such that and , even if there is a * in the column of vj. We have two cases.

  1. There such that : obviously, , so . The switch operation u1vj, ukvlu1vl, ukvj (decrease the entries of the matrix by one at positions u1vj and ukvl, and increase the entries at positions u1vl and ukvj by one) in (and in A[Z]) eliminates the entry of 2 at u1vj, and creates an entry of 1 at both u1vj and ukvj. In the column vl three scenarios are possible: either the entry −1 and a 0 exchange their positions, or a 0 and a 1 exchange their positions; finally, it is also possible that the −1 and a 1 both become 0.
  2. If for all either or or holds: since the sum of the entries in row u1 is minimum among the rows of A[Z], this is only possible if there exist vl, vlVV(C) such that , , , , and for we have . This is shown on Fig 3.

If the second case applies, the first case must hold if we replace k by k′; if not, column vl would contain two *, a contradiction.

By repeating the previous argument, we may eliminate one more entry 2, if necessary, from A[Z] (and ). (Recall that at the beginning we had at most two 2’s in ). Although it is possible that the entry −1 is not in the u1-row anymore, it does not cause any hardship. Let be the matrix we get after performing these at most two switches that eliminate the 2’s. Each entry of is a 0 or a 1, except at most one −1 entry.

The proof now diverges into two cases corresponding to Theorem 4 and Theorem 5, respectively.

Case of Theorem 4: Sequence d satisfies Eq 4

From now on we will consider the entire matrix and not only A. Suppose that . The degrees of u0 and v0 are at least one, and so there are at least two entries of 1’s in the row and column of u0 and v0, respectively. Therefore there exists u1U and v1V such that they are not copies of the same original vertex and . If , there is a switch which transforms into a bipartite realization of . Otherwise , so observe that

The number of entries of 1 in that are incident on either the rows of u0 or u1, on the column of v0 or v1, or on a position corresponding to an element of the above counted set is at most

This implies that there exist u2U and v2V such that , , and . Because Equality 4 claims is strictly larger than the right hand side by at least 2Δ, we may also assume that , and . Therefore there exists u2U, v2V such that {u0, v0, u1, v1, u2, v2} is a set of 6 vertices where and . Switching along the six positions determined by the cyclically successive pairs, we get an adjacency matrix corresponding to a realization of d.

Case of Theorem 5: Sequence d satisfies Eqs 5 and 6

From now on we will consider the entire matrix and not only A. Suppose that . Let and . If ∃(u, v) ∈ U′ × V′ such that , then switch operation u0v, uv0u0v0, uv transforms into an adjacency matrix.

Suppose from now on, that ∀(u, v)∈U′ × V′ we have . Let

Clearly, U″ ∩ U′ = V″ ∩ V′ = ∅. Suppose contains more than |U″| entries of 1’s. A simple pigeon-hole principle argument implies that there ∃(u2, v2) ∈ U″ × V″ and ∃(u1, v1) ∈ U′ × V′ such that , , , and . Clearly, applying first the switch operation u1, u2 and v1, v2, and then the operation u0, u1 and v0, v1 transforms into an adjacency matrix.

Lastly, suppose that contains at most |U″| entries of 1’s. We have since contains exactly |U″| of *. The right-hand side can be estimated from below as follows. Since the row and column sums of are the same as that of MX, we have

Also,

Clearly, if c2 = c1 or d2 = d1 (i.e., G is half-regular), we already have a contradiction. Each column in V \ V″ may contain at most one *, therefore

Moreover, for any uU″. Combining these inequalities, we get

A few lines of computation similar to those in the previous section give

Symmetrically, we also have

The last two inequalities clearly contradict the assumptions of this claim.

In summary, in every case there exist at most 4 switches which transform into a 0 − 1 matrix, which is a matrix with suitable row- and column sums, therefore it is the adjacency matrix of a realization K of the degree sequence .

Erdős-Rényi random graphs

The following statement is a straightforward, easy consequence of Theorem 3.

Corollary 13. If G is a bipartite Erdős-Rényi random graph on vertex classes of size n and m, with edge probability p(n, m), such that then the swap Markov chain is rapidly mixing on the bipartite degree sequence of G with probability at least . (The roles of m and n can be interchanged).

Proof. Let p = p(n, m), and . Also, let c1 = pnεc, c2 = pn+ εc, d1 = pmεd, d2 = pm+ εd. Eq 3 holds, we only need to check that

Moreover, by Hoeffding’s inequality, which proves the statement.

For completeness sake, we also state the respective theorem for directed random graphs.

Corollary 14. If is a directed Erdős-Rényi random graph on n vertices with out-edge probability p(n), such that then the swap Markov chain is rapidly mixing on the directed degree sequence of with probability at least .

Comparing the applicability of the Theorems

Next we discuss the applicability of our results. Theorem 2 (and the result of Greenhill and Sfragara) is not applicable, when the average degree . In case of Theorem 3 there is no such region: for example if all degrees are between and , then inequality for the average degree is possible. It is also easy to see that Theorem 3 applies to all half-regular (consequently for all regular) bipartite degree sequences.

However, if the degrees are evenly distributed between 1 and , then Theorem 2 applies while Theorem 3 does not. Therefore these results have different validity regions and they are independent from each other.

Generally speaking Theorem 2 and the Greenhill and Sfragara results are better applicable to degree sequences developed under some scale-free random dynamics (with γ > 2.5), while Theorem 3 is better fitted to degree sequences developed under the Erdős—Rényi model.

For directed degree sequences similar analysis applies.

Acknowledgments

The authors of this paper were supported in part by the National Research, Development and Innovation Office—NKFIH grant K 116769 and KH 126853. IM was supported in part by the National Research, Development and Innovation Office—NKFIH grant SNN 116095. DS was supported in part by the National Research, Development and Innovation Office—NKFIH grants K 108947 and K 120706. A preliminary version of this paper can be found as arXiv 1712.01709v2.

References

  1. 1. Kannan R., Tetali P., Vempala S.: Simple Markov-chain algorithms for generating bipartite graphs and tournaments, Extended abstract, in Proc. SODA’97 (1997), 193–200. ISBN:0-89871-390-0
  2. 2. Petersen J.: Die Theorie der regularen Graphen, Acta Math. 15 (1891), 193–220.
  3. 3. Havel V.: A remark on the existence of finite graphs. (in Czech), Časopis Pěst. Mat. 80 (1955), 477–480.
  4. 4. Hakimi S.L.: On the realizability of a set of integers as degrees of the vertices of a simple graph. J. SIAM Appl. Math. 10 (1962), 496–506.
  5. 5. Gale D.: A theorem on flows in networks, Pacific J. Math. 7(2) (1957), 1073–1082.
  6. 6. Kleitman D.J., Wang D.L.: Algorithms for constructing graphs and digraphs with given valences and factors, Discrete Math. 6 (1973), 79–88.
  7. 7. Erdős P.L., Miklós I., Toroczkai Z.: A simple Havel-Hakimi type algorithm to realize graphical degree sequences of directed graphs, Elec. J. Combinatorics 17(1) (2010), R66 (10 pp)
  8. 8. Cooper C., Dyer M., Greenhill C.: Sampling regular graphs and a peer-to-peer network, Comb. Prob. Comp. 16(4) (2007), 557–593.
  9. 9. Greenhill C.: A polynomial bound on the mixing time of a Markov chain for sampling regular directed graphs, Elec. J. Combinatorics 18 (2011), #P234.
  10. 10. Miklós I., Erdős P.L., Soukup L.: Towards random uniform sampling of bipartite graphs with given degree sequence, Electronic J. Combinatorics 20(1) (2013), #P16, 1–49.
  11. 11. Erdős P.L., Miklós I., Toroczkai Z.: A decomposition based proof for fast mixing of a Markov chain over balanced realizations of a joint degree matrix, SIAM J. Disc. Math. 29(1) (2015), pp. 481–499.
  12. 12. Erdős P.L., Kiss Z.S., Miklós I., Soukup L.: Approximate Counting of Graphical Realizations, PLOS ONE (2015), pp 20. #e0131300.
  13. 13. Greenhill C., Sfragara M.: The switch Markov chain for sampling irregular graphs, Theoretical Comp. Sci 719 (2018), 1–20.
  14. 14. Berger A., Müller–Hannemann M.: Uniform sampling of digraphs with a fixed degree sequence, in Graph Theoretic Concepts in Computer Science, LNCS 6410 Springer, Berlin, (2010), 220–231.
  15. 15. LaMar, M.D.: Directed 3-Cycle Anchored Digraphs And Their Application In The Uniform Sampling Of Realizations From A Fixed Degree Sequence, in ACM & IEEE & SCS Proc. of 2011 Winter Simulation Conference (Eds. S. Jain, R.R. Creasey et. al). (2011), 1–12.
  16. 16. Greenhill, C.: The switch Markov chain for sampling irregular graphs, in Proc. 26th ACM-SIAM Symposium on Discrete Algorithms, New York-Philadelphia (2015), pp. 1564–1572.
  17. 17. Amanatidis, G., Kleer, P.: Rapid Mixing of the Switch Markov Chain for Strongly Stable Degree Sequences, arXiv preprint 1803.01338 (2018), 1–21.
  18. 18. Erdős P.L., Király Z., Miklós I.: On graphical degree sequences and realizations, Combinatorics, Probability and Computing (2013), 1–22.
  19. 19. Sinclair A.: Improved bounds for mixing rates of Markov chains and multicommodity flow, Combin. Probab. Comput. 1 (1992), 351–370.