The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many...

19
The game of go as a complex network The game of go as a complex network Bertrand Georgeot, Olivier Giraud, Vivek Kandiah supported by EC FET Open project NADINE B.G. and O. Giraud, Europhysics Letters 97 68002 (2012) Quantware group Laboratoire de Physique Théorique, IRSAMC, UMR 5152 du CNRS Université Paul Sabatier, Toulouse Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 1 / 19

Transcript of The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many...

Page 1: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

The game of go as a complex network

The game of go as a complex networkBertrand Georgeot, Olivier Giraud, Vivek Kandiah

supported by EC FET Open project NADINEB.G. and O. Giraud, Europhysics Letters 97 68002 (2012)

Quantware groupLaboratoire de Physique Théorique, IRSAMC, UMR 5152 du CNRS

Université Paul Sabatier, Toulouse

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 1 / 19

Page 2: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Networks

• Recent field: study of complex networks

• Tools and models have been created

• Many networks are scale-free, with power-law distribution of links

• Difference between directed and non directed networks

• Important examples from recent technological developments: internet,World Wide Web, social networks...

• Can be applied also to less recent objects

• In particular, study of human behavior: languages, friendships...

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 2 / 19

Page 3: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Games

• Network theory neverapplied to games

• Games represent aprivileged approach tohuman decision-making

• Can be very difficult tomodelize or simulate

=⇒ While Deep Blue famouslybeat the world chesschampion Kasparov in1997, no computerprogram has beaten a verygood go player even inrecent times.

Goban

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 3 / 19

Page 4: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Rules of go

• White and black stonesalternatively put atintersections of 19× 19lines

• Stones without liberties areremoved

• Handicap stones can beplaced

• Aim of the game: constructprotected territories

• total number of legalpositions ∼ 10171,compared to ∼ 1050 forchess

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 4 / 19

Page 5: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Databases

• We use databases of expert games in order to construct networks fromthe different sequences of moves, and study the properties of thesenetworks

• Databases available at http://www.u-go.net/

• Whole available record, from 1941 onwards, of the most importanthistorical professional Japanese go tournaments: Kisei (143 games),Meijin (259 games), Honinbo (305 games), Judan (158 games)

• To increase statistics and compare with professional tournaments, 4000amateur games were also used.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 5 / 19

Page 6: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Vertices of the network

”plaquette” ⇒ square of 3× 3intersections

• We identify plaquettesrelated by symmetry

• We identify plaquettes withcolors swapped

=⇒ 1107 nonequivalentplaquettes with emptycenters

=⇒ vertices of our network

Examples of plaquettes

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 6 / 19

Page 7: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Zipf’s law

• Zipf’s law: empirical lawobserved in many naturaldistributions (wordfrequency, city sizes...)

• If items are rankedaccording to theirfrequency, predicts apower-law decay of thefrequency vs the rank.

• integrated distribution of1107 moves clearly followsa Zipf’s law, with anexponent ≈ 1.06

0 0.5 1 1.5 2 2.5 3 3.5log n

-3

-2.5

-2

-1.5

-1

-0.5

0

log

F(n)

0 0.5 1 1.5 2 2.5 3log n

-2

-1.5

-1

-0.5

0

log

F(n)

Normalized integratedfrequency distribution of 1107moves. Thick dashed line isy = −x . Inset: same forpositions on the board

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 7 / 19

Page 8: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Sequences of moves

• we connect verticescorresponding to moves aand b if b follows a in agame at a distance ≤ d .

• Each choice of d defines adifferent network.

• Left: frequency distributionfor sequences of the 1107moves with d = 4.Algebraic decrease visible,exponent from ≈ 1 (shortsequences) to ≈ 0.7 (longsequences).

=⇒ Sequences of moves followZipf’s law (cf languages)

=⇒ Exponent decreases aslonger sequences reflectindividual strategies

0 1 2 3 4 5 6

log n0

1

2

3

4

5

log

f(n)

Integrated frequency distributionof sequences of moves f (n) for(from top to bottom) two toseven successive moves (alldatabases together), plottedagainst the ranks of the moves.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 8 / 19

Page 9: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Sequences of movesFour possible definitions:

• C1: positions on the board,b follows a if b is playedimmediately after a

• C2:positions on the board,b follows a if b is playedafter a at distance d = 4

• C3: sequence of vectorsbetween successivepositions with d = 4

• C4: as before

=⇒ move sequences, evenlong ones, are well hierarchizedby our initial definition=⇒ amateur database departs

from all professional ones,playing more often at shorterdistances

0 2 4 6log n

0

2

4

log

f(n)

0 0.5 1log d

-2

-1

0

log

P(d)

Integrated frequencydistribution of sequences ofmoves for two (continuous) andthree (dashed lines) successivemoves, cases C1 (black), C2(red), C3 (green), C4 (blue).Inset: distribution of distancesbetween moves P(d). Allprofessional tournaments aredifferent from amateur games.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 9 / 19

Page 10: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Link distributions

• Tails of link distributionsvery close to a power-law1/kγ with exponent γ = 1.0for the integrateddistribution.

• The results are stable in thesense that the exponentdoes not depend on thedatabase considered.

=⇒ network displays thescale-free property

=⇒ symmetry between ingoingand outgoing links is apeculiarity of this network

-4 -3 -2 -1 0log(k/k

max)

0

1

2

3

log

P in, l

og P

out

-3 -2 -1 00

1

2

3

Pin P

out

Pin

Pout

Normalized integrateddistribution of ingoing links Pin

(solid) and outgoing links Pout

(dashed), Thick solid line isy = −x .Inset: Pin (solid curves) and Pout

(dashed curves), d = 2 (black),3 (red), 4 (green), 5 (blue) and 6(violet).

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 10 / 19

Page 11: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Directed network: Google algorithm

5

1

2

3

4

6 7

Weighted adjacency matrix

H =

0 0 0 0 0 0 013 0 0 0 0 0 013 0 0 1

2 0 0 013 0 0 0 1 1 10 0 0 1

2 0 0 00 1 0 0 0 0 00 0 0 0 0 0 0

Ranking pages {1, . . . , N} according to their importance.PageRank vector p = stationary vector of H:

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 11 / 19

Page 12: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Computation of PageRank

p = Hp ⇒ p= stationary vector of H:can be computed by iteration of H.

To remove convergence problems:

Replace columns of 0 (dangling nodes) by 1N : H → matrix S

In our example, H =

0 0 17 0 0 0 0

13 0 1

7 0 0 0 013 0 1

712 0 0 0

13 0 1

7 0 1 1 10 0 1

712 0 0 0

0 1 17 0 0 0 0

0 0 17 0 0 0 0

.

To remove degeneracies of the eigenvalue 1, replace S by

G = αS + (1− α)1N

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 12 / 19

Page 13: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Ranking vectors

• The PageRank algorithm gives the PageRank vector, with amplitudes pi ,with 0 ≤ pi ≤ 1

• PageRank is based on ingoing links

• One can define a similar vector based on outgoing links (CheiRank)

• HITS algorithm: Authorities (ingoing links) and Hubs (outgoing links)

• Other eigenvalues and eigenvectors of G reflect the structure of thenetwork

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 13 / 19

Page 14: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Ranking vectors• Clustering coefficient

detects local connectedclusters.

• Here depends on thenumber of games ng

included, but almost noton the database.

• For large ng , it goes to anasymptotic value whichseems larger than 0.7(higher CC than WWW≈ 0.11)

• Ranking vectors follow analgebraic law

• Symmetry betweendistributions of rankingvectors based on ingoinglinks and outgoing links.

0 0.5 1 1.5 2 2.5 3log i

-5

-4

-3

-2

-1

log(

rank

)

2000 4000n

g

0.4

0.6

0.8

CC

PageRankCheiRank

Hubs

Authorities

Ranking vectors of G. Top bundle:PageRank. Second bundle:CheiRank. Third bundle: Hubs.Fourth bundle: Authorities.Straight dashed line is y = −x .Inset: Clustering coefficient as afunction of the number of gamesng included to construct thenetwork; blue squares:professional tournaments; circles:amateur games.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 14 / 19

Page 15: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

PageRank vs CheiRank

• Left: correlation betweenthe PageRank and theCheiRank for the fivedatabases considered.

• Strong correlation betweenthese rankings basedrespectively upon ingoingand outgoing links.

=⇒ Strong correlation betweenmoves which open manypossibilities of new movesand moves that can followmany other moves.

=⇒ However, the symmetry isfar from exact

0 500 1000K

0

500

1000

K*

K* vs K where K (resp. K*) isthe rank of a vertex whenordered according to PageRankvector (resp CheiRank) foramateur (violet stars) andprofessional (other) databases.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 15 / 19

Page 16: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Spectrum of the Google matrix

• For WWW the spectrum isspread inside the unitcircle, no gap between firsteigenvalue and the bulk

• Here huge gap betweenthe first eigenvalue andnext ones =⇒well-connected network,few isolated communities(cf lexical networks).

• Radius of the bulk ofeigenvalues changes withnumber of games ng ⇒ Asmore games are taken intoaccount, rare links appearwhich break the weaklycoupled communities.

0 0.5 1-0.4

-0.2

0

0.2

0.4

0 1000 2000 3000ng

0

0.1

0.2

0.3

λ c

100 200 300ng

0.15

0.2

λ c

Top left: eigenvalues of G in thecomplex plane; black circles:Honinbo; red crosses: amateur.Bottom: λc such that from top tobottom 99%, 95%, 90%, 80% ofeigenvalues λ verify |λ| < λc foramateur games.Top right: λc for 80% ofeigenvalues for our 5databases.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 16 / 19

Page 17: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Eigenvectors of the Google matrix

• Next to leading eigenvaluesare important, as theyindicate the presence ofcommunities of moveswhich have commonfeatures.

• The distribution of the first7 eigenvectors (Left) showsthat they are concentratedon particular sets of movesdifferent for each vector.

• eigenvectors are differentfor different tournamentsand from professional toamateur

• much less peaked forrandomized network

0 25 50 75 100i

0

0.1

0.2

0.3

0.4

|Ψi| 2

0 25 50 75 100i

0.2

0.4

0.6

0.8

|Ψi| 2

3,4

6

7

5

2

Moduli squared of the righteigenvectors associated withthe 7 largest eigenvalues|λ1| = 1 > |λ2|... > |λ7| of G(Honinbo database) for the first100 moves in decreasingfrequency.Inset: Same for amateurdatabase (black) and randomnetwork (red).

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 17 / 19

Page 18: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Connection with tactical sequences

• First eigenvector ismainly localized on themost frequent moves

• Third one is localized onmoves describingcaptures of theopponent’s stones, andpart of them single outthe well-known situationof ko (“eternity”), whereplayers repeat capturesalternately.

• The 7th eigenvectorsingles out moves whichappear to protect anisolated stone byconnecting it with achain.

Moves corresponding to the10largest entries of right eigenvectorsof G for eigenvalues λ1

(PageRank)(top), λ3 (middle) andλ7 (bottom), Honinbo database.Black is playing at the cross. Topline coincides with the 10 mostfrequent moves.

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 18 / 19

Page 19: The game of go as a complex networkZipf’s law • Zipf’s law: empirical law observed in many natural distributions (word frequency, city sizes...) • If items are ranked according

Conclusion• we have studied the game of go, one of the most ancient and complex

board games, from a complex network perspective.• We have defined a proper categorization of moves taking into account the

local environment, and shown that in this case Zipf’s law emerges fromdata taken from different tournaments.

• some peculiarities, such as a statistical symmetry between ingoing andoutgoing links distributions

• Differences between professional tournaments and amateur games canbe seen.

• Certain eigenvectors are localized on specific groups of moves whichcorrespond to different strategies.

=⇒ the point of view developed in this paper should allow to better modelizesuch games

=⇒ could also help to design simulators which could in the future beat goodhuman players.

=⇒ Our approach could be used for other types of games, and in parallelshed light on the human decision making process.

=⇒ Future: larger plaquettes, comparison human/computers

Bertrand Georgeot (CNRS Toulouse) The game of go as a complex network ECT workshop, July 2012 19 / 19