A signed network perspective on the government formation process in parliamentary democracies

In parliamentary democracies, government negotiations talks following a general election can sometimes be a long and laborious process. In order to explain this phenomenon, in this paper we use structural balance theory to represent a multiparty parliament as a signed network, with edge signs representing alliances and rivalries among parties. We show that the notion of frustration, which quantifies the amount of “disorder” encoded in the signed graph, correlates very well with the duration of the government negotiation talks. For the 29 European countries considered in this study, the average correlation between frustration and government negotiation talks ranges between 0.42 and 0.69, depending on what information is included in the edges of the signed network. Dynamical models of collective decision-making over signed networks with varying frustration are proposed to explain this correlation.


Symbol
Meaning N number of elections for each country. n number of elected parliamentary members for each election. G signed network. G country, date parliamentary network for a country and election year "date". A = [a ij ] n × n adjacency matrix of G country, date . n p number of elected political parties for each election. p i i-th parliamentary political party, i = 1, . . . , n p . c i number of seats gained by the i-th party p i , i = 1, . . . , n p ; it holds that np i=1 c i = n. q p i "political position" of the i-th party p i , i = 1, . . . , n p , in a left-right axis. w ij weight (= amount of trust/distrust) between two parties p i , p j , respectively, i, j = 1, . . . , n p . W = [w ij ] n p × n p matrix of weights. 1 c i c i × 1 vector of ones.

S1.1 Parliamentary network construction
For each country and parliamentary election listed in Supplementary Table 1.we consider an undirected graph G country, date = (V, E, A), where V (card (V) = n) is the vertex set, E is the edge set, and A = [a ij ] ∈ R n×n is the adjacency matrix, with a ij representing the weight of the edge (j, i) ∈ E. Each of the n vertices in V represents an elected Member of the Parliament (MP), and each edge in E the relationship between two MPs, which can be cooperative or antagonistic. A positive edge a ij > 0 means cooperation between the i-th and j-th MPs, a negative edge a ij < 0 antagonism. All MPs of a party are always assigned the same weights, i.e., we treat a party as a homogeneous cluster of nodes. As shown in Fig. 1B in the main text, the network G country, date = (V, E, A) is therefore composed of n p clusters, represented by the political parties, where n p is the total number of parties which gained seats in the parliament after the election. This implies that the adjacency matrix A, as well as all the other matrices of interest, can be seen as a n p × n p block matrix: where c i is the number of seats gained by the i-th party, is the matrix of all 1s (1 c i is the vector of size c i having all elements equal to 1), and W = [w ij ] ∈ R np×np is the matrix of party-party weights. Its signed entries w ij describe the interaction between MPs of the party p i and party p j , in terms of political affinity.
In order to choose the matrix W , we consider different party grouping criteria and different weight assignment methods. The party grouping criteria are: 1. All-against-all. All parties compete against all parties: w ij = 1 if i = j (p i and p j are the same party; hereafter: p i = p j ) < 0 if p i and p j are different parties.
Electoral coalitions are not taken into account in this case. Germany is an exception to this rule, in that the Christian Democratic Union of Germany (CDU) and Christian Social Union in Bavaria (CSU) are always considered as a single party.
2. Pre-electoral coalitions. Parties in pre-electoral coalitions are cooperating: if parties p i and p j belong to the same coalition < 0 if parties p i and p j do not belong to the same coalition.
In the case of countries where double rounds of elections are common (for example in Hungary until 2010), we consider also the electoral coalitions made before the second round (so the ones made before the first round plus the ones made between the first and second round).
We always assume that w ii = 1 and that w ij = w ji , i.e., that W (and hence A) is symmetric. In turn, this means that G country, date is undirected.
As for the weights themselves, we consider both the cases of unweighted (but signed) W and weighted (and signed) W . In the unweighted case, w ij ∈ {−1, +1}, with +1 only on the diagonal (all-against-all case). The resulting graph is complete, undirected and signed.
In the weighted case, the general philosophy is that off-diagonal weights between parties which are not in pre-electoral coalition should be negative, small (in absolute value) for ideologically close parties and approaching −1 for ideologically antipodal parties. Instead, off-diagonal weights between parties in pre-electoral coalition should be positive and close to 1 for ideologically close parties. In order to define the matrix of weights W = [w ij ], the first step consists in assigning to each political party a position in the left-right ideological spectrum. For this, we follow two different criteria, as shown in Supplementary  Fig. 1A: (1) use data from the Manifesto Project Database, in particular the so-called rile index (8); and (2) place the parties on a predetermined left-right grid and assign to them specific positions randomly. It is convenient to start the description by the second approach.  We assume that the left-right scale is symmetric around the central position q C = 0. The specific values of q CCR , q CR , q CRR , q R , q RFR are chosen randomly, sorting 5 values drawn from a uniform probability distribution in the interval [0, 0.5]. The values of q LFL , q L , q CLL , q CL and q CCL are then obtained by symmetry, see Supplementary Fig. 1B. Big tent parties do not fit into such a left-right grid, because they tend to attract voters from the entire ideological spectrum. Examples of big tent parties are the Italian party Movimento 5 Stelle (5 Star Movement), in the 2018 elections. Consequently, the distance d BT between a big tent party and any other party must not be "too small" nor "too big" compared with all the possible differences |q p i − q p j | for all non big tent parties p i and p j : d BT is then chosen as the median of the differences, taken in absolute value, between all possible combinations of the pairwise distances of the positions q FL , . . . , q FR , With these conventions we can proceed to assigning numerical values to the weights.
Since we take into account also pre-electoral coalitions, we need to assign weights that are positive to parties in the same coalition. The weights w ij , i, j = 1, . . . , n p , are then chosen with the following rule: The function coal(p i , p j ) is equal to 1 if p i and p j are in electoral coalition, 0 otherwise. Notice that when two parties p i and p j are not in electoral coalition but are located in the same position (i.e., q p i = q p j ), then we still assume that the w ij weight is negative, but small (equal to half the least nonzero difference between any two parties). The weights are kept constant throughout the party history.
To study how different choices of the values q X can influence our analysis, we decided to consider 10000 different vectors of random values for each country, retaining the best value (i.e., the value that leads to the highest correlation between frustration and negotiation days, see below for more details).
1. Rile index from Manifesto Project Database. For each country and parliamentary election, the Manifesto Project Database (9) collects information on the electoral manifestos of the parties. The index denoted rile (8) summarizes their ideology according to various criteria (e.g., its position on economy, military, international relations, education, welfare, etc.). The political position of party p i is given by the rile value of the party, properly rescaled to fit our [−0.5, 0.5] normalization: q p i = rile(p i ).
In case of missing rile for a party p i , its position q p i is determined using the method discussed above, only considering a vector (S2) which is equispaced in [−0.5, 0.5] (i..e, the random assignment to the q X value is skipped). The weight matrix W is then given by the formula (S4).
In the paper we consider three different combinations of edge weight assignments and party grouping methods listed in Fig. 1A in the main text.
A signed network is structurally balanced if all its cycles are positive, i.e., if each cycle contains an even number of negative edges: in a social network context, every length-3 signed cycle of a structurally balanced network describes one of the following concepts: "the friend of my friend is my friend", "the enemy of my friend is my enemy", "the friend of my enemy is my enemy", "the enemy of my enemy is my friend", see (10) for more details. The notion of structural balance captures the idea that it is possible to split a graph into two subgraphs such that all edges on each subgraph are positive, while all edges through the cut set that splits the graph are negative. In our parliamentary network it could represent a two-party parliament or, in the electoral coalition scenario, a parliament split into two coalitions. Equivalent conditions to structural balance are (i) λ 1 (L) = 0, and (ii) there exists a signature matrix S = diag{s 1 , . . . , s n }, with s i = ±1, such that SLS has all nonpositive off-diagonal entries (11). It follows that a network G is structurally unbalanced if and only if λ 1 (L) > 0.
When a network is not structurally balanced, it is of interest to understand how "far" it is from a structurally balanced state. One idea is to use λ 1 (L) (the so-called "algebraic conflict" (12,13)), which is strictly positive for structurally unbalanced networks, to measure such a distance; however, in the literature another standard measure, called frustration index, is more frequently adopted (10,14,15). It is defined as the minimum (weighted, if G is a weighted graph) sum of the positive edges over all signature similarity transformations of L, SLS, with S signature matrix (16): = min The computation of constitutes a NP-hard problem: however, the intuition is that λ 1 (L) approximates well (up to a scaling factor) the value of the frustration index, and in particular that λ 1 (L) grows linearly with (16). Hence, they can both be used to measure the structural imbalance of a signed network. The frustration index, as defined in (S5), is also the minimum of a weighted energy functional over all possible signature matrices S. This terminology is inherited from Statistical Physics, where a (unweighted) signed graph is interpretable as an Ising spin glass, and the various spin configurations ("spin up" and "spin down" at the nodes) determine the energy of the spin glass. The least energy that can be achieved by any configuration (called the ground state) corresponds to the frustration index (S5). The definition of energy functional introduced in (10) for this purpose can be adapted to networks that are weighted. The weighted energy functional can be defined as follows, where S is a signature matrix, S = diag{s 1 , . . . , s n } with s i = ±1 ∀ i, and H = [h ij ] = ∆ −1 A is the normalized adjacency matrix. Notice that e(S) = e(−S). Notice further that by definition of normalized signed Laplacian, it follows that Hence, the weighted frustration index is the minimum of the weighted energy functional over all possible signature matrices S (i.e., again, the ground state):
As described above, each network G country, date can be partitioned into n p clusters (the political parties), with n p being the number of parties involved and gaining seats in the elections, making the adjacency matrix A a n p × n p blocks matrix. Under the assumption that all MPs of a party follow loyally and unanimously the designated party line, the definition of frustration index given in (S5) can be specialized to a party-wise (or cluster-wise) frustration index, consisting of the minimum of all the energy functionals given by (S6) over all block diagonal signature matrices S: where c i , i = 1, . . . , n p , is the number of seats gained by the party p i at the election. The difference with (S5) is that now the signature matrix S is a block diagonal matrix (with n p blocks): only the relationships between different parties, and not the ones between single MPs, are taken into account. Computing (S7) is much faster than computing (S5). In fact, all energy levels of our parliamentary networks can be exhaustively explored in a systematic way. The resulting energy landscape can be represented as histograms, having in the leftmost point the ground state energy. See Supplementary Fig. 3 for the 29 countries of Supplementary Table 1 in one of the scenarios discussed in the paper (scenario I).

S1.3 Dynamical model of decision-making in presence of frustration
Let G = (V, E, A) be a signed network whose node set V represents a community of agents. To represent a process of decision-making for these agents, we consider the following nonlinear interconnected dynamical model, previously used in (17)(18)(19),ẋ where the state vector x ∈ R n represents the decisions of the agents and A ∈ R n×n is the adjacency matrix of the network G. Each element of the diagonal matrix ∆ = {δ 1 , . . . , δ n } is given by δ i = n i=1 |a ij |, i = 1, . . . , n, while π is a scalar positive parameter representing the "social effort" or strength of the commitment among the agents. ψ(x) = [ψ 1 (x 1 ) . . . ψ n (x n )] T are sigmoidal nonlinear functions. We assume that each with unit slope at the origin, ∂ψ i ∂x i (0) = 1, and saturated behavior: lim x i →±∞ ψ i (x i ) = ±1. From previous works, such as (16,19), we know that the existence of equilibrium points is determined by the social effort parameter π: when π < π 1 the origin is the unique (and globally asymptotically stable) equilibrium point of the system (S8). When π = π 1 the system (S8) undergoes a pitchfork bifurcation (i.e., the number of equilibria "jumps" from one to three) and for π > π 1 two alternative equilibrium points x * and −x * appear, which are locally asymptotically stable, while the origin becomes unstable. Finally, when π = π 2 the system (S8) undergoes a second pitchfork bifurcation and for π > π 2 it admits multiple equilibria. In the context of social networks, where each equilibrium point corresponds to a possible decision made by the agents, the behavior of the system can be interpreted as follows: when π < π 1 the social effort of the agents is not enough to reach a nontrivial decision. When π grows past the first threshold value π 1 , the higher strength of commitment among the agents leads to two possible alternative decisions. Finally, when π > π 2 , the "overcommitment" of the agents leads to a situation in which multiple decisions are possible. We are interested in the case when π belongs to the interval [0, π 2 ], since the agents have to choose among no nontrivial decision (in [0, π 1 ]) and among two alternative nontrivial decisions (in [π 1 , π 2 ]).
The threshold values π 1 and π 2 are functions of the two smallest eigenvalues of the normalized signed Laplacian of the network, As introduced in Section S1.1, each network G country, date considered in this work is composed of n p clusters, where n p is the total number of parliamentary political parties. Nonetheless, we still expect a behavior similar to the one described in equation (S9) for the first threshold value π 1 also for the party-wise frustration of the network, whose definition was given in (S7).
This can be shown with a numerical example, where we consider a network G = (V, E, A) with n = card (V) = 500 individuals and n p clusters, representing an all-against-all scenario (scenario I), whose adjacency matrix A is hence a n p × n p block matrix described by (S1), where w ii = 1 for all i = 1, . . . , n p and w ij = −1 for all i, j = 1, . . . , n p and j = i. We decided to vary the number of parties and, for each n p , to consider 1000 (unique) randomly selected vectors [c 1 , . . . , c np ] s.t. c i ∈ [1, n] and np i=1 c i = n, where c i is the size of each party, i = 1, . . . , n p . Supplementary Figure 4 shows the results for n p = 3, 4, . . . , 20. Supplementary Figure 4A illustrates how factors such as the number of political parties and the size of each party i (c i ) influence the frustration: an increase in the number of parties (n p , left panel) or a decrease in the maximum number of MPs per party (max i c i , right panel) both lead to an increase in the frustration in average, although the variance is extremely large. Instead, Supplementary Fig. 4B shows that as the frustration of the network increases so does the threshold value π 1 . As a consequence, a higher social effort will be required from the agents to achieve a nontrivial decision.

S2 Application: from parliamentary networks to government formation
For a given country and general election, we aim to use our parliamentary networks to predict: 1. The duration of the negotiation phase that leads to the formation of a post-electoral cabinet.
2. The composition of the governmental coalition that sustains such a successful post-electoral cabinet.
In both cases we are interested only in the cabinet that is being formed immediately after a general election.
Inter-election government formation processes are often following different rules, see (20,21).

S2.1 Frustration vs government negotiation days
We are interested in the possible correlation between the frustration of each network G country, date , measured by ζ (formula (S7)), and the numbers of days between the election date and the date the government is sworn in. The rationale behind this is that when no clear majority has emerged from the electoral ballot, there is uncertainty in the composition of the candidate cabinet, and the political parties require more time in order to overcome their differences and tensions if they want to establish coalitions which can ensure a majority in the Parliament. Mathematically, the link between the two properties is given by the dynamical model described in Section S1.3. Lack of a clear electoral winner corresponds to a parliamentary network with high frustration index ζ. In our model (S8), a high frustration raises the value of the bifurcation point π 1 , meaning that achieving a nontrivial decision (i.e., giving a confidence vote to a government) requires a high "social effort", here interpreted as duration of the negotiation process among the parties. A graphical representation can be seen in Fig. 1C of the paper.
To check if this hypothesis is valid for our data, we compute the Pearson correlation (r) between ζ and the number of days between the general election and the date the government is sworn in. The higher the value for r (which ranges between −1 and 1), the "stronger" the evidence that frustration indeed influences the dynamics of the government formation process. The resulting values are shown in Fig. 2A of the main text.

S2.2 Minimum energy government coalition
For each parliamentary network G country, date = (V, E, A), the energy landscape is obtained by computing the energies in all the 2 np possible block signature matrices S = diag{S 1 , . . . , S np }, with S i = s i · I c i and s i = ±1 ∀ i. The party-wise frustration index is the minimum of such energies, as computed in (S7). Denote (S10) the block diagonal signature matrix (with more diagonal elements equal to +1 than −1) which gives the minimum of the energy functional, i.e., ζ = e(S best ). Consequently, −S best is a block diagonal signature matrix with more diagonal elements equal to −1 than +1; observe that e(−S best ) = e(S best ) = ζ. In the paper, S best is associated with "success" of a confidence vote to form a government cabinet, and −S best to "failure". Such ground state can in general be degenerate (that is, several pairs ±S best may give the same frustration index ζ). Let S best = diag{s 1,best · I c 1 , . . . , s np,best · I cn p }. The two party sets {p i : s i,best = +1} and {p i : s i,best = −1}, where p i is the i-th party, form a minimum energy partition of the set P = {p i , i = 1, . . . , n p } corresponding to (the positive and negative diagonal elements of) the block diagonal signature matrix S best .
For the case of "success" (the vast majority of our data), the intuition is that the set P best := {p i ∈ P : s i,best = +1}, which corresponds to a majority coalition of parties, should contain the possible new government coalition, plus the parties that support it in parliament without officially participating to it. In other words, P best should be a superset of the set P gov = {p i ∈ P : p i ∈ gov}, i.e., the post-electoral cabinet that actually took place.
Let S gov = diag{s 1,gov · I c 1 , . . . , s np,gov · I cn p } be a block diagonal signature matrix whose elements s i,gov , i = 1, . . . , n p , are defined as follows, To evaluate how our predictions (S best ) reflect the actually formed government, we introduce the following indexes: The closer the value of ρ gov is to 1, the better our estimate represents the actual cabinet composition. η gov represents instead how close "energetically" our guess (i.e., ζ) is to the true government energy e(S gov ). In (S12), e(S) and ζ are given by (S6) and (S7) respectively, e(S gov ) is the energy in correspondence of S gov , and S in e(S) is used as in (S7) to indicate a signature matrix with n p blocks, i.e., S = diag{s 1 ·I c 1 , . . . , s np ·I cn p }, s i = ±1 ∀ i. As already mentioned, several ±S best may give the same frustration index ζ (i.e., the ground state is degenerate). Moreover, among those, there might exist signature matrices S best determining party sets {p i ∈ P : s i,best = +1} and {p i ∈ P : s i,best = −1} with equal total number of seats, i: s i,best =+1 c i = i: s i,best =−1 c i = n 2 (equality holds in (S10)(ii)). We consider the latter as inconclusive cases, meaning that our analysis is not able to identify the possible government. More specifically, these issues are handled as follows.
(i) In presence of multiple S best and multiple valid values for ρ gov , we consider the signature matrix S best giving maximum possible value for ρ gov .
(ii) In presence of multiple S best all representing inconclusive cases for the analysis, we define S best = diag{s 1,best · I c 1 , . . . , s np,best · I cn p } as the signature matrix giving minimum possible energy while satisfying a "non-inconclusive" condition, i: s i,best =+1 c i > i: s i,best =−1 c i , that is Then, P best := {p i ∈ P : s i,best = +1}. If S best is degenerate, we follow point (i).
Supplementary Fig. 8 illustrates how often degenerate or inconclusive cases occur in scenario I.

S2.3 Frustration vs smallest eigenvalue of the normalized signed Laplacian
Our analysis is based on two observations. The first, already mentioned in Sect. S1.3, is a well-studied fact from the literature (12,13,16), namely that the smallest eigenvalue of the normalized signed Laplacian (λ 1 (L)) grows linearly with the frustration of the network (ζ). The second is that there is a high overlap between the signature of the eigenvector relative to λ 1 (L) (v 1 (L)) and the signature matrix corresponding to the ground state, which we denote S best = diag{s 1 I c 1 , . . . , s np I cn p }, s i = ±1 (S10). Notice that since the adjacency matrix of a parliamentary network is a block matrix, see (S1), then v 1 (L) is also a block vector, To check if the first hypothesis holds for our data, we calculate the Pearson correlation between the smallest eigenvalue of the normalized signed Laplacian, λ 1 (L), and the frustration of the parliamentary networks, ζ. To check if the second assumption is satisfied, we calculate the overlap between ±S best and the signature of v 1 (L), defined as where n = np i=1 c i is the total number of MPs and · 1 indicates the 1-norm. The average values of correlation between λ 1 (L) and the frustration of the parliamentary networks ζ, and the average overlap (S14) between S best and the signature of v 1 (L) (the eigenvector related to λ 1 (L)) are reported in Supplementary Table 2 for each scenario (I, II, III).

S2.4 Frustration vs fractionalization index
As shown in previous studies such as (20,22) (and as intuitively clear), parliamentary fragmentation is one of the main factors influencing the duration of the government negotiation process. Such fragmentation is often measured in terms of the Laakso-Taagepera effective number of parties (23), or in terms of the strictly related fractionalization index (24). In this section we investigate (analytically) how the frustration of the signed parliamentary networks (of scenario I) is related to the fractionalization index (which carries the same information of the effective number of parties).
The effective number of parties (denoted N 2 ) is defined (see (23)) as the inverse of the sum of squares of the shares of seats of each party, where c i is the size of the i-th party, n p is the total number of parties and n is the total number of MPs, while the fractionalization index (denoted F ) is defined (see (24)) as F = 1 − 1 N 2 . To compare the frustration of the signed networks to these indexes, we first need to rewrite the expression of the weighted energy functional e(S), see (S6), by taking into consideration that the parliamentary networks, as introduced in Section S1.1 and represented by G country, date , can be partitioned in n p clusters (corresponding to the political parties), each of size c i (i = 1, . . . , n p ). Indeed, this means that the adjacency matrix A (see (S1)) and the diagonal matrix ∆ = diag{|A|1} (introduced in Section S1.2) are block matrices. In particular, ∆ = diag{δ 1 I c 1 , . . . , δ np I cn p } where each block δ i I c i satisfies where I = {1, . . . , n p }. Then the weighted energy functional e(S), where S = diag{s 1 I c 1 , . . . , s np I cn p } with s i = ±1 ∀ i, can be rewritten as follows: where w ij is the weight between the i-th and j-th party.
In scenario I all party-party weights are negative and equal to −1 (w ij = −1 for all j = i), which implies that δ i = n − 1 for all i ∈ I and that (S17) becomes Let C + = {i ∈ I : s i = +1} and C − = {i ∈ I : s i = −1} be the two node subsets defined by a signature matrix S = diag{s 1 I c 1 , . . . , s np I cn p }, and let n C + = i∈C + c i and n C − = i∈C − c i . Notice that C + ∩ C − = ∅ and that n C + + n C − = n. Then, the calculation of the frustration of a signed parliamentary network in scenario I reduces to (S18) Equation (S18) shows that the frustration of the signed networks of scenario I is proportional to the difference between the fractionalization index F and a term which is related to the size of the minimum winning coalition. To obtain some insight on the frustration of scenario I (and in particular on the first term of equation (S18)), let P best be the solution of the minimization -or, maximization, depending on the sign -problem in (S18) (see also Section S2.2) and n P best = n 2 + E best where E best ∈ [0, n 2 ] is the number of seats in excess (with respect to 50% of the total number of seats). Then the frustration (up to a constant multiplicative term) can be written as: . (S19) In conclusion, equation (S19) shows that the frustration of the signed parliamentary networks of scenario I is proportional to the frustration index F and to the "distance" of the the majority P best (in correspondence of minimum winning coalition S best ) to 50% of the total number of seats. Supplementary Figure 9 shows the linear regression plots between the fractionalization index and the frustration of the parliamentary networks for each country and election. The average value of correlation is 0.99 (see Fig. 2D in the main manuscript). Moreover, Supplementary Fig. 9 shows that countries with a lower value of correlation (such as Albania, North Macedonia, Moldova, UK) are characterized by minimum winning coalitions S best with higher excess of seats E best .

S2.5 Description of the results
A summary of the results obtained for all the scenarios mentioned in Fig. 1A of the paper, in terms of correlation between duration of government negotiations and frustration, indexes evaluating how good our estimates of the cabinet composition are, and correlation between fractionalization index and frustration is given in Fig. 2 in the main text.
For scenario I, the number of government negotiation days and the frustration for each country are shown in Supplementary Fig. 2 panel A and B, respectively. The percentages of correct government predictions, in terms of ρ gov and η gov , are given in Supplementary Fig. 2C and S2D, respectively. Supplementary  Fig. 3 shows the energy functionals for each country and election year; the red line represents the energy corresponding to the government coalition, e(S gov ).
Regression plots (see Section S2.6 for more details on the linear regression analysis) between the government negotiation days and the frustration of the parliamentary networks with the corresponding values of correlation are shown in Fig. 3 (in the main text), Supplementary Fig. 5 and Supplementary Fig. 6, respectively for scenario I, II and III.
The correlation r country computed for each country and scenario, between the duration of coalition negotiations and the party-wise frustration of the network, is given in Fig. 2A in the main text: overall, the values of correlation for all scenarios are positive and above 0.4 with few exceptions which often admit a clear explanation and will be discussed in Section S2.7. In scenario III we consider 10000 different values for the political positions (fixed in time: the same for all elections) in the left-right scale, as explained in Section S1.1: for each country, the "optimal" choice of positions is identified as the one giving the best value of correlation, depicted in Supplementary Fig. 1C with a blue circle. This value is then used in Fig. 2 (scenario III) and Supplementary Fig. 6. As can be seen in Supplementary Fig. 1C, the positions we assign to the left-right grid significantly affect the correlation, hence the optimal r country may be far from the average of the correlations obtained for each country. This could also explain why the results obtained in scenario II are worse, in terms of correlation, than the ones obtained in scenario I, where the networks we consider are unweighted.

S2.6 Influential points of the regression are important
Consider the "frustration vs. days" regression plots for a country (depicted in Fig. 3 in the main text, Supplementary Fig. 5 and Supplementary Fig. 6 for scenarios I, II and III), and let x date and y date be, respectively, the party-wise frustration of the network G country, date and the duration of coalition negotiations after the election specified by "date". We say that a point (x date , y date ) is an outlier for that country if the value of y date does not follow the linear regression line, meaning that this value is unusual given x date . Instead, it is a high leverage point if it has "extreme" x date value, i.e., this value is unusual given y date . Finally, we say that the point is influential if it influences the slope of the regression line. See (25,26) for a detailed explanation of outliers, high leverage and influential points. Tests such as residuals, leverage and delete-1 statistics are used to identify the possible outliers, high leverage and influential points. In practice, given the linear regression model, outliers are observations whose studentized (also denoted externally studentized or studentized deleted) residuals are greater than 3 in absolute value and whose standardized (or internally studentized) residuals are greater than 2 in absolute value. Observations whose leverage statistics have values greater than 2p N , where p = 2 is the number of regression coefficients and N is the total number of observations (in this case the number of elections considered for each country), are identified as high leverage. Finally, observations whose Cook's distance is greater than three times the average Cook's distance, and whose Dffits (Difference in fits) values are greater than 2 p N , are identified as influential points. We are particularly interested in observations marked as outliers and as both high leverage and influential, because they often represent unexpected events or difficult situations, in terms of either frustration or government negotiation duration, or both. In the vast majority of cases indeed they correspond to both high frustration and long negotiation times.

S2.7 A brief discussion on national rules and traditions influencing the duration of the government negotiation talks
It is beyond the scope of this paper to make a thorough analysis of the additional factors influencing the duration of coalition negotiations, and we refer the reader to (27)(28)(29)(30). However, to shed some light on the systematic differences in the government negotiation times across the various countries (see Supplementary  Fig. 2A), it is worth mentioning that the countries characterized by "negative" parliamentarism tend to have short cabinet formation processes. We say that a certain country has "negative" parliamentarism if the government (in order to rule) does not need to win a vote of confidence in the Parliament (as in the UK), or if the majority of the parties does not vote against it in the Parliament (as in Sweden), while it has "positive" parliamentarism otherwise (30). The presence of minority governments and, most importantly, average short government formation processes is related to countries having "negative" parliamentarism: for instance Denmark, Finland, Iceland, Norway, Sweden and United Kingdom, see (20,28,30) and Supplementary  Fig. 7B. In other countries the duration of the negotiation period is defined (and limited) by the constitution. It is worth observing that Estonia and Greece, two of the three countries showing a negative correlation between frustration and negotiation days in our scenario I and II, are among them. In Estonia, according to Article 89 of the Constitution, a limited time is given to the candidate Prime Minister to form a new Government: the President has 14 days to appoint a candidate Prime Minister, who in turn has to win a confidence vote in not more than 24 days. In case of failure the President can nominate (within 7 days) another candidate and the procedure repeats. Again, in case of failure, the Parliament nominates a candidate who has 14 days to win a vote of confidence. For Greece, as Article 37 of the Constitution states, the leader of the party with relative majority receiving from the President of the Republic the task to form a coalition (that has to enjoy the confidence of the Parliament) has 3 days to succeed. In case of failure, the task is given to the leader of the second, and then third, largest party in the Parliament. If all the rounds of government negotiations fail new elections are called.

S2.8 A brief discussion on elections resulting in a hung parliament
It is interesting to describe in some detail some cases of hung parliament mentioned in the main manuscript, whose corresponding data points in Fig. 3 (for scenario I, Supplementary Fig. 5 and 6 for scenarios II and III) are both influential and high leverage points.
The 2006 Czech election saw a perfect partition of the parliament into parties of the left, Czech Social Democratic Party (CSSD) and Communist Party of Bohemia and Moravia (KSCM) (that together won 100 of the 200 seats), and centre-right parties, Civic Democratic Party (ODS), Green Party (SZ) and Christian and Democratic Union -Czechoslovak People's Party (KSU-CSL) (that collectively won the other 100 seats) (31). In our framework, a parliament split into two identical halves represents a degenerate situation which escapes classification: the frustration can be very low but no majority exists. Indeed in our method the partition mentioned above corresponds to the ground state, i.e., our S best consists of exactly 50% of + and 50% of −. The duration of the negotiation process cannot be predicted in degenerate cases like this because the two "real-life" equal size factions are also matching ideological polarization.
The 2016 and 2020 elections in Ireland, unlike the previous elections, resulted in no clear majority (or possible government coalition) and produced instead the most fragmented Dáils in history (which explains the higher levels of frustration): the number of parties in the parliament increased to 12 (from an average of 8 in the previous elections) and, while in the previous elections the percent distance between the first two parties (i.e., difference between their shares of seats in the parliament) had been at least of 19%, in the following elections it decreased, with the two biggest parties differing by as little as 3.2% in 2016 and 2.3% in 2020. However, differently from the 2016 election, in the 2020 election three parties (Fianna Fáil, Sinn Féin, Fine Gael) won roughly the same number of seats, which is reflected in a fractionalization index (or effective number of parties, see (S15)) for the 2020 election higher than the one for the 2016 election: this meant that, for the first time, at least three parties were needed to form a majority coalition (32). After the 2016 election, most of the parties did not want to participate in the government coalition and after 70 days of negotiations a "confidence and supply" deal was signed between Fine Gael and Fianna Fáil, with Fianna Fáil abstaining from voting against Fine Gael (33), while after the 2020 election, both Fine Gael and Fianna Fáil did not want to collaborate with Sinn Féin and decided instead to form a grand coalition with the Green Party.
In Spain, after the 2015 general election no agreement was reached between the parties before the deadline imposed by the Article 99 of the Spanish constitution (corresponding to two months from the first vote for investiture). A snap election was then called in June 2016 and after 131 days the Rajoy II government, composed by members of the People's Party (PP) and independents, was sworn in. Single-party (minority) governments have always been common in Spain, however these elections saw a change from a nearly twoparty system, i.e., majority of votes won by two parties, PP and Spanish Socialist Workers' Party (PSOE), to an effectively multi-party system (34) which increased the complexity of the cabinet formation process. Similarly, the government negotiations failed after the April 2019 legislative election, and the King had to call new elections in November 2019, which gives us a second "failure point" for Spain. In 2017 in Germany 171 days passed from the election date before the Merkel IV cabinet was sworn in. Neither of the possible coalitions, Christian Democratic Union/Christian Social Union in Bavaria (CDU/CSU) and Free Democratic Party (FDP) or Social Democratic Party (SPD) and The Greens (GRÜNE), obtained a majority of seats in the parliament, while a new party, the far-right Alternative for Germany (AfD), managed to enter the parliament for the first time (35). Since none of the parties wanted to collaborate with AfD, a compromise between parties with different ideological views had to be found: after a failed attempt to form a "Jamaica Coalition" (CDU/CSU, GRÜNE and FDP) the new government comprised a grand coalition between CDU/CSU and SPD.

S2.9 A brief discussion on elections where the government negotiations failed
In our analysis of government formation, most of the legislative elections (255 out of 260 elections) are followed by successful cabinet negotiation talks, after which a cabinet is approved by the parliament and sworn in. In three countries, Czech Republic, Greece and Spain, we found however instances of failure of the government negotiation talks, in the form of a failed vote of investiture or expiration of the deadline set by the Constitution.
In the Czech Republic the candidate government needs to pass an investiture vote (of simple majority) within 30 days after its appointment (Article 68 of the Czech Constitution). In 2006, Topolánek (leader of ODS) decided to form a minority government even without managing to secure support from the other political parties (31). Topolánek's first cabinet was sworn in on September 4 but lost a confidence vote on October 3, and cabinet negotiations had to restart. The deadlock was broken only after 220 days, thanks to the abstention of some MPs fromCSSD, and the Topolánek II cabinet (centre-right coalition of ODS, SZ and KSU-CSL) was sworn in (31). A similar situation (failure and then success at the same election) occurred again in the 2017 Czech election. In 2017, none of the political parties wanted to cooperate with Babiš due to the criminal fraud charges he was facing (36) and the Babiš first cabinet (ANO 2011 only), formed on December 13, failed to pass an investiture vote on January 16. In the cabinet negotiations that followed, ANO 2011 managed to reach a coalition agreement withCSSD and to obtain external support from KSCM, and after 249 days the Babiš second cabinet was sworn in.
In Greece after the May 2012 legislative election none of the three leaders tasked to form a government managed to negotiate a cabinet coalition and, following the Article 37 of the Greek Constitution (see also Section S2.7), 10 days after the election day a caretaker cabinet was appointed and new elections were announced for June.
In Spain, see Article 99 of the Spanish Constitution, if the candidate government does not succeed in obtaining the confidence of the parliament (i.e., if it loses both a first vote of absolute majority and, 48 hours after, a second vote of simple majority) then a new candidate cabinet can try to obtain the confidence of the parliament. If within two months after the first vote for investiture no cabinet has managed to win a vote of confidence, the King can call new elections. After the 2008, 2016 and November 2019 elections the candidate cabinets managed to win the confidence of the parliament (with a vote of simple majority) while, after the 2015 and April 2019 elections, the government negotiations failed and the King had to call new elections.
For each of these three countries, Supplementary Fig. 7A reports the election dates, the government sworn in dates and the government negotiations failure dates, determined for the Czech Republic as the date the cabinet (which later failed to pass the investiture vote) was formed, for Greece as the date the caretaker cabinet was sworn in, and for Spain as the date corresponding to two months after the first vote for investiture. Figure 3 in the main text plots the duration of the government negotiation talks (calculated as number of days between the election date and the sworn in date and denoted days, see Supplementary Fig. 7A) vs the frustration of the parliamentary networks, for scenario I (scenario II and III are reported respectively in Supplementary Fig. 5 and Supplementary Fig. 6). For Czech Republic, Greece and Spain, the blue data points (and corresponding regression line and value of correlation) correspond to elections followed by successful votes of investiture (the May 2012 Greek election and the 2015 and April 2019 Spanish elections are hence excluded), while the yellow data points (and corresponding regression line and value of correlation between parentheses) include all the elections: in this case the variable days indicates the number of days between the election date and the government negotiations failure date (see Supplementary Fig. 7A).

S2.10 Analysis of the type of governments formed after the elections
We distinguish between four types of governments (two being minority governments, two majority) that may be formed after a legislative election: first, we consider minority governments where the cabinet coalition has a strict minority in the parliament; second, minority governments whose coalition of parties holds exactly half of the seats in the parliament; third, majority governments which are minimal winning coalitions; and last, majority governments which are surplus coalitions. A coalition of parties is minimal winning if removing a party implies loss of majority in the parliament (37), and it is denoted surplus otherwise. Supplementary Fig 7B shows  In Scenario I, computing the frustration is equivalent to find the minimum winning coalition (represented by the group of parties achieving majority in S best ), that is, a coalition of parties that is minimal winning and also minimizing the functional e(S), meaning that between all possible minimal winning coalitions it is the one with the lowest amount of total MPs. The expectation that governments should be minimal winning is standard in the literature (20,37), even if it has been recently observed that, in reality, it is not uncommon for minority or surplus governments to form (38,39).

S2.11 Analysis of the Italian bicameral parliamentary system
Under the bicameral system of Italy the candidate cabinet needs to win the confidence of both the Chamber of Deputies and the Senate of the Republic (40). In what follows we extend the results obtained for the Chamber of Deputies by considering also the network described by the parties winning seats in the Senate of the Republic.
For each election let G C and G S indicate the signed networks of the lower and upper chamber, respectively, and let the party set be defined as P = P C ∪ P S , where P C = {p i : p i ∈ Chamber of Deputies} and P S = {p i : p i ∈ Senate of the Republic}. For each subset P(S) of P described by the party configuration S = diag{s 1 , . . . , s card(P) }, where s i = 1 if the party p i belongs to the subset P(S) or s i = −1 otherwise, we define the energy of the configuration S as the couple [e C (S C ), e S (S S )], where S C (S S ) and e C (S C ) (resp. e S (S S )) indicate the corresponding party configuration and energy functional (S6) of the network G C (resp. G S ), that is S X = diag{s 1 · I c 1 , . . . , s card(P X ) · I c card(P X ) }, s i = +1, p i ∈ P X ∩ P(S) −1, p i ∈ P X \ (P X ∩ P(S)) , X ∈ {C,S}, where c i is the number of seats won by party p i (correspondingly in the Chamber or the Senate), and where L(G X ) indicates the normalized signed Laplacian of the network G X . We say that a party configuration S is a majority configuration if its parties hold the majority of seats in both chambers of the parliament, that is, if i: p i ∈P C ∩P(S) c i > 630 2 and i: p i ∈P S ∩P(S) c i > 315 2 , where 630 and 315 are the total number of seats in the Chamber and Senate, respectively.
For each election, the energy of all configurations S is depicted in Fig. 6 in the main text, which shows the values e S (S S ) vs e C (S C ). Left column: average correlation between the frustration of the parliamentary networks ζ and the smallest eigenvalue of the normalized signed Laplacian λ 1 (L). Right column: average overlap between S best and the signature of v 1 (L), the eigenvector associated to λ 1 (L), as defined in equation (S14). left q L = −q R centre-left to left q CLL = −q CRR centre-left q CL = −q CR centre to centre-left q CCL = −q CCR centre q C = 0 centre to centre-right q CCR centre-right q CR centre-right to right q CRR right q R right to far-right q RFR far-right q FR = +0.5 big tent d BT Here the corresponding correlation values for each set are shown (gray circles), together with the overall country mean value (red diamond) and maximum value (blue circle). For each country, the optimal choice for the weights corresponds to the one giving best correlation index (blue circle).  Table 1. Observe that to be classified as "majority" a cabinet coalition needs to hold (strictly) more than half of the seats in the parliament.

Supplementary References Scenario
Supplementary Figure 10. Leave-the-last-one-out analysis and linear regression plots between the duration of the government negotiation talks (days) and the frustration of the parliamentary networks in scenario III, for all countries. The last election (red circle) is used for the validation set while the remaining elections (yellow squares) are used to calculate the optimal choice of political positions in the left-right grid (see Fig. 4 in the main paper). A yellow dashed line represents the regression calculated on the first N − 1 elections, while a red dotted line the regression calculated on all elections. The corresponding values of correlation r are reported in the plot heading.