(Dis)assortative Partitions on Random Regular Graphs

We study the problem of assortative and disassortative partitions on random $d$-regular graphs. Nodes in the graph are partitioned into two non-empty groups. In the assortative partition every node requires at least $H$ of their neighbors to be in their own group. In the disassortative partition they require less than $H$ neighbors to be in their own group. Using the cavity method based on analysis of the Belief Propagation algorithm we establish for which combinations of parameters $(d,H)$ these partitions exist with high probability and for which they do not. For $H>\lceil \frac{d}{2} \rceil $ we establish that the structure of solutions to the assortative partition problems corresponds to the so-called frozen-1RSB. This entails a conjecture of algorithmic hardness of finding these partitions efficiently. For $H \le \lceil \frac{d}{2} \rceil $ we argue that the assortative partition problem is algorithmically easy on average for all $d$. Further we provide arguments about asymptotic equivalence between the assortative partition problem and the disassortative one, going trough a close relation to the problem of single-spin-flip-stable states in spin glasses. In the context of spin glasses, our results on algorithmic hardness imply a conjecture that gapped single spin flip stable states are hard to find which may be a universal reason behind the observation that physical dynamics in glassy systems display convergence to marginal stability.


Introduction
Let G(V, E) be a simple undirected graph with n nodes i = {1, ..., n} and edges (i, j) ∈ E ⊆ V 2 . We consider a partition of the nodes V into two disjoint non-empty sets V − , V + . Let the magnetization of the partition be m = |V+|−|V−| |V | ∈ [−1, +1] and a bisection be a partition with m = 0. For the parameter H we call i ∈ V an assortative node, if at least H of its neighbors are in i's own group. Conversely, if less than H neighbors are in its own group, the node i is called disassortative.
In this paper we study partitions under which the nodes in V are either all assortative or all disassortative with respect to a given H, as exemplified in Figure 1. We call these two complementary problems H-assortative partition and H-disassortative partition. When as an additional constraint the magnetization is fixed to some value m we consider it as (H, m)-(dis)assortative partition. For the special case of balanced groups with a fixed m = 0 we simply refer to it as H-(dis)assortative bipartition. An early illustrative example of the assortative partition problem was posed in the context of game theory. A group of people with alliance relations is divided into two subgroups where everyone wants to have more allies in its own group than in the other [KHH04]. If every person has exactly d ally relations, a d 2 -assortative partition of an ally graph is a Nash Equilibrium of the game. In this case, every person has at least half of their allies in their own group and consequently nobody has an incentive to change their group unilaterally.
Similar constrained partition problems have emerged in different practical contexts, for example in social choice, community detection or process control (see [BTV10] for a survey). This broad variety of origins created an abundance of terminology in the field. Therefore, results on assortative partitions can be found under the name of cohesive subsets [Mor00], satisfactory partitions [BTV10], friendly partitions [Fer+21], generalized matching cuts [GS21] and local minimum bisection [AMS21]. Likewise, disassortative partitions relate to co-satisfactory partitions [BTV10], unfriendly partitions [Fer+21] and local maximum cut [AMS21].
In statistical physics, the problem of d 2 -assortative partitions has been investigated due to its relation to single-spin flip stable states in the ferromagnetic Ising model. The d 2 -disassortative partitions correspond to single-spin flip stable states in the anti-ferromagnetic Ising model. The spin glass version of the single-spin flip stable states was also widely considered [BM81]. The assortative partition problem also has analogies with the stable states in Hopfield networks [Hop82].
Many canonical combinatorial problems, such as graph coloring or independent sets, have been studied on random graphs and this line of work often unveiled an intriguing geometric and algorithmic behavior. In particular, analysing the typical cases of these problems is interesting to reach a better understanding of heuristic algorithms. To this end, it is customary to analyse ensembles of random graphs such as Erdős-Rényi or random d-regular graphs. The latter are drawn uniformly from the set of graphs with size n where every node has degree d and dn is even. In the limit where n → ∞ and d is a constant these graphs are locally tree-like, which is a key property underlying the applicability of a range of probabilistic methods [MM09]. Understanding the structure of the solution space of (dis)assortative partitions on random d-regular graphs, associated algorithmic consequences, and the relation between the two problems is the focus of this work.

Related Work
Existence of (dis)assortative partitions and computational complexity There is a plethora of work that considers the algorithmic complexity of finding (dis)assortative (bi)partitions or even just deciding whether they exist on general non-random graphs. We present an overview of these results in Figure 2.
For general, i.e. non-random, d-regular graphs and small H ≤ d 2 − 1 the question whether assortative partitions always exist was answered positively by [Sti96]: They can also be found in polynomial time, albeit the same does not hold true for a given fixed magnetization [BTV03]. Naturally, this result directly transfers to random d-regular graphs.
For larger H = d 2 a long standing unresolved conjecture states that such a H-assortative partition always exists on d-regular graphs of size at least n d [BL13]. For small d < 7 the conjecture was proven by [SD02;BL13], except for d = 5. Moreover, it was later shown that in the asymptotic limit of d, for even-degree regular graphs there is always a d 2 -assortative partition [LL17]. In fact, for larger d 2 +1 ≤ H ≤ d−1 deciding whether a H-assortative partition exists on d-regular graphs was shown to be NP-hard when d is even by [GS21].
On the other hand, when in addition to H = d 2 the magnetization is fixed to some m it can be shown that such a partition does not exist on infinitely many d-regular graphs. For m = 0 and d = 3 a simple counterexample is the wheel graph, a cycle graph where all nodes are additionally connected to their diametrically opposed neighbor. In this graph a d 2 -assortative bipartition does not exist for arbitrarily large n [BTV10]. When no satisfying partition exists for m = 0 and H = d 2 , there are no polynomial time approximation schemes for the minimum number of disassortative nodes of a balanced partition or the maximum unbalance of a assortative partition [BTV10].
Another relevant line of work on the existence of assortative partitions examines which subgraphs must be forbidden in order for an d 2 -assortative partition to exist [Sti96; GK00; MY19; LX21]. For example, a sufficient criterion is for cycles of length 4 to be excluded from the graph [MY19]. Since random regular graphs are locally tree-like and contain few short cycles [MWW04], (1) [Sti96] [BTV03] [GS21] * [BTV03] Figure 2: Overview of complexity results on assortative partitions. We compare the complexity of deciding whether an H-assortative partition exists for different ensembles of general and random graphs. For graphs with differing degrees per node, the degree d should be interpreted as a function of each nodes degree d(v). Therefore, H also depends on a specific node. The "?" marks that to our knowledge there are no results on these sub-cases known in the literature.
(1) refers to a long-standing conjecture that only finitely many regular graphs exist for which there are no d 2 -assortative partitions. The * marks the results of this work.
this result already indicates what we will find later, that most random graphs have d/2 -partitions that are easy to find. For example, there exists an algorithm for d 2 -assortative partitions on dense ER graphs that provably finds them with high probability [Fer+21]. This algorithm uses a greedy node swapping operation to iteratively approach a solution. Similar algorithms using node flipping or swapping operations were analysed in the framework of the complexity class of polynomial local search (PLS) [CZ04]. This class includes problems for which one local step in the solution space, i.e. finding direct neighbors and computing their costs, takes polynomial time in the worst case. Examples from this class are local Maximum Cut [Ang+17] and finding stable configurations in Hopfield networks [SY91] which relate closely to weighted versions of our problem as discussed in the remainder of this section. Negative results about local search algorithms were proven using the so-called overlap gap property in a closely related class of max-cut problems on hyper-graphs [Che+19a; Gam21], as we will see our negative algorithmic results are closely linked to this property as well.
Relation to local maximum cut, local minimum bisection and spin glasses The (maximum) minimum bisection is the bipartition of G which (maximizes) minimizes the number of crossing edges, i.e. edges with endpoints in both V − and V + . These classical problems are naturally related to the (anti-)ferromagnetic Ising model at zero magnetization, since the ground state energy of its Hamiltonian exactly gives the size of the optimal bisection.
Locally maximal and minimal bisections were studied in [Ang+17;Che+19b]. In fact, any assortative bipartition for H = d/2 is a locally minimal solution to the minimal bisection problem, as no node can be flipped to decrease the bisection size. Analogously, a disassortative (bi)partition for H = d/2 − 1 is a locally maximal solution to the maximum (bisection)cut problem. In fact, one can obtain a lower bound on the size of the maximum cut on sparse graphs using the assortative/disassortative properties of the global optimum [GL18].
(Dis)assortative partitions also correspond to single-spin flip stable state in the (anti-)ferromagnetic Ising model. Using replica computations, the number of these states was computed for spin glasses on fully connected graphs by [BM81]. Their result is immediately meaningful for the solution space of the d/2 -assortative bipartitions and in this work we recover their results by means of a large d expansion of the belief propagation equations as we will see in Section 7.
A striking relation between the ground state energies of the maximum and minimum bisection, i.e. the number of crossing edges of the globally optimal solutions, was discovered for on random d-regular graphs. For random d-regular graphs and large n, the cavity method from statistical physics predicts that the sizes of the minimum and maximum bisection are closely related with high probability [ZB10]. The same was predicted for the size of the maximum bisection and maximum cut, i.e. the ground state energy of the anti-ferromagnetic Ising model at arbitrary magnetization. This conjecture was proven to be true asymptotically in d in the first order and with high probability by [DMS17]. In this work, we make a similar connection between the entropy of the locally extremal solutions of both problems.

Hopfield Networks
The existence of d 2 -assortative partitions has sometimes been related to the stored patterns in a Hopfield network [BTV10]. A Hopfield network is a model of associative memory [Hop82]. Given an input pattern, among a collection of stored patterns, it retrieves the most similar one. Technically, this network is a graph with n nodes, where n is the dimension of one such binary pattern. By initializing the nodes with the input's values, one can retrieve the most similar pattern according to an asynchronous local update rule: A node i updates its own value to be in accordance with the majority of its neighbors values, weighted according to the edges connecting them to i. As long as the number of patterns does not exceed the capacity of the network, one can ensure that stored patterns are both stable under this local update rule and an attractors of sufficiently associated inputs. Therefore, a d 2 -assortative partition resembles a stable state in a Hopfield network.
Note, however, that an absolutely key element of Hopfield networks is a very specific choice of the edge weights that are related to the patterns we aim to store, most commonly given by the Hebbian learning rule. In the assortative partition problem there is no such special choice of the interaction weights and thus one should not really think of the assortative partitions as the stored patterns in a Hopfield network.
Another relation between assortative-partitions and Hopfield networks has been discussed in [TA88]. The authors there computed the number of maximally stable states, i.e. states having the largest possible local magnetic field. Translated to our notation they concluded that stable states exist up to H = d 2 + 0.17566 √ d, which exactly corresponds to our results at large d. They subsequently argue that the more stable the states are, the larger their basin of attraction and the more likely they should be discovered by local dynamics (such as the Hopfield flipping rule described above). As we will see this line of reasoning is flawed and the exact opposite is true, the larger the H the harder it is computationally to find these more stable assortative partitions. This is another reason why the assortative partitions on a graph with random interactions are actually of limited interested in the context of the Hopfield networks.

Main results
We find several new results about both the assortative and disassortative partitions on large random d-regular graphs. We describe here those that we find the most remarkable and leave the full account of our results to the body of the paper. Table 1 summarizes our results on the existence of nonempty assortative bi partitions in random d-regular graphs. The numbers given in the table are the largest H for which these H-assortative balanced partitions exist with high probability. The middle (resp. left) column then gives the range of odd (resp. even) degrees d for which the corresponding H is the largest one. Moreover, we find that when non-empty assortative partitions exist most of them have m = 0 in the limit n → ∞.

Existence of assortative partitions
Therefore we conjecture that the existence results for the bipartitions are valid for non-empty general partitions as well.
We establish these results using non-rigorous tools from statistical physics. Their rigorous proofs would be an interesting topic for future work. We also conclude and conjecture that the entropy (logarithm of the number) of those partitions in the n → ∞ limit (or regime) is given by the results of Belief Propagation.
Algorithmic results Our main algorithmic result is that for H ≤ d/2 it is easy to find assortative partitions and bisections in random d-regular graphs. We indeed provide two algorithms for which we verify this numerically.
For H > d/2 we conclude and conjecture that finding H-assortative partitions in random dregular graphs is computationally hard. For this range of parameters the H-assortative partitions are organized in a way that is referred to in the literature as frozen-1RSB, implying that for a typical partition the closest one next to it (in Hamming distance) is an extensive distance far away. Other computational problems with frozen-1RSB, such as locked constraint satisfaction problems [ZM08b;ZM08a]  shown in a line of work on the overlap gap property for the class of local algorithms [Gam21]. The structure of solutions in the frozen-1RSB phase is sketched in Figure 3. Of course, it will not be easy to prove such a hardness result for a general algorithm. But clearly establishing the conjectured hardness for particular classes of algorithms is an interesting topic for future work.  Relation between the assortative and disassortative partitions problem, and spin glasses Extending the conjecture of [ZB10] and for very analogous reasons we argue that on random regular graphs at m = 0 there is a close relation between the assortative partition problems, the disassortative one, and a spin-glass version thereof.
All the existence and algorithmic results stated above for the assortative case are hence valid also for the disassortative case with H dis = d + 1 − H ass and also for a spin glass with interactions J ij ∈ {±1} where the local magnetic field on every spin i, in its local neighborhood ∂i = {j ∈ V |(j, i) ∈ E}, is required to be In the context of spin glasses these configurations for H = d/2 are called the single spin flip stable states. For H > d/2 these would correspond to configurations where every spin is stable with a margin/gap of 2H ass − d.
Conjectures based on comparisons with existing work Comparing our results to past works on (dis)assortative partitions or bisections and spin glasses we pose several questions/conjectures. We kindly ask readers to let us know if/when some of these are established.
• Existence of H-partitions in general d-regular graphs: Typical random d-regular graphs are structurally not so different from general d-regular graphs with girth bounded away from below. Given this, one may wonder whether our prediction of the existence of H-assortative partitions on random d-regular graphs is valid also on these general d-regular graphs. We conjecture this to be the case.
• Positive algorithmic results for H = d/2 : We give empirical evidence that indeed assortative partitions at H = d/2 are found easily and so are disassortative ones. This result has been established at d = n/2 in [Fer+21]. Future work should aim at a rigorous analysis of the related algorithms (or other ones) establishing that indeed these partitions can be found efficiently on random d-regular graphs for all d, or even for all general (perhaps large girth) d-regular graphs.
• Gapped states in spin glasses are computationally hard to find: Our hardness conjecture has striking implications for the widely studied class of spin-glass models including the famous Sherrington-Kirkpatrick (SK) model [SK75]. Single spin flip stable states, corresponding to H = d/2 , are algorithmically easy to find and widely studied, see e.g. [BM81]. Our results imply that "gapped" spin flip stable states, corresponding to H > d/2 are computationally hard to find, yet we have not found any related investigation in the existing literature (not even an empirical one).
While we state most of our results for sparse random regular graphs, it is well known in the spin glass literature that the large d expansion of the sparse case recovers the results on fully connected graphs. Let us thus define a gap h = (2H − d)/ √ d = O(1) which then gives us for the fully connected limit where we recovered the scaling 1/ √ n well known from the SK model. While we stated the equivalence between the assortative partitions and spin glasses with interactions J ij ∈ {±1}, it is well known that the distribution of interactions does not really influence macroscopic properties and hence this could imply that even in the canonical SK model states that have a gap bounded away from zero h > ε for some ε > 0 are computationally hard to find, while they exists for h < 2 × 0.17566 = 0.35122. Their existence up to this value of the gap h was predicted in [TA88].
• Omnipresent marginal stability in glasses is a consequence of computational hardness: We may speculate that the above computational hardness of finding gapped states in spin glasses is actually the reason behind the omnipresent observation that dynamics in glasses and spin glasses converge to marginally stable states [MW15;Par17]. This rather generic observation could very simply be a consequence of the fact that anything actually stable is computationally hard to access. The arguments about algorithmic hardness in this paper are restricted to random mean-field systems (e.g. sparse random graphs). For instance, if we could plant a gapped partition in a random graph that was easy to find, along the lines of [ZK11]. The finite dimensional cases, where e.g. the corresponding graph is a lattice, may also behave differently. But in the view of the present results, investigating the question of hardness of finding gapped states in general systems including finite dimensional ones should be of interest.

Assortative partitions for H > d/2 are frozen
We want to investigate how the solution space of the partition problems on d-regular graphs is arranged and consider the assortative partitions as an example. If we have a valid H-assortative partition P = V − , V + on a given graph, what do we need to do to obtain a new partition P that is also H-assortative, but where at least one node has changed its group compared to P ? If with a single flip of a node, we start a cascade that invalidates the assortativity of an extensive fraction of other nodes in the graph, the partitions P and P are far away from one another in the solution space. We now show that for some H this is exactly the case and an extensive fraction of the nodes needs to change in order to arrive at the closest solution. The argument is adapted from [ZK11].
Theorem 1. Let d ≥ 3 be a fixed integer. Let G(V, E) be any large d-regular random graph with n nodes and assume that there exists a partition P = V − , V + for this graph which is an H-assortative partition with H = d/2 + k.
Then, there exists an > 0, such that no other solution P = V − , V + exists which is at most n node flips from P . We call solutions satisfying this property frozen.
To prove this fact, we can use that random regular graphs are expanders with high probability. Let the edge expansion or isoperimetric number of a graph G(V, E) be Theorem 2 ( [HLW06]). Let d ≥ 3 be a fixed integer. Then for every δ > 0 there exists ε > 0 such that for almost every d-regular graph G(V, E) with n nodes Proof of Theorem 1. We argue by contradiction and assume that there is indeed a H-assortative partition P which is close to the given partition P . Given some δ > 0 we choose ε > 0 such that Theorem 2 holds. We then assume that the set of flipped nodes between P and P is For a specific H a subset of the direct neighbors of i ∈ S must also be contained in S. In particular, for k ≥ 0 and i ∈ V + ∩ S, at least 2k neighbors from ∂i ∩ V + need to change to V − together with i for even d and likewise for V − . This implies the existence of edges within S. Since G is d-regular, we can bound the number of edges that emanate from S toS as |∂S| ≤ (d − 2k)ñ and therefore h( Since we can select δ as small as we want, this inequality is only valid when k < 2. For larger k, it does not hold and therefore our assumption, that the solutions P and P areñ ≤ εn close is wrong which implies that Theorem 1 holds. We can repeat the same arguments for odd d where we need to flip at least 2k + 1 neighbors of a node i ∈ S and arrive at a contradiction for k ≥ 1. However, our proof of Theorem 1 gives only a lower bound on the distance between solutions. It could very well be necessary to change even more nodes than implied there to arrive at the closest other solution. This is in particular important for k = 1 and even degree d which are not included in the Theorem, since the flip of a node implies that least two of its neighbors flip as well. If these flipped nodes are arranged in a cycle, one would have a solution that is at O(log(n)) distance to the given P and therefore not extensive. But flipping only these loops might not be sufficient typically. This is because flipping two of i's neighbors is also only a lower bound, and it might be necessary to change 3 or more, which would propagate the changes further on the graph and eventually change an extensive fraction nonetheless. In order to resolve how many nodes typically need to be flipped in random regular graphs, in particular for k = 1, we develop the survey propagation in Section 8 that tracks such required changes. Using survey propagation, we find that actually the problem is frozen, i.e. valid configurations are at extensive distance from each other, for all H > d/2 . An analogous set of arguments can be applied to the disassortative partitions, where the freezing occurs at H ≤ d/2 .
Theorem 1 implies that under the same assumptions the problem has the overlap gap property which is a sufficient condition for hardness for a number of algorithm classes, including local algorithms, AMP, low-degree polynomials and Boolean circuits [Gam21]. What remains to be shown is that the partitions satisfying the assumptions of Theorem 1 exist in random d-regular graphs. This is addressed in the next section.

Probabilistic setting of the problem
Probability distribution Any partition V − , V + on the graph can be encoded into a vector x = (x 1 , x 2 , ..., x n ) ∈ {±1} n . Then, we can define a probability distribution on the space of possible valid partitions as follows where Z is the normalizing constant and µ ∈ R is the chemical potential used to adjust the magnetization m to a desired value. The C H expresses a constraint on the exclusive neighborhood ∂i of each node i Here, 1(B) is the indicator function of a boolean statement B; if B is true it takes value 1 and 0 otherwise. If we set J ij = +1 for all (ij) ∈ E we obtain the assortative partition problem. Indeed, counts how many more neighbors of i are in the same group as the central node i over those that are in the other group. In the constraint C H this is converted to exactly the number of nodes in the neighborhood that are in the same group as i. Thus, the constraint is fulfilled so long as i has at least H neighbors in its own group. This means that we have an H-assortative partition if and only if all constraints C H are satisfied. Consequently, for J ij = +1 the probability distribution (1) only has non-zero probability on Hassortative partitions. Additionally, the factor exp −µ i∈V x i weights partitions according to the size of the two groups, using the parameter µ that is referred to as the chemical potential in physics. The chemical potential plays the role of a Lagrange parameter, and adjusting its values suitably allows to sample only solutions of a given magnetization m.
We can proceed similarly to describe the disassortative partitions by setting J ij = −1 for all (ij) ∈ E. The sum −x i j∈∂i x j then counts how many neighbors of i are in the opposite group and the probability distribution (1) is therefore non-zero only on (d − H + 1)-disassortative partitions.
Obtaining the number of valid partitions Given this definition of the probability distribution, we are able to compute the number of partitions that have non-zero probability for a given magnetization m. For given values of J ij , H and m we define this number to be N (m) and its entropy s(m) (here we do not make dependence on J ij and H explicit) where s(m) is the entropy. Defining the free entropy density to be Φ(µ) = log(Z)/n, we can split the partition function Z according to the magnetization m as follows For large graphs where the number of nodes goes to infinity we can apply the saddle point method to see that In order to obtain the function s(m), we need to compute the magnetization m(µ) and the free entropy density Φ(µ) for different values of µ. Both of them can be computed from the partition function Z, as the free entropy density is simply its logarithm and we can recover the magnetization as Generally, the high-dimensional sum Z is intractable, but on tree graphical models the established tool of belief propagation (BP) [YFW+03] allows to compute Z exactly. On large locally tree-like graphical models, analysis based on BP may be asymptotically exact under conditions discussed subsequently.

Belief Propagation on a tree-like factor graph
Tree-like factor graph To use the Belief Propagation and compute the corresponding entropy, we need to find the factor graph associated to the probability measure (1). In the most straightforward choice, every node in the original graph becomes a variable and each neighborhood of i becomes a factor to ensure the constraint C H . Priors on the variables account for the chemical potential µ. Unfortunately, this factor graph of (1) is not tree-like by default, since the constraints on the assortativeness of node i depend on all its neighbors ∂i. Since their own assortativeness reciprocally also depends on i, this relation is responsible for creating small loops in the factor graph. This poses a problem for applying belief propagation which is exact on trees and under specific conditions can be asymptotically exact on tree-like graphs.
To eliminate the problematic small loops, we construct a different factor-graph by introducing auxiliary variables. For each node membership x i we create exactly |∂i| copies (replicas) of it. We can take on values in the possible groups in the partition. The factor nodes i enforce the constraint on assortativeness via f i . The factor nodes ij correspond to the magnetization constraint. Messages ψ and χ are sent along the edges.
call each replica x j i , where j ∈ ∂i denotes the neighbor of i to which this replica is associated. We then obtain the desired tree-like factor graph on tuple variables, as depicted in Figure 4. The prior contributions enforcing the chemical potential can then be expressed as and the factor nodes representing the neighborhood of node i are The second factor in f is added to enforce the replicas of one node to all be the same so that the resulting probability distribution of the tree-like factor graph exactly corresponds to the probability distribution in (1). In contrast to the loopy factor graph directly obtained from (1) the variables on the new factor graph are tuples of node memberships (x j i , x i j ) instead of single memberships.
Belief propagation We then readily apply the Belief Propagation equations [YFW+03] that will provide an asymptotically exact solution under the assumption that the incoming messages are independent. We will discuss how to self-consistently check this assumption in the next section.
In statistical physics the analysis based on Belief Propagation is called the replica symmetric analysis, as the assumptions under which Belief Propagation gives the asymptotically exact result are equivalent to those of replica symmetry [MPV87; MM09]. We call ψ i→(ij) x j i ,x i j the message sent by the factor node (i) to the variable node (ij), and χ (ij)→j x j i ,x i j the message sent by the variable node (ij) to the factor (j). The oriented tuples (x j i , x i j ) contain the replicas of the groups i and j are assigned to. According to belief propagation, they can be computed as where the Z i→(ij) , Z (ij)→j are normalisation constants to ensure that ψ i→(ij) , χ (ij)→j are probability distributions.
The indicator function in the factor to variable messages ψ i→(ij) x j i ,x i j is zero when the replicas of i are not all identical. From this, we can safely assume that at the fixed point for all i it holds that x i = x j i for j ∈ ∂i. This simplifies the messages greatly and we obtain For a fixed point of these messages, the corresponding replica symmetric free entropy Φ RS can be formulated as Substituting ψ xi,xj in this expression by rearranging (12), some parts simplify and we get Likewise we can eliminate ψ i→(ij) xi,xj in the update rule and we combine the computation of two message types into only a single message where we redefine Z i→j = Z i→(ij) Z (ij)→j . From this we can compute the magnetization m as a function of µ by Now we have all the ingredients ready to compute the entropy s(m) on a full graph as We only need to find the fixed point χ for some given value of m and calculate Φ RS at this fixed point from (18)-(20). Inserting this into (23) enables us to find the entropy at the corresponding µ.
Algorithm 1 shows the procedure employed to find a fixed point of the BP. Note that an update on µ needs to be included to enforce the fixed point to have magnetization m = m target rather than m = ±1. At convergence, Φ RS can be computed.
Algorithm 1: Belief Propagation on a full graph G(V, E)

BP on d-regular graphs
We now consider the problem only on d-regular random graphs and J = J ij for all i, j. Thus, also |∂i| = |∂j| = d for all i, j. Under the same assumptions under which the Belief Propagation is asymptotically exact on tree-like graphs, this implies, that at a fixed point of the belief propagation, all messages have to be equal locally and we set them to be Note, that the tuples of membership assignments (x, y) are still oriented, which needs to be taken into account when formulating the update rules. We can use this to simplify the BP update rule considerably by applying this assumption to (21) to get By introducing the sum formulation we only count the assignments on the remaining d − 1 edges that fulfill the constraint C H . The binomial coefficient is present to account for the number of combinations in which this can be achieved. The replica symmetric free entropy on d-regular graphs reduces to The magnetization simplifies to For the case of H ass -assortative partitions with J = +1, H = H ass the BP update and computation of Z node simplify into The last line stems from the fact that the factor for a specific node in partition x with a given neighbor in partition y and a remaining neighborhood of size d − 1 is only non-zero if it has at least H − 1(x = y) neighbors that are in the same partition as x. Only if this is fulfilled, the central node is assortative. Applying the same for H dis -disassortative partitions with J = −1, H = d − H dis + 1 we have For these formulas, we can use the same procedure as before for the BP on the full graph to find the entropy at a specific magnetization for d-regular graphs. The only difference will be, that we iterate on exactly one message instead of on two per every edge and instead of updating every edge randomly we introduce dampening.
Equality between assortative and disassortative bipartitions From the fixed point equations of the (dis)assortative partitions, we can immediately see that for µ = 0 there is a strong formal resemblance between the two problems. This is the case when there is no external fields and the fixed points converge to a solution for m = 0, a bipartition. For assortative bipartitions with a fixed pointχ ass and H ass , it follows thatχ dis is a fixed point for the disassortative case with Moreover, under these conditions Φ ass RS = Φ dis RS is equal, as Z dis node = Z ass node and Z edge does not change under (34)-(35). Note, that this equality does not hold for µ = 0, since for imbalanced partitions the elements of χ are weighted differently and we have different fixed point equations.
In sight of this equality result, we will analyze the BP-based results for both the assortative and disassortative partition problem interchangeably in the case of zero magnetization. We also note that for regular random graphs with m = the replica symmetric entropy is generically equal to the annealed entropy [Mor07] and is thus an upper bound on the true entropy.

Analysis of BP results for d-regular random graphs
In order to obtain the replica symmetric entropy, the fixed point equation (30) is iterated until convergence, adapting µ at every iteration in order to obtain the desired value of m. Because the problems are symmetric over ±m, we only show and discuss results for positive m.
The resulting entropy as a function of m is depicted in Figure 5 both for the assortative (left) and disassortative (right) case, for degree d = 7. The general behavior is consistent for various values of d.   We exactly recover the predicted equality at m = 0 between the entropy of the assortative and of the disassortative case, when the H is reparameterized properly, H ass = d + 1 − H dis . This correspondence is highlighted by the colors of the corresponding curves and shown separately in Figure 6. In both cases this is also the maximum of the entropy over all m, which means that if partitions exist most of them are (close-to) bipartitions. Beyond m = 0, the entropy of the two assortative and disassortative problems behave very differently. For the assortative partitions, at m = 1 the entropy is always exactly zero, as there is only exactly one satisfying partition: The one with all nodes in one group, the partition V, ∅ . The two cases H ass = 1, 2 are a bit special as for them the entropy never goes below zero. For H ass = 1 it is enough for a node to have one of their neighbors in the partition. So as long as the number of neighbors in each partition is even, one can easily place these pairs everywhere in the graph and find such partitions. For H ass = 2 the picture is similar, as one can place loops of size log(n), which are present in large d-regular graphs and which make the nodes in that partition 2-assortative. The problem looks different though for H ass ≥ 3, because the both groups must contain at least a 3-regular graph as a subgraph, as we discussed in Section 4. All such subgraphs are with high probability extensively large, because they are expanders. Thus, there cannot exist partitions with magnetization close to 1. We indeed see in Figure 5a that for H ass ≥ 3 in an interval around m = 1 the entropy is negative. Under the assumptions of BP, the magnetizations for which the entropy remains positive are those for which (H, m)-partitions exist with high probability. The entropy at m = 0 turning negative signals the absence of all non-empty H-partitions.
For the disassortative case the entropy curves look a bit different at m = 0. They become negative at some value of m for all H dis . They actually diverge to −∞ before they reach m = 1. In fact, they diverge exactly atm(H dis ), which is the imbalance between the partitions at which a valid disassortative partition becomes combinatorially impossible, i.e. at m(H dis ) = min m ∈ (0, 1) At this value, the number of crossing edges required to satisfy the nodes in the larger partition is smaller than the number of overall edges that are adjacent to the smaller partition. This implies that even if we were allowed to choose the underlying d-regular graph structure, it would be impossible to construct a disassortative partition for such a large imbalance. For a fixed d and m, the entropy is decreasing as H ass is increased and H dis is decreased. Results with respect to different d dependent on H are shown in Figure 7. Table 2 then summarizes the values of degree d and parameters H for which assortative partitions exist for zero magnetization.

Stability of the replica symmetric solution
As anticipated, the Belief Propagation approach is not always exact even on large tree-like graphical models. A necessary condition for correctness of this approach is convergence of BP to a fixed point on a single full graph. Such a convergence can be checked by running BP on a given large graph initialized at the RS fixed point and perturbing the local messages slightly by some random noise ε.
Since running the BP on large sets of d-regular random graphs is computationally heavy, we resort to approximating this behavior on a full graph using population dynamics [Zde08]. This means, for updating an iterate at time t we keep an array of N messages [χ i ] i=1,...N . An update is constructed by randomly sampling d − 1 neighbors for each new message in the array and applying 6 Asymptotic equivalence between the assortative and disassortative partition problem at m = 0 In the previous section we derived that on random regular graphs under the assumptions of the replica symmetry the entropy of balanced (i.e. m = 0) assortative partitions is in the large size limit the same as the entropy of the disassortative partitions. One should note that on a single instance of a random regular graph the knowledge of a assortative partition does not give us any clear algorithmic way to obtain a disassortative partition, and vice versa. Thus the equality of the associated entropy should appear as a rather surprising property. It is also worth noting that this property does not hold for non-balanced partitions m = 0 as shown in examples in Section 5.4. We also do not expect this asymptotic relation between the two problems to hold on graphs with varying degree as in that case partitions of balanced size but not-balanced average degree could cause differences. We do not expect this property to be exactly true for the number of assortative and respectively dissasortative partitions on finite size graphs, but only for the entropies in the limit of large size.
On the other hand we do expect and conjecture this equivalence to hold even if replica symmetry breaking needs to be taken into account in order to evaluate the value of the concerned entropy. We hence conjecture: Conjecture 1. In the limit n → ∞, on random d-regular graphs, the entropy of balanced assortative partitions at H ass is equal to the entropy of dis-assortative partitions at H dis = 1 + d − H ass . This conjecture is reminiscent of an analogous one made in [ZB10] for the size of the maximum cut and the size of minimum bisection on random d-regular graphs. We will now present an argument why this conjecture is expected to hold beyond the replica symmetry assumption. The assumptions we are making are common to the replica and the cavity methods of spin glasses [MPV87]. This argument applies to d-regular random graphs, that are locally tree-like in the large size limit, and balanced m = 0 partitions. Similar to (1) we use the following definition for the partition problem constraints where J ij = 1 for all (ij) ∈ E in the assortative case, and J ij = −1 for all (ij) ∈ E for the dis-assortative case taking H dis = 1 + d − H ass . We could even define a third spin-glass version of  Table 2: Results for the assortative partition problem for different d around the relevant phase transitions, when the solution space becomes frozen at d > H/2. Cases in the frozen phase are marked with bold face. The phase where typically no solutions exist (the entropy is negative) is marked in italic face. The algorithms were both run on the same 10 randomly sampled d-regular graphs of size n = 10, 000 and each run for at max 20, 000 iterations. The minimum and median percentage of H-disassortative nodes in the resulting partition is reported.
the partition problem where J ij ∈ {±1} chosen at random for every edge (ij) ∈ E. The difference between the assortative, the disassortative and the spin glass partitions hence boils down to the different choice of the parameters J ij . We now consider that whenever the cavity method arguments are used, there is always an underlying assumption that the associated probability measure, (1) in our case, can be decomposed into extremal Gibbs measures, so called states, and each of these states is such that the so called point-to-set correlations decays to zero within the state, meaning that a root of a tree has no recollection of what is going on at a far away boundary if that boundary is chosen from the extremal Gibbs measure itself. The assumptions of the existence of such a decomposition is at the core of the cavity/replica method. With this in mind we now realize that the difference in J ij 's that distinguishes between the assortative, the disassortative and the spin glass partitions can be pushed to the boundary of a rooted tree graph by applying the following change of variables: are chosen in such a way thatJ ij = 1 for all (ij). This can be easily done by choosing σ's recursively from the root, since we assumed m = 0 for the x-variables, and flipping all or a random portion of them by σ i will not change the magnetization of thex variables. This part of the argument would fail if we wanted to make it for m = 0. This is also where the requirement of regular graphs enters, because for graphs with inhomogeneous degrees the degrees could be correlated to the spin values and this correlation could again break the argument that the system before and after the change of variables will have the same properties. With the tilde-variables we transformed the problem on the tree into the assortative case. The difference was pushed to the boundaries which, by assumptions of the method, does not influence the solution obtained from the cavity/replica method. All in all, we showed that as long as the problem is on randomregular graphs and has m = 0 then the properties of partitions are the same for the assortative and disassortative and spin glass case. We saw this manifest for the disassortative and assortative partitions already in Section 5.4. In the following section, we will see that the results we show for the partition problems for d → ∞ were also discovered in the context of spin glasses.

Large d asymptotics for assortative bipartitions
To make the relevant properties of the entropy visible at large d → ∞ with m = 0, we introduce h such that H = d/2 + h √ d. Then in the zeroth order the entropy at this limit is given by under the condition that c(h) fulfills the following fixed point equation This formula can be derived from the fixed point criterion in (30) and the formula for entropy (18) together with the assumption that the magnetization is fixed. We show the detailed derivation in the Appendix. For example, from this we can calculate that the transition from positive to negative entropy occurs at h max = 0.17566. The quality of the expansion for general H is already very good at d = 1000, as shown in Figure 9 and exactly agrees with the scaling evident in the simulations as shown in Figure 8. Another interesting point is h = 0, i.e. H = d/2, where the entropy is s(m = 0) = 0.19923. Note that both these numbers are known in the spin glass literature. The entropy s(m = 0) = 0.19923 is known to be the entropy of single-spin-flip-stable states in the SK model of spin glasses [BM81]. The maximum gap h max = 0.17566 was computed in [TA88] as the largest margin of stability of metastable states in a spin glass. This follows from the equivalence between the assortative, the disassortative and the spin-glass partitions discussed in Section 6.

Survey Propagation
In Section 5.5 we discussed the stability of the replica symmetric solution as a necessary condition for its correctness. But this is not a sufficient condition. It is predicted in statistical physics literature that the replica symmetric solution is asymptotically correct on tree-like factor graphs if the solution of the one-step replica symmetry breaking (1RSB) reduces back to it [MM09]. We thus investigate the 1RSB solution in this section for magnetization m = 0.
By these means we can also resolve a problem from Section 4, where we discussed to what extent the flip of a single node in a satisfying solution influences the assortativity of a fraction of other nodes in the graph for different values of H. When an extensive fraction of the graph was directly influenced, we argued that this implies that valid solutions to the problem are isolated, i.e. spaced far apart from another. Such structure of the space of solutions is called the frozen 1RSB [MMR04; APZ19]. This would make it difficult to algorithmically discover them and manifest the computationally hard phase [ZM08a;Gam21]. Because our previous argument from Section 4 is inconclusive for cases when H = d/2 + 1, we develop the 1RSB for our problem also in order to settle whether the frozen 1RSB occurs in these cases.
The idea behind 1RSB is often described using the concept of reconstruction on trees [ZM08a]. In reconstruction on trees, one considers one of the valid partitions on a given tree and then removes all information about the membership except at the boundary, the leaves of the tree. The question is then, whether this boundary information is sufficient to determine something about which partition the root belonged to. A stronger requirement would be to determine the value of the root exactly based on the boundary, this is called the naive reconstruction in the literature [ZM08a]. This can be answered by propagating constraints that the given leaves impose on their parents layer-wise up the tree until the root. In some cases these implications may be inconclusive and exact reconstruction of the root might not be possible. This happens, if there are many solutions with the same boundary but different values of the root. If exact reconstruction is possible though, the information about the roots value is contained in the boundary. Therefore, some variables between the root and the boundary must also be determined by the boundary, as otherwise the information would be lost. These special determined variables are called frozen, as in all solutions that have the same boundary, these frozen variables must be the same. Computing the number of these frozen variables in the tree for some H gives us information about how large the influence of a root flip is on the tree.
We can use this idea to compute the fraction of frozen variables on tree-like random graphs. In this case, the naive reconstruction process can be approximated by the warning propagation algorithm (WP). Given an initial boundary condition warning propagation finds the fixed point to which a reconstruction process on the full graph would converge to under the replica symmetric assumption. The survey propagation algorithm then counts the logarithm of the number of those fixed points on random graphs containing frozen variables by running BP on the warning propagation constraints. In the following we present both algorithms for random d-regular graphs and check if the result for the frozen 1RSB maps back to the replica symmetric solution from the BP to check that it is asymptotically correct. This also tells us whether the fraction of frozen variables is extensive.
Warning propagation With warning propagation we can simulate the naive reconstruction process on random d-regular graphs. Given initial membership assignments to partitions on the boundary we use the constraints of the (dis)assortative partition problem to infer which membership assignments on the remaining graph can be freely assigned and which ones are frozen. Recall that the variable (x i , x j ), represents the group memberships of the nodes i and j in either V − or V + . It can take on any of the four different values in {±1} 2 , representing crossing and non-crossing edges between or within the two groups. In this setting, a warning w i→j is a message from i to j that tells node j which values of the variable (ij) are acceptable for i. An assignment is acceptable for i if it allows i to be H-assortative given the warnings incoming to i from all its other neighbors k ∈ ∂i \ j. For example, a warning that node i sends to j could be w i→j = (the color white denotes an assignment to partition V − and black to V + ) . This tells j that the only acceptable value of (x i , x j ) for i is . Such a situation could occur when i has to have at least H neighbors in its own group, but it has only H − 1 neighbors from its own group in the neighbors ∂i \ j. Then the only way to fulfill this constraint is to require j to be in the same partition as itself. Thus, j is an example of a frozen variable since it cannot be chosen freely. On the other hand, if i does not have a specific requirement for j, for example because it already has at least H neighbors in its own group without counting j, it sends the don't care-warning to j, which we denote as w i→j = . In this case j can be chosen freely, i.e. it is not frozen. While this symbolic notation is instructive, in the following we use the more succinct notation where w i→j ∈ [ ± ± ± ± ], so that a w i→j xi,xj = + denotes that the corresponding assignment (x i , x j ) is allowed and = − that it is not. Using this notation we have that = [ + + + + ] and = [ + − − − ]. Since i can select any subset of the four possible assignments {±1} 2 , the warnings can take on 16 different values. Note that the "don't care" warning is special, as it is the only warning that allows j to choose its assignment freely. Under these conditions, we can compute the warning w i→j given the warnings that i receives from all other neighbors as Note that by assigning J ij correctly we can obtain the warning propagation for either the assortative or disassortative case as in (1). It allows only those membership assignments (x i , x j ) for (ij), for which i could make itself H-(dis)assortative by selecting the appropriate allowed assignments from the warnings it received from its neighbors k ∈ ∂i \ j. The first part of the constraint ensures that those assignments are allowed in the warnings i received from those neighbors. The C H as defined in (2) ensures that the local constraint on i for (dis)assortativity is fulfilled. For brevity of notation we will denote the warning propagation update as On a tree with the leaves set to "conclusive" warnings where only one assignment is allowed, iterating (39) up until the root would allow us to exactly tell which values the root would be allowed to take on. Another relevant initialization in the context of frozen 1RSB is one where small noise is introduced on the boundary in the form of a small fraction of "don't care" warnings. If such an initialization still implies the value of the root, we speak of the small noise reconstruction [ZM08a], which then implies the presence of frozen 1RSB where an extensive fraction of nodes needs to change in a tree-like graph upon the flip of one node .

Survey propagation
We can use survey propagation to count the number of warning propagation fixed points and their entropy for random graphs. A survey η i→j is a probability distribution over the 16 different warnings that i could send to j. This is analogous to how we derived the belief propagation equations and the associated free entropy in Section 5.1. SP messages are also probability distributions over variable assignments and therefore Φ SP allows us to recover the entropy of the warning propagation solutions/fixed points by the same arguments.
For example, η i→j [ + + + + ] is the probability that i sends a "don't care" warning to j. The surveys can then be updated as where the normalizing constant Z i→j ensures that η is a probability distribution. At a fixed point of this iteration, one can compute the entropy of the warning propagation fixed point, that is referred to as the complexity Φ SP in the literature, as Some examples of how the constraint in (43) for the specific case of H-disassortative partitions is resolved are shown in Figure 10. In analogy to the BP in Section 5.3 we can easily derive simplified update rules for random d-regular graphs under the assumption that η = η i→j ∀i, j and apply it to some initial distribution η 0 . At H ≤ d 2 the solution space of the disassortative partition problem is frozen 1RSB Setting η 0 to correspond to the small noise reconstruction, i.e. setting a small probability for the "don't care" survey and the rest of the warnings in the survey to a conclusive assignment, we can probe the fraction of non-frozen variables at the convergent distribution η * as η * [ + + + + ], as well as the entropy of the warning propagation's fixed points Φ SP .
In running the SP equations (41) for d-regular graphs, we consistently observe that for the disassortative case and for H ≤ d 2 only exactly four of the 16 possible warnings have a non-zero probability at convergence. Two of them are [ − − ] and [ − − ] which require the membership of the outgoing node to be fixed to a specific group but where the membership of the incoming node can be chosen freely. The other two are [ − − − ] and [ − − − ] which both require that the edge itself be a specific crossing edge. Since at convergence there is zero probability of the "don't care" edge η[ + + + + ] for H ≤ d 2 , the H-disassortative bipartition problem is frozen in this case. Then, there is also a direct mapping between the RS fixed point χ and the survey propagation fixed point η for a H according to Under this mapping, the BP and SP entropy are exactly the same as shown in Table 2. In this case of frozen 1RSB, we can conclude that the RS solution based on analyzing Belief Propagation is correct. For H > d 2 the SP converges to a fixed point where every warning is "don't care". Therefore the reconstruction is not possible and we are not in the frozen 1RSB.
An example for these two different behaviors for d = 18 is shown in Figure 11, and this is consistent with the general picture for smaller or larger d.
By the equivalence between the (dis)assortative partitions at m = 0, we can conclude that the same holds for the assortative partitions: in this case, the frozen variables 1 appear at H > d 2 . This completes the phase diagram for magnetization zero. 9 Algorithmic Performance at m = 0 We now take a look at two algorithms that aim to find a solution on a specific instance of the assortative H-partition problem at magnetization zero. To avoid algorithms from converging to the "'all +1" and "all −1" partitions, we consider only those that keep the magnetization constant during their run by using SWAP operations between the two partitions.
Algorithm EagerSWAP: Swapping random disassortative nodes The graph is initialized with a random but balanced partition. For every node it is calculated whether it is assortative or disassortative depending on the parameter H, i.e. if the constraint is fulfilled given their neighbors memberships. Given this information, two diassortative nodes are selected at random, one from group V − and the other from group V + . Then, they become members of the opposite group and all affected nodes in the graph are updated. These steps are repeated until the number of assortative nodes in the graph no longer fluctuates, or when the maximum number of iterations is reached.
Algorithm GreedySWAP: Swapping most disassortative nodes [Fer+21] Define the assortativeness of node i as the number of neighbors with membership x i minus the number of neighbors with a different membership: Upon a random and balanced initial partition, the most disassortative node of each partition is selected. Then, these two nodes swap their groups. Afterwards, the assortativeness of all effected nodes is updated and the same process repeated. Analogous to EagerSWAP, the current partition is returned once the assortativeness of the overall nodes is stable or the maximum iterations are reached.
Results In both cases, the balance between the partition sizes is always maintained during the iterations.
Note that GreedySWAP was proven to produce with high probability n − o(n) nodes with assortativeness ≥ 0 for random Erdős-Rényi graphs with degree n 2 and n nodes [Fer+21]. This means that for n − o(n) nodes at least half of their neighborhood is in their own group. This is similar the problem of d 2 -assortative partitions that we cover in this paper, although we do not have a random, but fixed degree d and consider sparse and not dense graphs. The algorithms are run on randomly generated d-regular graphs and the resulting number of disassortative nodes at convergence is recorded. If there are no disassortative nodes in this result, a solution to the H-assortative graph problem was recovered. Because the algorithm GreedySWAP does not depend on the parameter H, for every instance with degree d it is only run once. Then, the number of disassortative nodes of the recovered partition is evaluated for different H.
The results of several runs of these algorithms are shown in Table 2. GreedySWAP finds satisfying partitions for H ≤ d/2 more reliably than EagerSWAP, which sometimes leaves a small number of nodes disassortative. For odd d, where H = d/2 both algorithms successfully find partitions that leave only a small number of nodes disassortative. In the hard phase where we have a negative s(0), both algorithms fail to find good solutions. In the frozen phase, the algorithms both do not find completely satisfying solutions, but EagerSWAP finds solutions that have more assortative nodes than GreedySWAP.
Since in Table 2 we only give results for fixed n = 10, 000, we also check finite-size effects in Figure 12. For the example of d = 8, the percentage of disassortative nodes scales as a power law when H = 4, which is in line with our prediction that in the easy phase the algorithm should be able to find solutions when n → ∞. In contrast, the percentage of disassortative nodes plateaus in the frozen-1RSB phase when H = 5, which corroborates our prediction that in this setting solutions are difficult to find as the percentage plateaus despite the growth of n.
Additionally, both algorithms can be adapted equivalently for the disassortative bipartition. For EagerSWAP, the criterion changes to swapping random assortative nodes. Similarly, for GreedySWAP, instead of swapping the most disassortative nodes, the most assortative ones are swapped. Under these adaptations we recover the same behavior as for the assortative case. In the disassortative easy phase we find such partitions easily whereas in the the hard phase the solutions are not found.  Figure 12: Mean remaining percentage of disassortative (unsatisfied) nodes in partitions found by EagerSWAP for d = 8 for an increasing graph size n. In the predicted easy phase at H = 4 this percentage decreases as a power law and the algorithm finds increasingly good solutions as n → ∞.
In the frozen phase at H = 5, which should be difficult for local search algorithms, the percentage of disassortative nodes plateaus which is in line with our prediction. From n = 10 2 to n = 10 5 the results are averaged over 50 runs, for larger instances the experiment was repeated 10 times. The maximum number of iterations was 10 · n. distribution function P (K ≥ pd) = so given the assumption (55) the factor c is exactly For the entropy we use (54). For the first term in its sum the approximation can be found analogous to the operations used before to be log(1/2 − 1/2Erf[ √ 2(h − c)]) + 2/π(−1 + e 2(h−c) 2 )e −2(h−c) 2 Erfc( √ 2(h − c)) Finally, the last term can be approximated as d log(2) − 2c 2 + 4c 4 1 d Putting this together we get Φ RS = (−2c 2 + log(Erfc( √ 2(h − c))) + 2/π(−1 + e 2(h−c) 2 )e −2(h−c) 2 Erfc( √ 2(h − c)) Using (71) together with (74), a solution of those equations can be found given that either h or Φ RS is fixed using numerical methods.