© Copyright JASSS

  JASSS logo ----

Dietrich Stauffer (2001)

Monte Carlo simulations of Sznajd models

Journal of Artificial Societies and Social Simulation vol. 5, no. 1
<https://www.jasss.org/5/1/4.html>

To cite articles published in the Journal of Artificial Societies and Social Simulation, please reference the above information and include paragraph numbers if necessary

Received: 4-Dec-01      Accepted: 22-Jan-02      Published: 31-Jan-01


* Abstract

In less than a year, the Sznajd model has found several applications. In this model, an isolated person does not convince others; a group of people sharing the same opinions influences its neighbours much more easily. Thus on a square lattice, with variables +1 (e.g. Democrats) and -1 (e.g. Republicans) on every lattice site, a pair (or plaquette) of neighbours convinces its six (eight) nearest neighbours of its own opinion if and only if all members of the pair (plaquette) share the same opinion. The generalization to many possible states is used to explain the distribution of votes among candidates in Brazilian local elections.

Keywords:
Consensus, lattices, cellular automata, elections

* Introduction

1.1
The involvement of physics in research on social affairs is quite old (Weidlich 2000) but seems to have become fashionable now. Even Germany's Physical Society has founded a section on socioeconomic research, headed by Frank Schweitzer (1997). Ising-type models have been reviewed by Holyst, Kacperski and Schweitzer (2001). The present review deals with the very recent Sznajd model (Sznajd-Weron and Sznajd 2000) and its applications to the way opinions might be thought to spread in human society (Stauffer, Soussa and Moss de Oliveira 2000, Sznajd-Weron and Weron 2002, Moreira, Andrade and Stauffer 2001, Bernardes, Costa, Araujo and Stauffer 2001, Ochrombel 2001, Chang 2001, Elgazzar 2001).

1.2
For example, a single person stopping on the street and staring into the sky is mostly ignored by passers-by. However, if several people together stare into the sky, they induce others to follow them. The trades union movement follow a similar strategy: By uniting, the employees have a stronger position against management than if everybody tries to negotiate alone: "United we stand, divided we fall." Thus it is not surprising that in Poland this principle was put into a computational model, the Sznajd model (Sznajd-Weron and Sznajd 2000), first in one and then in two dimensions (Stauffer, Sousa and Moss de Oliveira 2000).

We do not deal here with all the variants but emphasize the more interesting ones. The next section looks at the basic model, then we check complications and compare the results with the Ising model at low temperatures, and finally we describe a political application, the distribution of votes among candidates. The crucial difference between the Sznajd model and voter or Ising models is that information flows outward: a site does not follow what the neighbours tell the site, but instead the site tries to convince the neighbours.

* Basic Model

2.1
Each site of a one- or two-dimensional lattice carries a spin, S, that can either be up (e.g. Republican) or down (e.g. Democrat) and that represents one of two possible opinions on any question. Two neigbouring parallel spins, i.e. two neighbouring people sharing the same opinion, convince their neighbours of this opinion. If they do not have the same opinion, then either they do not influence their neighbours, or in one dimension (Sznajd-Weron and Sznajd 2000) they bring their neighbours to the opposite position. On the square lattice one may also demand that a plaquette of four sites, instead of a pair of only two sites, must have all four opinions to agree in order to convince the neighbours. A Fortran program for the case where a pair of two neighbouring spins convinces the six neighbours if and only if the two central spins have the same opinion (rule IIa of Stauffer, Sousa and Moss de Oliveira (2000) is listed in the Appendix). The program denotes the spin by is.

Figure 1.Sznajd square lattice, with a parallel pair convincing its six neighbours, after 1, 5 and 50 iterations. After 256 iterations the whole lattice was empty (spin down).

2.2
Various other rules are defined and discussed in Stauffer, Sousa and Moss de Oliveira (2000). In all of them we need a random selection of the next spin pair that will try to convince its neighbours; otherwise the one-dimensional results are fixed by the few first spins in the chain.

For these rules in one and two dimensions (and also for the majority of alternative rules (Stauffer, Sousa and Moss de Oliveira 2000)) the system always ends up at a fixed point: either all spins point up, or they all point down in the square lattice. The antiferromagnetic rule in one dimension (Sznajd-Weron and Sznajd 2000) in addition allows in half of the cases an antiferromagnetic ordering of up, down, up, down etc. (In ferromagnets, neighbouring magnetic dipoles want to align parallel, while in antiferromagnets, neighbours want to be opposite to each other.) The times needed to reach this fixed point increase with lattice size and are distributed log-normally or in a more complicated way, depending on the rule (Stauffer, Sousa and Moss de Oliveira 2000). Thus the problem is quite time consuming and does not allow one to simulate even medium-size lattices like 1000 × 1000.

Usually one starts with half of the spins up and half of the spins down. If one varies the initial concentration p of up spins, one sees a phase transition in the above rule for the square lattice but not for the chain. The system finally has all spins down if p < 1/2 and all spins up if p > 1/2. In a finite lattice, of course, phase transitions are never sharp, and thus the transition is indicated numerically by a slope (Figure 2) becoming steeper and steeper the larger the lattice is. In an infinite lattice, one would get a sharp step function for the number of up fixed points versus the initial concentration p. This holds for both a regular square lattice (Stauffer, Souse and Moss de Oliveira 2000) as well as for one where a fraction of sites is removed in a correlated way (Moreira, Andrade and Stauffer 2001).

Figure 2. Fraction of samples ending with all spins up, versus initial fraction of up spins. 1000 samples L = 23 (+, 1000 samples), 53 (x, 1000 samples) and 101 (*, 100 samples), on a correlated-diluted square lattice (Moreira, Andrade and Stauffer 2001).

* Variants

3.1
To avoid dictatorship (all spins parallel) one can introduce a small number of non-conformists that are not convinced by the Sznajd rule (Schneider, to be submitted); see (Sznajd-Weron and Sznajd 2000,Stauffer, Sousa and Moss de Oliveira 2000) for alternatives.

3.2
Just as the Ising ferromagnet can be studied on a regular or on a diluted lattice, the Sznajd model, discussed above for regular lattices, can also be studied in disordered systems. This is more realistic since human society does not follow a square lattice with every person having exactly four neighbours. The simplest case is a randomly diluted square lattice, where every site is either empty or carries one spin; this random occupation does not change during the simulation. More realistic are long-range correlations between the occupation of various lattice sites. Fortunately, in both cases the results were very similar to those on regular lattices from the previous section (Moreira, Andrade and Stauffer 2001).

3.3
On the triangular and simple cubic lattice, if a pair of parallel neighbours convinces its 8 (or 10, respectively) other neighbours of the pair's opinion, the results are similar to the square lattice: all lattices finally have all spins parallel, after a time which is not distributed log-normally. And as a function of the initial concentration we have a phase transition at 1/2. In the triangular case, Chang (2001) found all spins parallel at the end even for antiferromagnetic interactions; in the Ising model we know that triangular antiferromagnets are frustrated and thus complicated.

3.4
The Sznajd model is thus robust against geometrical disorder or rearrangement. If one convinces the neighbours only with some probability, p, and leaves them unchanged with probability 1-p, still a consensus is reached albeit after a longer time.

3.5
More threatening to the basic concept of "United we stand, divided we fall" is the idea of Ochrombel (2001) to allow a single site, without any solidarity with others, to convince its four neighbours. Thus we select randomly a site and then automatically force its four neighbours to take the same orientation as that site. (Both spin up and spin down can convince; if only spin up would convince we would have the trivial infection process.) Again at the end everybody agrees.

3.6
The dynamics of the Sznajd model are quite similar to that of the Ising model at low temperatures. Through spinodal decompositionn, an initially random distribution of spins forms large domains of up spins, surrounded by large domains of down spins; see Figure 1. The cluster growth follows a scaling law (Bernades et al 2001) known for decades for Ising models: The typical cluster radius increases as the square root of the time, and the distribution of cluster radii is determined mainly by the ratio of the cluster radius to the typical cluster radius. However, an Ising model at low but finite temperatures shows lots of isolated up spins in a sea of down spins, while the Sznajd model is deterministic, corresponds to zero temperature, and avoids such isolated sites. (At zero temperature, the Ising model dislikes ordering (Spirin, Krapivsky and Redner 2001).)

3.7
The Sznajd model can also be combined (Stauffer 2002) with an idea formulated by Hegselman (unpublished); see also Deffaunt, Neau et al (2000) and Dittner (2001) , that only people who have already a similar opinion can be convinced; this requires more than two opinions and thus is similar to Bernardes's work (2001). In this variant, people can convince others only if the other opinions from 1 to q differ by at most one unit from the central opinion. Thus when only opinions 1, 2, and 3 are available, those with opinions 2 can convince all others, while those with opinions 1 or 3 can only convince those with opinion 2. On the square lattice, one finds then in general a consensus for q=3 but no longer for q=4; on a triangular lattice this boundary shifts to q=5. It would be interesting to combine this model with diffusion of agents on a lattice such that only an agent that has just moved to another one can try to convince that agent; this choice would interpolate between random graphs and nearest-neighbour lattices. An application of the Sznajd model to small-world networks was presented by Elgazzar (2001).

* Politics

4.1
An interesting application has been to political vote distributions (Bernardes et al 2001). The number of candidates, getting a fraction v of all votes cast for city councils in Brazil, varies as 1/v except for downward deviations at large and small v. Figure 3 gives real results from Minas Gerais (Brazil) as x, and compares them with suitably normalized votes (+) from the following simulation:

4.2
Instead of only two choices, each Sznajd voter has N choices, corresponding to the N candidates. Bernardes replaces the square lattice by a Barabasi network, a structure grown on the principle that well-connected people more easily get new connections than others (Barabasi and Albert 1999). We start with five nodes all connected to each other. Then the network grows as follows: A newly added node makes exactly 5 connections to already existing nodes; the probability to select one such already existing node is proportional to the number of connections this node had already before. This network is known to give a wide distribution of the number k of neighbours, with the number of sites having k neighbours decaying as 1/k3 for intermediate k.

Figure 3. Comparison of simulated votes (+) with real votes (x). From Bernardes (Bernardes, Costa et al 2001).

* Conclusion

5.1
This paper has reviewed the recently invented Sznajd model, an alternative to the Ising model which has been applied to social phenomena for some time. While, in an Ising model, each site looks at its neighbours and tries to follow them, in the Sznajd model sites which agree among each other try to convince their neighbours. The most interesting application thus far has been the reproduction of the vote distribution in Brazil, Figure 3.

* Acknowledgements

This paper was first presented at the fifth Simulating Society meeting, September 21-24 2001 (http://www.soc.surrey.ac.uk/simsoc5/) convened in Kazimierz Dolny, a small town of south eastern Poland.

I thank Suzana Moss de Oliveira and Paulo Murilo C. de Oliveira for hospitality at UFF in Niterói, Brazil, where most of this work was done together with Brazilian collaborators.


* Appendix

The following Fortran program demonstrates the development of sites using the Sznajd model. The output that is produced starts with the initial parameters: 101 90000 1 1, then come thousands of lines with intermediate results, and when the consensus was found it stops with a histogram of relaxation times (one line only if nrun=1) followed by, for example, 0.500000 0 1 0 giving the initial concentration, the number of samples ending with all spins is down, the number of samples ending with all spins is up, and the number of samples ending without consensus. -231 < ibm < 231 are random integers, obtained by multiplication with 16807. The L × L lattice is enlarged by two buffer lines on each end to allow simple helical boundary conditions.

      program sznajd
c     square lattice, with two neighbours convincing
      parameter(L=101, L2=L*L, Ls=L2+4*L)
      dimension nhist(0:32), neighb(0:3), is(Ls)
      data maxstep/90000/,iseed/1/,nrun/100/,nhist/33*0/,p/0.49/
      print *, L, maxstep, iseed, nrun
      ibm=2*iseed-1
      fact=L2/2147483648.0d0
      ip=(2*p-1)*2147483648.0d0
      neighb(0)= 1
      neighb(1)=-1
      neighb(2)= L
      neighb(3)=-L
      icountu=0
      icountd=0
      icount0=0
      do 4 irun=1,nrun
      do 1 i=1, Ls
        ibm=ibm*16807
        is(i)=-1
 1      if(ibm.lt.ip) is(i)=1
      do 2 itime=1,maxstep
        m=0
        do 3 k=2*L+1,L2+2*L
          m=m+is(k)
 5        ibm=ibm*16807
          if(ibm.lt.0) ibm=(ibm+2147483647)+1
          i=2*L+1+fact*ibm
          if(i.le.2*L.or.i.gt.L2+2*L) goto 5
          ibm=ibm*65539
          j=i+neighb(ishft(ibm,-30))
          ici=is(i)
          if(ici.eq.is(j)) then
            is(i-1  )=ici
            is(i-L  )=ici
            is(i+L  )=ici
            is(i+1  )=ici
            is(j-1  )=ici
            is(j-L  )=ici
            is(j+L  )=ici
            is(j+1  )=ici
          endif
 3      continue
        if(iabs(m).eq.L2) goto 6
c       do 9 i=1,2*L
c         is(i)=is(L2+i)
c9        is(L2+2*L+i)=is(2*L+i) 
 2    continue
      print *, ' error, itime =', itime
      icount0=icount0+1
 6    ibin=alog(float(itime))/0.69315
      nhist(ibin)=nhist(ibin)+1
      if(m.eq.L2) icountu=icountu+1
      if(m.eq.-L2)icountd=icountd+1
 4    continue
      do 7 ibin=1,32
 7      if(nhist(ibin).ne.0) print *, 2**ibin, nhist(ibin)
      print *, p, icountu, icountd, icount0
      stop
      end

* References

BARABASI, A.L. and R. Albert, Science 286, 509 (1999)

BERNARDES, A.T., U.M.S. Costa, A.D. Araujo, and D. Stauffer, Int. J. Mod. Phys. C 12, 159 (2001);

BERNARDES,A. T., D. Stauffer and J. Kertész, Eur. Phys. J. B, in press (2002).

CHANG, I., Int. J. Mod. Phys. C 12, No. 10 (2001)

DEFFUANT, G., D. Neau, F. Amblard and G. Weisbuch, Adv. Complex Syst. 3, 87 (2000)

DITTNER, J.C., Nonlinear Analysis 47, 4615 (2001).

ELGAZZAR, A.S., Int. J. Mod. Phys. C 12, 1537 (2001)

HOLYST, J. A., K. Kacperski and F. Schweitzer, in Annual Reviews of Computational Physics IX, p.275, World Scientific, Singapore 2001.

MOREIRA, A.A., J.S. Andrade Jr. and D. Stauffer, Int. J. Mod. Phys. C 12, 39 (2001)

OCHROMBEL René, Int. J. Mod. Phys. C 12, 1091 (2001)

SPIRIN, V., P.L. Krapivsky and S.Redner, Phys. Rev. E 63, 036118 (2001)

SCHNEIDER, J., Int. J. Mod. Phys. C 13, to be submitted

SCHWEITZER , F. (ed.) Self-Organization of Complex Structures: From Individual to Collective Dynamics, Gordon and Breach, Amsterdam 1997.

STAUFFER, D., A.O. Sousa and S. Moss de Oliveira, Int. J. Mod. Phys. C 11, 1239 (2000)

STAUFFER, D., Int. J. Mod. Phys. C 13, No. 3 (2002)

SZNAJD-WERON, K. and J. Sznajd, Int. J. Mod. Phys. C 11, 1157 (2000)

SZNAJD-WERON, K. and R. Weron, Int. J. Mod. Phys. C 13, 115 (2002)

WEIDLICH, W. Sociodynamics; A Systematic Approach to Mathematical Modelling in the Social Sciences. Harwood Academic Publishers, 2000

----

ButtonReturn to Contents of this issue

© Copyright Journal of Artificial Societies and Social Simulation, 2002