Introduction

Social networks have become unavoidable tools in modern democratic elections. They have dramatically changed the way politicians interact with their electorate, allowing campaigns to connect with electors, mobilize supporters and activists, and spread their message faster, more easily and over a larger range than ever before. From that point of view, social networks are new communication platforms that strengthen the democratic dialogue. Simultaneously, by their very structure and dynamic, social networks facilitate the fast and massive dissemination of information that is often hard, if not impossible to verify. As a matter of fact, there is a darker side to social networks and their use in democratic processes, which goes by the name of computational propaganda1,2,3,4. This novel kind of political manipulation is based on bots—software-created and -operated, automated social media accounts. Large number of bots generate colossal amounts of contents so fast, that it is virtually impossible to determine what is right and what is not. Indeed, fake news appear legitimate when repeated sufficiently often, because human perception is that so many ”people” cannot be all lying simultaneously. Bots manipulate online discussions and change people’s perceptions of political issues and entities5. There are accumulating examples of massive uses of bots in recent political campaigns. Bots seem to have been used intensively to try and influence people’s perception of UK’s role in the European Union during the 2016 Brexit campaign6. In the 2016 US presidential election, social media platforms have been used to spread large amounts of false information4,7. In the 2017 UK general election, the Labour Party used bots to spread electoral messages on Tinder4, while the incumbent candidate Jair Bolsonaro massively used social media to spread targeted information in the 2018 Brazilian presidential election8. Both the ruling Bharatiya Janata Party and the Indian National Congress widely used online misinformation in their campaign strategies in the 2019 Indian general election9. Last but not least, false claims of democrats stealing the election were disseminated by the incumbent candidate Donald Trump and his supporters, following the 2020 US presidential election. There are several other known cases.

Social media users make about 60% of the world’s population, therefore it can be expected that attempts to manipulate elections through social networks are going to multiply. While the true impact of computational propaganda on past elections is hard to measure, evidence exist that emotions can be transferred through social media10 and in particular from bots to humans11. One may therefore expect that well targeted computational propaganda efforts can have a significant effect on election results. As but one example, the Labour Party won several electoral constituencies by narrow margins in the 2017 UK general election. This has been attributed to computational propaganda efforts by some4. The main efforts against the emergence of computational propaganda and the associated threat to democratic processes worldwide has been to try and construct fast and efficient ways to identify bots from standard human accounts, and to regulate social networks into banning bot accounts. Two altogether different lines of action in the fight against computational propaganda are (i) to try and identify the social characteristics of an electorate that makes it more resilient against opinion manipulation and (ii) to determine which of the existing democratic electoral systems is the most robust to external influences. These are the two issues we investigate in this paper. To the best of our knowledge, these important questions have rarely been addressed within the framework of computational social science12,13, with the very recent exception of Raducha et al.14.

To that end, we construct a mathematical model of computational social science, where voters have an opinion encoded in a multi-dimensional vector agent. Each component of that vector measures the affinity that the voter has for a given political party. In our dynamical model, these components evolve according to the voter’s natural opinion—the one they would have if they were left in isolation—and social interactions among voters. In the spirit of the Deffuant15 and Hegselmann-Krause16 models of opinion dynamics, these interactions exist only between pairs of voters with opinion vectors within a certain distance in opinion space. That distance is a parameter of the model, mimicking the openness of the electorate to differing opinions. The mathematical model determines the voter final opinions. The outcome of an election is next extracted from the latter through a procedure that reflects different electoral processes.

External influence from computational propaganda is then modeled as a targeted shift in some agents’ natural opinion. The magnitude of this shift is increased, until the electoral outcome changes. A qualitative measure of robustness of the election process is the magnitude of the effort needed to change the election outcome: more robust social populations and electoral systems do not change their vote until larger manipulation efforts are applied. We determine the dependence of that robustness for different electoral processes and populations with different social characteristics. The latter are encoded in the distribution of natural opinions—allowing to tune between populations with homogeneous to polarized opinions, to multi-party populations, with or without electoral bias towards one or several parties—and in the opinion distance over which voters interact with one another—modeling the tolerance and openness they have to different views and opinions.

Our model amplifies on but goes far beyond existing voter and opinion dynamics models, such as Abelson’s17 or Taylor’s18 models. It encompasses several characteristics that were present only individually in some models so far, such as the finite interaction distance between agents15,16, opinion vectors with dimension larger than two15,19,20,21,22,23, each of which representing a potential party affiliation, and the natural opinion that a voter would have, were they not interacting with other voters18. This latter characteristic, in particular, protects our results from artificial features of opinion dynamics models with finite confidence bound, such as consensus and fragmentation24, that are unrealistic in the present context. It furthermore allows to model different populations with varying degrees of opinion polarization and initial partisan bias, and to investigate the influence of the latter on electoral processes and their robustness. One key new ingredient in our model is that it generalizes consensus-like dynamics to multidimensional spaces of agents, where each dimension corresponds to one of several political parties. Non-trivial is to order parties from left to right without biasing in favor of one or the other. This aspect is explicitly incorporated in our model, as discussed in the Methods Section and the Supplementary Information. Finally, we go beyond standard voter and opinion dynamics models by defining outcome functions modeling different electoral processes corresponding to different democratic countries and/or elections for different branches of government25.

Quite expectedly, we find that partisan population with significant biases towards one or few parties are resilient against opinion manipulation. This is so, because inverting the election outcome requires to change the opinion of large numbers of voters (see Supplementary Information). More interesting are unpartisan populations with no or only weak partisan bias, and we focus on this case here. Our results are that, first, voter populations are more resilient against external opinion manipulations (i) if they have less polarized voter opinion distributions and (ii) if they are more open to different opinions, i.e., when voters interact with each other regardless of their difference in opinion. Second, applying our model to different electoral systems, we find that systems with proportional representativity are the most robust to external influences, agreeing with the recent results of Raducha et al.14. These results emphasize in particular the need to encourage public debates during political campaigns, to strengthen democratic processes. They further suggest to turn to systems where representatives are attributed proportionally to the votes received by each party, at the level of electoral units corresponding to several aggregated, formerly single-representative districts.

It should be stressed right away that our model is not meant to predict, nor to quantitatively model democratic electoral processes, but rather to extract electoral trends that can be attributed to general social characteristics of voter populations or to specific electoral modalities. In that spirit, the model is qualitatively validated as it reproduces the observed volatility of the US House of Representatives elections from 2012 to 2020. We think this is quite remarkable, in particular given the notorious difficulty to validate results in computational social science26,27,28.

Results

Many different dynamical models of opinion formation in computational social science have been proposed over a remarkably long history15,16,17,18,29,30,31,32,33,34,35,36,37. Most exhibit unrealistic behaviors such as consensus—all agents end up having the same opinion—or fragmentation—agents have one of a handful of different, discrete opinions. Such behaviors are not observed in real life, where it is obviously uncommon for many different people to have exactly the same opinion on a given, complex topic. Furthermore, even when models are free of such shortcomings, there are rather few direct validation against real-life data and observed social phenomena27,28,38,39. Quite often, comparisons are indirect and statistical in nature35,40, an important part of the difficulty being to translate a mathematical object—an agent’s opinion vector—into an observed sociological quantity. Any new model of computational social science should address these issues. Our model is presented in detail in the Methods Section and the Supplementary Information. It successfully meets these two challenges. The absence of consensus and fragmentation is guaranteed by the presence of a natural opinion that agents would have, were they isolated from their peers (see the Methods Section). Validation is obtained by direct comparison between historic US House of Representatives elections and numerical simulations, taking into account different initial partisan biases in different electoral districts, reflecting the outcome of the previous election cycle. This validation is discussed in the next paragraph, following which we will present our results on the robustness for different electoral systems and electorates with various social characteristics.

Figure 1
figure 1

Volatility of US house of representatives elections. (a) Color plot of historical percentage of party change (Republican to Democrats or vice versa) for the 435 US congressional districts over the 2012 to 2020 elections41. (b) Color plot of electoral volatility of the 435 US congressional districts, numerically calculated from our model. (c) Historical percentage of party change (black dashed line) vs. numerically calculated volatility (red solid line) for the 435 US congressional districts (in alphabetical order on the horizontal axis). There is a Pearson correlation coefficient of 0.65 between the two sets of data.

Model validation

Model validation requires comparison between numerically obtained data and real life, measurement data. For the latter, we took the US House of Representatives electoral outcomes from 2012 to 202041, i.e., a complete election sequence in between two consecutive census-based redistrictings. Reproducing precise percentages of votes for the Democrats or the Republicans within districts obviously lies beyond the reach of any mathematical model. However, trends indicated by the number of times the winning party changes from one election to the next in a given district may be captured. In that spirit we define electoral volatility, first historically—i.e. considering real, past elections—as the fraction of times the winning party has changed in a sufficiently long sequence of elections and second numerically as the easiness with which an election can be overturned in our model. We compare historical volatility of the US House of Representatives elections with numerical volatility, calculated over an ensemble of election sequences (see Supplementary Information). The comparison between the historical number of winning party reversal and the numerically computed volatility is shown in Fig. 1. Obvious differences exist, however, the two sets of data look overall similar, which is confirmed by a Pearson correlation coefficient of 0.65, indicating a rather high cross-correlation between them. We conclude that our model captures the main trends and features of real elections. Given the low number of independent parameters in our model, we take this as a successful validation test.

Bipartite system

Modeling an electoral process proceeds in two steps. In the first step, opinions are formed. In the second step, an electoral outcome is defined from these opinions. The first step depends on parameters that model sociological characteristics of the voter population, such as the polarization and a priori partisan biases of natural opinions, as well as the openness of the voters to different point of views, modeled here by the interaction distance \(\epsilon \) (see Methods Section). The second step models different electoral systems existing in different democratic countries or for different branches of government—executive, legislative and judiciary25. To understand which sociological aspects of a voter population influence electoral robustness and how, and which electoral system is more robust, we would like to identify the impact of each aspect on the robustness of the outcome of an election, independently of other biases. We first focus on the influence of sociological characteristics of the electorate on electoral robustness (see the Methods Section).

Figure 2
figure 2

Robustness of bipartite elections versus opinion polarization and openness in a single electoral unit. Color plot of the effort needed to invert the outcome of a single-representative electoral system in a single electoral district versus the polarization \(\Delta \) of natural opinions and the voter interaction distance \(\epsilon \). The effort is averaged over 500 realizations of natural opinions from unbiased distributions with a standard deviation \(\sigma =0.2\) (see the Methods Section), for an electoral district with \(N=2001\) agents.

Our first result is that introducing significant biases through the parameters \(\mu \) and \(\rho \) in Eq. (12) results in clear-cut election outcomes that are very hard to invert. Our first, not unexpected result is therefore that partisan populations are quite resilient against opinion manipulation. This is a relatively trivial result, as significant electoral biases result in clear-cut elections with a comfortable voting margin between winning and losing parties. Reversing the electoral outcome accordingly requires to change the opinion of large numbers of voters. Details are discussed in Section V of the Supplementary Information.

More interesting are unbiased, or weakly biased electoral populations and we focus on them from now on. Figure 2 makes it clear that unpolarized (with low \(\Delta \)), open (with large interaction distance \(\epsilon \)) voter populations are more robust to external influence. As a matter of fact, inverting the outcome of an election in a bipartite system is more efficiently achieved by flipping the opinion of few weakly opinionated voters—those whose opinion vectors lie close to the neutral opinion \(\textbf{x}=(0.5,0.5)\). Shifting the opinion of these voters is then easier if voter-voter interactions connect them to only few other voters. In graph theoretical vocabulary, a larger robustness is expected if weakly opinionated voters lie in a high connectivity region of the voter-voter interaction graph. Connectivity is higher both in the absence of polarization, because then the density of voters close to the neutral opinion is maximal, and with long-range voter-voter interaction, which obviously connects more voters to one another. This reasoning qualitatively explains the results presented in Fig. 2. In the Supplementary Information, further data are presented giving the effort needed to invert the electoral outcome for biased opinion distributions (see Fig. S6).

We next investigate the robustness of different electoral systems for a fixed distribution of natural opinions. We compare the effort needed to change the outcome of the proportional representative (PR), winner-takes-all (WTA) and single representative (SR) systems, which are three of the main democratic electoral systems (see the Methods Section). To compare them as fairly as possible, we construct ensembles of synthetic countries made of between 16 and 20 states, each of which electing between 3 and 15 representatives. In the PR and WTA systems, representatives are attributed either proportionally to the percentage of votes obtained by each party (PR) or all to the winning party (WTA), depending on the electoral result at the state level. In the SR system, only one candidate is elected in each state, independently of its population. To make the election more realistic, a partisan bias is introduced, which randomly favors one or the other party in each state/district, with a difference of votes not exceeding 10%. The bias is introduced in either a shift of the distribution of natural opinion away from zero average [the parameter \(\mu \) in Eq. (12)], or a weight bias in the case of a polarized, bigaussian distribution [the parameter \(\rho \) in Eq. (12)]. This allows us to explore different distributions of natural opinions. Details of the procedure are described in the Methods Section.

Figure 3 shows that the PR system is on average the most robust and the SR the least robust to external influence. This is so regardless of the distribution of natural opinions, including the nature of the random shift giving the initial electoral bias, or the interaction distance between voters. Furthermore, and consistent with the results shown in Fig. 2 the average robustness is in all cases a monotonously increasing function of the interaction distance, regardless of the electoral system. Figure 3 furthermore shows that, beyond the average robustness, the most resilient electoral system is the PR system in about 65% of the 1500 statistical realizations of synthetic countries we considered, the WTA system in about 25% and the SR in less than 10% of those cases. In the Supplementary Information, these results are corroborated by similar data obtained for a model of the US House of Representatives election, calibrated as in Fig. 1 (See Fig. S7). Our results remarkably agree with the conclusions of Ref.14, where the authors independently performed a similar study based on a completely different approach.

Figure 3
figure 3

Robustness of different bipartite electoral systems versus openness in synthetic countries. Average effort to change the election outcome for different electoral systems with respect to the opinion distance over which voters interact with one another, for three different types of voter population and for the proportional representative (red curves), winner-takes-all (orange) and single representative (yellow) electoral systems. The average is calculated over an ensemble of 1500 numerically generated synthetic countries. Top panels: (a) unshifted polarized distribution with biased weight; (b) shifted polarized distribution with equal weights; c shifted, unpolarized distribution. In all cases, biases are introduced to favor one or the other party by a percentage randomly distributed between 0 and 10%. Bottom panels: probability for each system to be the most (red) the second most (orange) or the least robust (yellow) of the three systems.

Multipartite system

We now turn our attention to elections with more than two parties. In this new case, robustness is quantitatively measured by the minimal effort to make the first runner-up win the election. The Methods Section describes how we extend our bipartite system—which belongs to the class of one-dimensional continuous opinion dynamics models29,30,31,32—to models of interacting agents with opinion vectors of dimension larger than two. Each component of an opinion vector measures that agent’s affinity with the corresponding party. Political parties differ from the more conceptual issues considered so far in the literature on multidimensional opinion dynamics 15,19,20,21,22,23 in that they are ordered from left to right. Accordingly, we need to define an opinion distance metrics that takes this ordering into account. In particular, the distance between the extreme left- and right-wing parties corresponds to maximally different political opinions and must therefore be larger than the distance between any other pair of parties. Enforcing that condition however reduces the opinion volume of left- and right-wing parties, compared to centrist parties. If uncompensated, this reduction of volume would increase in its turn the density of voters, making extremist parties more attractive under the dynamics of our model. To remove that artifactual effect, we reduce the volume occupied by all parties. The procedure to do so is constructed and discussed in detail in the Supplementary Information. It guarantees that there is no artifactual bias in our model.

Figure 4
figure 4

Robustness of a 6-party system versus openness in a single electoral unit. (a) Effort needed to overturn a 6-party election under the single representative electoral system, in a single electoral unit (solid black curve). The total effort is broken down into partial efforts corresponding to overturns in favor of a centrist (dashed yellow), a moderate (dashed orange) or an extremist (dashed red) party. The total effort is dominated by the effort devoted to overturns in favor of an extremist. (b) Percentage of wins (top panel) and of second place (bottom panel) for each party in the absence of external influence. Different colors correspond to different parties in a left-right order when going from yellow to dark red. Larger interaction distances favor centrists parties. Results for different number of parties (presented in the Supplementary Information) corroborate this trend.

In this paragraph we focus on 6-party systems. Similar results are obtained for systems with 3–7 parties (see Supplementary Information, Figs. S8 and S9), indicating that general features and trends of robustness do not depend on the number of parties.

We first consider an election in a single electoral district. Figure 4 shows the effort needed to change the election outcome in a single electoral unit with six parties (black solide line) as a function of the interaction distance \(\epsilon \). One sees that, unlike the two-party case, the effort is here nonmonotonous in \(\epsilon \). This is however an artifact of having extremist parties connected to few neighboring parties when \(\epsilon \) is small, as we next proceed to argue.

Our models are symmetric in that the percentage of wins, of second, third aso. place finish are symmetrically distributed over parties ordered from 1 (leftmost) to 6 (rightmost). This is shown in Fig. 4b. Figure 4a further breaks down the effort needed to change the election result when the first runner-up—the would-be winner once sufficiently strong external influence is turned on—is an extremist (party 1 or 6), a moderate (party 2 or 5) or one of the two central parties (3 and 4). It is clearly seen that, up to \(\epsilon \simeq 0.45\), almost all the average effort needed to overturn an election corresponds to those cases where the first runner-up is an extremist. This is so, because inter-agent interactions are attractive and symmetric. Therefore, attracting moderate voters toward extremist parties simultaneously attracts extremist voters toward moderate parties. Because extremists have such attraction only on one side of their opinion volume, they are more easily pulled toward the center than moderate parties are toward extremes. This effect results in a much larger efforts to overturn an election in favor of an extremist party. Once the extremist contribution is subtracted from the effort, the latter is essentially monotonous in \(\epsilon \), as in the bipartite system.

Figure 5
figure 5

Robustness of different electoral processes for a 6-party system versus openness in a synthetic country. Percentage of first- (dark red), second- (orange), third- (yellow) and fourth-rank (light yellow) robustness for the proportional representative (PR), the winner-takes-all (WTA), the single representative (SR) and a fourth system, not existing for two-party systems, the proportional ranked choice voting (PRCV) electoral systems vs. the interaction distance \(\epsilon \). Percentages are calculated over 15000 random realizations of synthetic countries with different number of electoral units.

The second dominant trend observed in Fig. 4 is that larger interaction distances, \(\epsilon \gtrsim 0.45\), exclusively favor centrist parties, which is expected in a system with sufficiently long-range, attractive interactions.

We finally compare different electoral systems over the same set of synthetic countries considered for the bipartite system. Figure 5 shows the percentage of first-, second- and third-rank robustness for the proportional representative (PR), the winner-takes-all (WTA), the single representative (SR) and the proportional ranked choice voting (PRCV) electoral systems, as a function of the interaction distance \(\epsilon \). It clearly shows that the PR system is the most robust, most of the time, with a percentage of first-rank robustness starting slightly below 50% at small \(\epsilon \) and increasing to about 65% with increasing \(\epsilon \). The second most robust system is the PRCV system, if judged from first-ranked robustness. Note however that it is the least robust about 30% of the time. As for the bipartite case, the WTA system is more robust than the SR system.

Discussion

The process that eventually leads to an electoral result is complex. It depends on both the electorate—in particular its polarization, its electoral bias and openness to different opinions—and the electoral system itself—which translates voter opinions into an electoral outcome. Real elections cannot be reproduced under different conditions, it is therefore virtually impossible to disentangle the impact that each of these has on electoral processes. Well constructed models of computational social science can help identify what impact specific characteristics of voter populations and of different electoral systems have on electoral outcomes, as well as the robustness thereof against targeted external influences. Such assessments are particularly interesting, given the recent rise of computational propaganda1,2,3,4. Indirect electoral manipulation through the automated generation and spread of fake news is hard to stop, since it takes less time to create bots account in social networks than to identify and neutralize them. Therefore it is highly desirable to find complementary measures, beyond social network regulation, to try and mitigate the impact of computational propaganda on democratic elections.

This manuscript contributes to this program in several ways. To the best of our knowledge, it is among the first of its kind (with14) in computational social science to try and evaluate the robustness of different, democratic electoral systems. To do so, we constructed a model of opinion dynamics derived from the standard model of Taylor18. We included significant additions and modifications to make it realistic, in that it avoids reaching full consensus or fragmentation. Different voter populations have been considered, that depend on few parameters translating social traits such as voter polarization, or their willingness to debate with voters of strongly differing opinions. These characteristics are encoded in different distributions of what we called natural opinions—the opinion that voters would have, were they not interacting with others, nor subjected to external influence—and on a distance over which voters interact with one another in opinion space. We furthermore extended Taylor’s model18 to account for the existence of more than two political parties. Compared to earlier constructions, ours takes into account the ordering of parties, from left to right. Last but not least, we introduced a minimal model for external influence, whose magnitude can be tuned until election outcomes are overturned. In this way, electoral robustness can be quantified.

It can certainly be argued that no mathematical model can capture the whole complexity of human opinion dynamics. Instead, our goal in this manuscript has been to identify trends, i.e., how each of the few parameters defining our model impacts the robustness of the electoral outcome. Our first result of importance has been to validate our model against historical data. In particular, we reproduced the volatility of the US House of Representatives elections. Such validations are rare in computational social science and this is the first important result presented in this manuscript.

In this paper, we focused on unbiased or weakly biased elections—our goal was to isolate the importance of various social and electoral characteristics, other things being equal. This is of course not realistic, as no electorate exist with equal distributions of natural opinions in favor of each party. We have commented that significant electoral biases strengthen electoral results, because in their presence, more voters need to change their opinion to change the electoral outcome. A related issue of importance is that of gerrymandering, where electoral districts are drawn to favor one party over the others. A brief comment in the Supplementary Information shows that, at least in the case of an priori close election, with two parties of similar strength, gerrymandering increases electoral robustness, because it introduces bias.

In terms of the opinion landscape, we found that election outcomes are more robust in less polarized societies—this is illustrated in Fig. 2. Interactions between agents have a structuring effect on the final opinions and in a more connected society, opinions become more rigid, due to the density of the interaction network. Increasing the interaction distance between voter’s opinions naturally makes the electoral process more robust against external influence. In other words, opinions formed by interactions with many other voters, with strongly differing opinions are harder to influence. Simultaneously, a similar reasoning explains that the more a society is polarized, the less it is robust against external influence. Indeed, polarizing an electorate increases the distance between agents in the opinion space. Therefore, for a limited interaction distance, there will be less interactions between agents if they are more polarized. This is especially true for weakly opinionated voters, which are rare in polarized societies, and therefore interact with only few others. Their opinions are accordingly more easily manipulated.

Last but not least, we investigated the robustness of different electoral systems. Focusing on the four main ones—proportional representation (PR), winner-takes-all (WTA), single representation (SR) and proportional ranked choice voting (PRCV)—we found that the PR system is generally the most robust, in remarkable agreement with the recent study by Raducha et al.14. This is not trivial. As a matter of fact, on the one hand, it is easier for an influencer to gain seats in the PR system than in the SR system, because each seat in the PR system corresponds to a smaller number of votes. From that point of view, one would guess that the SR system is more robust than the PR system. On the other hand, however, the influencer needs to gain more seats to take the majority in the PR system, because in total, there are more seats available, compared to the SR system. To make a long story short, overturning an election in the PR system requires to flip many seats that are easy to get, while in the SR system, flipping a few seats is sufficient, each of which is however more difficult to flip. Our results make it clear that the net result is that the PR system is the most resilient to external influences, most of the time. The WTA system can be seen as a middle ground between PR and SR, attributing seats in the same way as the SR system, but where the total number of seats is the same as in the PR system. It is not clear a priori where the WTA system would rank in terms of electoral robustness. We found that it is generally more robust than the SR, less so than the PR systems. The PRCV system is somehow more intricate to understand and accordingly, has a more intricate behavior. On the one hand, it is the most robust 20–25% of the time, which would put it as second most robust, behind the PR system. This likely follows from the proportional attribution of seats. However the PRCV system is also the least robust about 30% of the time. This indicates that, quite often, efficient strategies exist to target voter rankings to successfully modify the electoral outcome.

Our results remain the same, regardless of the number of parties, the shape of the opinion landscape, or the interaction distance between different voters. Systems with proportional representation are generally more robust than systems attributing all seats to the winner, themselves being generally more robust than single representative systems, irrespective of the structure of the electorate.

Altogether, these results indicate that more homogeneous, more open societies, i.e., where voters interact more with one another, and where the spectrum of opinions is smoothly represented are more robust against external influences. Mathematically, this is so because such societies have a more connected voter-voter interaction graph. Democracies are strengthened when people discuss and debate more, even with people of strongly differing opinions. Our results corroborate earlier conclusions drawn in political/social science42,43. All our results, including this conclusion, are independent of the number of existing political parties, However, different electoral processes behave remarkably differently under the influence of external manipulation, and we found that proportional representation makes for a more robust electoral process. Tradition has it in many democratic countries that a voter has a unique parliamentary representative, elected at the level of the electoral district where that voter lives. Aggregating electoral districts, say, at the level of states/provinces, where representatives are elected proportionally would strengthen the resilience of the electoral process against computational propaganda—not to mention that it would eliminate gerrymandering.

Finally, here we focused on four of the main existing electoral systems. This work should be extended to account for other systems, including ranked-choice ballots, two-round systems and so forth. Works along those lines is underway.

Methods

The opinion dynamics

Upon interactions with peers, the opinion of an agent may change, i.e., move in the opinion space. We model opinion dynamics of a group of n agents with an adaptation of the model proposed by Taylor18 [see in particular Eq. (3) there], which we detail here.

In a democratic system with \(p\ge 2\) parties, we represent the opinion of each agent as a normalized vector on the regular \((p-1)\)-simplex,

$$\begin{aligned} S_{\rm reg}&= \left\{ {\varvec{x}}\in \mathbb {R}^p ~:~ \sum _{k=1}^p x_k = 1\, , x_k\ge 0\right\} \, , \end{aligned}$$
(1)

whose vertices are \({{\varvec{v}}}_i=(\delta _{1i}, \delta _{2i}, ..., \delta _{pi})\), with the Kronecker symbol \(\delta _{ij}=1\) if \(i=j\) and \(\delta _{ij}=0\) otherwise. The use of the 1-norm in equation (1) reflects the fact that each voter has a global opinion. The k-th component of \({\varvec{x}}\in S_{\rm reg}\) represents the affinity of that agent with the \(k{\rm th}\) party. Accordingly, the largest component determines the party the agent will vote for. The opinion space will be refined in the next section in order to account for party ordering without introducing artificial, mathematical biases in favor of one party or another.

We attribute a natural opinion \({\varvec{x}}_i^{(0)} \in S_{\rm reg}\) to each agent i, and gather all natural opinions in the natural opinion matrix \(X^{(0)}\in \mathbb {R}^{n\times p}\) whose i-th row is \({\varvec{x}}_i^{(0)}\). The natural opinions of an agent is the actual opinion they would have in the absence of agent-agent interaction. Distance between natural opinions determine these interactions. In the spirit of the Deffuant 15 and Hegselmann-Krause16 models of opinion dynamics, interactions exist only between pairs of voters with opinion vectors within a certain distance \(\epsilon \) in the agent opinion space. This defines the adjacency matrix A of the interaction graph,

$$\begin{aligned} A_{ij}&= \left\{ \begin{array}{ll} 1\, , &{} \text {if } \Vert {{\varvec{x}}}_{i}^{(0)} - {{\varvec{x}}}_{^j}^{(0)}\Vert _1 < \epsilon \, , \\ 0\, , &{} \text {otherwise,} \end{array} \right. \end{aligned}$$
(2)

where the interaction distance parameter \(\epsilon \) is sometimes called the confidence bound15,16.

Finally, each agent forms their own opinion by balancing their neighbors opinions, following a consensus algorithm, and their own natural opinion. The dynamics of agent i’s opinion towards party q is given by

$$\begin{aligned} \dot{X}_{iq}&= d_i^{-1}\sum _{j=1}^n A_{ij}(X_{jq} - X_{iq}) + (X^{(0)}_{iq} - X_{iq})\, , \end{aligned}$$
(3)

where we introduced the degree \(d_i=\sum _{k=1}^n A_{ik}\) of i in the interaction graph to normalize the total influence of other agents on agent i. In words, the influence that a voter has on a given voter i is inversely proportional to—is diluted by—the total number of voters interacting with voter i.

The final steps are to define the diagonal degree matrix \(D = {\rm diag}(d_i)\) and the Laplacian matrix \( L = D-A\), to write equation (3) in vector form

$$\begin{aligned} \dot{X}&= {X}^{(0)} - \left[ D^{-1} L + I_n\right] X\, , \end{aligned}$$
(4)

with the n-dimensional identity matrix \(I_n\).

Equation (4) is a linear system and the matrix \(D^{-1}L + I_n\) has strictly positive eigenvalues (see Supplementary Information). Therefore, the system is globally exponentially stable and converges toward the equilibrium

$$\begin{aligned} X^*&= \left[ D^{-1}L + I_n\right] ^{-1}{X}^{(0)}\, . \end{aligned}$$
(5)

In our model, that equilibrium defines the final opinion of the agents. In other words, we assume that by election day, the dynamic process has converged.

We model the external influence applied by computational propaganda as a slight shift in the agents’ natural opinions. Accordingly, we modify the opinion dynamics of equation (4) as

$$\begin{aligned} \dot{X}&= {X}^{(0)} + W - \left[ D^{-1} L + I_n\right] X\, , \end{aligned}$$
(6)

where \(W\in \mathbb {R}^{n\times p}\) encodes the external influence and satisfies \( \sum _{j=1}^n W_{ij} = 0 \) and \(-X^{(0)}_{ij} \le W_{ij} \le 1 - X^{(0)}_{ij}\) to guarantee that opinions remain normalized under the dynamics defined by equation (6), i.e. that they stay on the \((p-1)\)-simplex.

A measure of the robustness of an election outcome is the minimal amount of external influence that needs to be applied in order to change the outcome. In our model, we introduce influence step by step, starting from the uninfluenced sytems (\(W_0={{\varvec{0}}}_{n\times p}\)) and adding small increments of influence until the election outcome changes. We have found that the most efficient influence strategy is the following one:

  • the external influence attempts to help the first runner-up of the election, which has the most chance to steal the elections from the winner;

  • agents whose natural opinion is close to the boundary to the first runner-up are targeted first;

  • when multiple electoral units are involved, external influence targets first the electoral units with the lowest majority (see the Supplementary Information for further details).

In practice, when we want to target the \(i{\rm th}\) agent, and push their opinion towards the \(q{\rm th}\) party (the first runner-up), we place a vector

$$\begin{aligned} {{\varvec{w}}}_k&= (w_1,...,w_p) \perp {\varvec{1}}_p\, , \end{aligned}$$
(7)

on the \(i{\rm th}\)-th row of the external influence matrix W. The components satisfy \(\sum w_i=0\), with \(w_q>0\) and \(w_{q'}<0\) for \(q'\ne q\).

If the outcome of the election in electoral unit u changes after \(K_u\) increments, we define the effort needed to change the election outcome as the proportion of agents influenced,

$$\begin{aligned} \xi _u&= \frac{K_u}{n_u}\, , \end{aligned}$$
(8)

where the subscript u indexes the electoral units. When multiple electoral units are involved, the total effort is

$$\begin{aligned} \xi _{\rm tot}&= \sum _u \frac{n_u}{N}\xi _u\, , \end{aligned}$$
(9)

where N is the total number of agents in the whole country.

The opinion space

The k-th component of the opinion vector \({{\varvec{x}}}_i\in S_{\rm reg}\) represents the degree of agreement of agent i towards party k. The three polygons \(({{\varvec{v}}}_1,{{\varvec{v}}}_{12},{{\varvec{v}}}_{123},{{\varvec{v}}}_{13})\), \(({{\varvec{v}}}_2,{{\varvec{v}}}_{23},{{\varvec{v}}}_{123},{{\varvec{v}}}_{12})\), and \(({{\varvec{v}}}_3,{{\varvec{v}}}_{13},{{\varvec{v}}}_{123},{{\varvec{v}}}_{23})\) in Fig. 6 delineate the domains of the 2-simplex where agents would vote for party 1, 2, and 3 respectively.

Without loss of generality, we can assume that the indexing of the parties (from 1 to p) matches the left-right political spectrum, i.e., party 1 is the left-most party and party p is the right-most one. In order to guarantee coherence of each agent’s opinions, we do not allow opinion vectors where two parties that are far away on the left-right spectrum have a large value while the parties in between have a low value. We need the opinion vector to satisfy some form of monotonicity. We say that an opinion vector \({\varvec{x}}\in S_{\rm reg}\) is admissible only if its components increase until the largest one and then decrease. Mathematically, if \(x_m = \max _i x_i\), we impose

$$\begin{aligned} x_i&\le x_j\, ,~ \forall i\le j\le m\, ,&x_i&\le x_j\, ,~ \forall i\ge j\ge m\, , \end{aligned}$$
(10)

reducing the domain of allowed opinion. For instance, for \(p=3\) parties, equation (10) cuts out half of the areas associated to parties 1 and 3, namely, the triangles \(({{\varvec{v}}}_1,{{\varvec{v}}}_{13},{{\varvec{v}}}_{123})\) and \(({{\varvec{v}}}_3,{{\varvec{v}}}_{13},{{\varvec{v}}}_{123})\), in Fig. 6.

Figure 6
figure 6

Sketch of the opinion space. Admissible opinion domain in the 2-simplex (i.e., for \(p=3\) parties). The vertices \({{\varvec{v}}}_1\), \({{\varvec{v}}}_2\), and \({{\varvec{v}}}_3\) represent the pure opinions of each party respectively. The shaded orange area is removed in order to balance the volume allocated to each party in the simplex, by sliding vertex \({{\varvec{v}}}_2\) towards the barycenter \({{\varvec{c}}} = {{\varvec{v}}}_{123}\) to \({{\varvec{s}}}_2\).

Furthermore, in order to isolate the impact of opinions and electoral systems on the robustness of elections outcomes, we focus our analysis on societies where all the parties have a similar level of approbation in the population. Therefore, we need to balance the volume \(V_i\) allocated to each party \(i\in \{1,\ldots ,p\}\) in the admissible opinion space. After the ordering imposed by equation (10), one realizes that the left-most and right-most parties have the smallest volume in the opinion space. Therefore, we need to reduce the volume \(V_i\) of the other parties \(i\in \{2,...,p-1\}\) in order to match the volumes of parties 1 and p.

We reduce the volume of the moderates (i.e., non-extremists) by sliding the vertex of the simplex defining their area (\({\varvec{v}}_i\)) towards the barycenter \({\varvec{c}}\) of the simplex, reaching the new vertex \({\varvec{s}}_i\) such that \(V_i = V_1\) (see Fig. 6). In the Supplementary Information, we show that the position of \({\varvec{s}}_i\) can be determined in closed form and rather elegantly as

$$\begin{aligned} {\varvec{s}}_i&= \gamma _i {\varvec{c}} + (1-\gamma _i){\varvec{v}}_i\, , \;\;\;\;\; \;\;\gamma _i^{-1} = \left( {\begin{array}{c}p-1\\ i-1\end{array}}\right) \, . \end{aligned}$$
(11)

A priori, it is not obvious (especially for \(p\ge 3\)) that the ratio of displacement of the vertex \({\varvec{s}}_i\) along the segment \([{\varvec{v}}_i,{\varvec{c}}]\) translates into the same ratio of volume reduction for the opinion subdomain. The proof of this fact (see the Supplementary Information) relies on an appropriate decomposition of the opinion space into sub-simplices. We show that the sliding of the vertex \({{\varvec{s}}}_i\) towards \({{\varvec{c}}}\) only scales the height of sub-simplices, without affecting their base, resulting in the same scaling in the volume of each sub-simplex.

We will refer to the final opinion space (after ordering and reduction) as \({C_{\rm r}}\subset S_{\rm reg}\), shown as the colored area in Fig. 6.

Natural opinions

Electoral populations are defined by two main social characteristic, which are their openness, modeled by the opinion distance over which two voters interact (the interaction distance \(\epsilon \)) and the distribution of the voter’s natural opinions. For the latter, we consider two cases separately, which are (i) the bipartite case and (ii) the multipartite case with more than two parties.

For case (i), we considered distributions of natural opinions modeled by their bias towards one party, their polarization, and their width of represented opinions. Following Refs.44,45 we consider bigaussian distributions of one-dimensional opinions,

$$\begin{aligned} f(x)&= \frac{\rho }{\sigma \sqrt{2\pi }} \exp [-\frac{(x - \mu + \frac{\Delta }{2})^2}{2\sigma ^2}] +\frac{1-\rho }{\sigma \sqrt{2\pi }} \exp [-\frac{(x - \mu - \frac{\Delta }{2})^2}{2\sigma ^2}]\, , \end{aligned}$$
(12)

with opinions restricted to \(x \in [-1,1]\). Voter polarization is given by \(\Delta \), while biases can be introduced either via differences in weight \(\rho \) between the two gaussians or by the shift \(\mu \). In this paper, the width of the distributions is fixed at \(\sigma =0.2\), without loss of generality. For the sake of consistency with multipartite cases, our bipartite model is constructed in a space of two-dimensional voting agents, on which the interval \(x \in [-1,1]\) can bijectively be mapped on, via an affine, dynamics-preserving mapping, \(x \mapsto \left( (1+x)/2,(1-x)/2 \right) \).

We may further consider polarization into more than two peaks, which naturally leads to case (ii) of multipartite systems. In that case, we did not consider polarization beyond the existence of parties and instead generated uniformly distributed natural opinions as described in Sect. 4.2. We provide a random opinion generator online46.

Electoral systems

Once the actual opinion of each agent is known, we need to translate the set of final opinions into an election result. Each agent naturally votes for the party with which they agree the most, i.e., corresponding to the largest component in their opinion vector. Votes are then aggregated according to a chosen electoral system, which we would like to compare.

We first define three electoral units corresponding to three different levels of aggregation:

Country:

In almost all electoral instances, the largest possible electoral unit is a country. A notable exception are parliamentary elections in the European Union. Examples of elections realized at the country level include presidential elections in Chile, France, Ireland, Mexico and several other countries.

State:

Most modern countries are partitioned into states—other denominations exist such as provinces, cantons, departments, regions aso. Parliamentary elections realized at the state level include elections to the US Senate, as well as National and State Council elections in Switzerland. The US presidential elections are a special case of elections whose outcome is determined by aggregating elections at the state level (except in Maine and Nebraska).

District:

States are often subdivided into districts. In many instances these entities are organized in such a way that they all have more or less the same population. In parliamentary elections, each electoral district then elects its own, single representative. Examples thereof include the UK general elections, the US House of Representatives elections.

Depending on the considered electoral process, results are gathered at one or the other level, and, if applicable, results in different units in that level are combined to give the outcome, i.e. the winning party.

There are different ways to elect representatives in an electoral unit. In this manuscript, we focus on the four main ones, which are:

Proportional representation (PR):

An electoral unit—for instance a state—elects more than one representative. Seats are attributed to parties proportionally to the number of votes they received. The members of the lower chamber of Switzerland’s parliament (the National Council) are elected proportionally in each canton.

Single representative (SR):

The electoral units here are electoral districts with a single representative. They can be elected in a single-round, simple majority election (US House of Representatives elections) or in a two-round election (French National Assembly elections).

Winner takes all (WTA):

All seats associated with an electoral unit are attributed to the party with the most votes. This system reduces to SR if there is a single seat attributed in the electoral unit. The US Electoral College appointing the president and vice president of the US is elected by a WTA process in all but two states (Maine and Nebraska).

Proportional Ranked Choice Voting (PRCV):

Electoral units are the same as in the PR system. Voters in each unit rank the candidates in order of preference. All candidates that receive a voting ratio above a certain quota are elected. Usually the quota is fixed around \(1/(m+1)\) with the number m of seats in the considered electoral unit. Next, surplus votes above quota are re-distributed to not-yet-elected second-choice candidates. If new candidates exceed the quota, they are elected and their surplus votes are again re-distributed. If no candidate exceeds the quota, the candidate with the least vote is eliminated and their votes redistributed according to second preferences. The process is iterated until m seats are attributed.