Evolutionary Iterated Prisoner’s Dilemma Game
H.-T. Kim
Evolutionary Computation, 2009
Outline • Evolutionary Prisoner's Dilemma Game
– Prisoner's Dilemma Game– Iterated Prisoner's Dilemma Game– N-person Iterated Prisoner's Dilemma Game– Robert Axelrod’s nIPD game
• Evolution of Iterated Prisoner's Dilemma Game Strategies in Structured Demes Under Random Pairing in Game Playing
• Simulation on Worksite Interactions between Laborers and Firms by using Multi-Agent based Evolutionary Computation
2
Prisoner's Dilemma Game
3
‘ 승현’의 payoff table
주원
자백 ( 배반 ) 침묵 ( 협력 )
승현
자백( 배반 ) 교수님의 미움
조기졸업연구비 2 배
침묵( 협력 ) 6 년짜리 박사과정 교수님의 의심
어느 날 SC 랩 공용통장에서 거액의 연구지원금이 사라진 사건이 발생 , 교수님이 범인으로 승현이와 주원이를 지목했다 . 하지만 물증은 없는 상황 . 그래서 교수님은 그 두 명을 각각 따로 방으로 불러서 다음과 같이 말했다 .
‘ 만약 범행을 순순히 시인한다면 정직한 너한테만 특별히 이번 달 연구비를 2 배로 주고 졸업도 일찍 시켜주겠다 . 하지만 괜히 입다물고 있다가 다른 사람이 자백하면 그 사람만 혜택을 주고 , 너는 석사졸업 후 6 년짜리 박사과정으로 보내겠다 .’
하지만 교수님은 만약 둘 다 자백하면 혜택은 전혀 주지 않을 계획이다 . 이 상황에서 , 어떻게 하는 것이 승현과 주원의 가장 합리적인 선택일까 ?
< 죄수의 딜레마 게임의 예 >
‘ 죄수 A’ 의 payoff table
B
자백 ( 배반 ) 침묵 ( 협력 )
A
자백( 배반 ) 4 년 0 년
침묵( 협력 ) 10 년 1 년
내쉬 균형 !
Prisoner's Dilemma Game• 게임의 특징
– 1950 년대에 Merrill Flood 와 Melvin Dresher 에 의해서 고안– 죄수 2 명이 형사에게 취조 당하는 상황을 가정한 모델
• 2 명의 player 는 서로 의사소통 불가능– 많은 사회현상이 이러한 형태를 닮아 있다는 점에서 중요한 모델
• 게임이론 , 경제학 , 그리고 정치학에서 깊이 연구• Ex) 군비경쟁 , 가격경쟁…
• 게임의 조건– R : 상호협력시의 payoff T : 나만 배반했을시의 payoff – P : 상호배반시의 payoff S : 나만 협력했을시의 payoff
4
Iterated Prisoner's Dilemma Game• IPD 게임
– 2 명의 player 가 Prisoner Dilemma 게임을 여러 번 반복– 상대방이 배반했을시 벌칙을 가하는 것이 가능
• IPD 게임의 결과– 게임을 반복할수록 서로 협력하는 양상을 보임– 게임의 player 가 학습능력이 있어야 함 반복을 통해 , 협력하는 것이 궁극적으로 더 많은 이득을 가져온다는 것을
학습
5
N-person Iterated Prisoner's Dilemma Game
• nIPD 게임의 특징– 2 명 n 명으로 player 가 증가– Real-world problem 을 보다 폭 넓게 반영– 문제를 모델링하기 위해 ‘진화연산’이 주로 사용
• Robert Axelrod 의 nIPD 게임 실험 – nIPD 게임 상황에서 , 각 개체는 어떻게 행동하는 것이 가장 합리적인
가 ?– 실험 과정
• step1) 각 분야의 전문가가 수동으로 작성한 전략을 서로 경쟁• step2) 진화연산을 이용해 각 개체의 전략을 진화
실험결과 , 가장 우세 전략은 ?
6
Robert Axelrod’s nIPD game – Step1• 각 학문 분야의 전문가들에게 IPD 게임에서 특정 행동 전략을
수행하는 프로그램 요청– 각 프로그램은 이전의 3 번의 게임에서 자신과 상대방의 행동 ( 배신 ,
협력 ) 을 기억– 자신의 행동전략은 이 기억에 기반
• ex) 상대방이 2 번 배신했으면 나도 배신 , 무조건 배신 , 2 회 협력 후 1 회 배신
• 각 프로그램을 서로 경쟁시켜 가장 우세한 전략을 선정– 방식 : round-robin tournament– 총 63 개의 프로그램이 경쟁
• 어떤 프로그램은 마르코프 모델이나 베이즈 추론 같은 복잡한 기법을 사용
• 게임의 최종승자– 제출된 전략중 가장 간단한 ‘ TIT FOR TAT’– TIT FOR TAT: 처음은 일단 협력 , 이후부터는 상대방의 행동을
따라하기7
Robert Axelrod’s nIPD game – Step2• 진화연산이 전략을 성공적으로 진화시킬 수 있는지 실험
• Encoding– C : Cooperation D : Defect– 이전 1 번의 게임에 대해 ,
– 행동전략 : 각 경우에 대해 어떻게 행동 ( 협력 , 배반 ) 할지 규정– ex) TIT FOR TAT
8
CC CD DC DDcase 1 case 2 case 3
협력
총 4 가지 경우가 존재 !
CC CD DC DD
case 4
배신 협력 배신
Robert Axelrod’s nIPD game – Step2• Encoding - 이전 3 번의 게임을 기억해야 하는 경우
CC CC CC (case 1)CC CC CD (case 2)CC CC DC (case 3)
…DD DD DC (case 63)DD DD DD (case 64) 따라서 총 64bit + 6bit 로 전략 encoding 가능
• 64bit : 각 경우와 행동을 1 대 1 맵핑• 6bit : 이전 3 번의 행동을 기억• EX) CCDCDDDC … DC CCDDCD
– 가능한 전략의 수 = 270
9
64 가지 경우
Robert Axelrod’s nIPD game – Step2 • 기타 변수들
– Fitness : Payoff 의 합– Population : 20– Generation : 50
• 실험 결과– 진화된 대부분의 전략은 협력에 보답하고 배신에는 보복하는 양상
• TIT FOR TAT 과 유사 !!– TIT FOR TAT 보다 더 높은 점수를 얻는 전략도 발견
• 실험 양상① 초기 세대에는 협조적인 개체들이 다른 개체에 보답을 받지 못하고 소멸② 약 10~20 세대 이후에는 협조에 보답하고 배신에 보복하는 전략이
등장③ 이후 위와 같은 전략이 population 에 다수 분포
10
Evolution of Iterated Prisoner's Dilemma Game Strategies in Structured Demes Under Random
Pairing in Game Playing
Hisao Ishibuchi, Member, IEEE, and Naoki Namikawa, Student Member, IEEE
김 희 택
IEEE TRANSACTIONS ON EVOLUTIONARY COMPUTATION, VOL. 9, NO. 6, DECEMBER 2005
12
Outline• Introduction
• Two neighbor structure– IPD game structure– Mating strategy
• Simulation – Standard Pairing Scheme
• Random Pairing Scheme
• Simulation – Random Pairing Scheme
• Conclusion
13
Introduction• Spatial IPD game
– Framework of structured demes– Cells of two-dimensional grid-world
• Two neighborhood structure① Interaction among players through the IPD game② Interaction among players for mating strategiesSimilar to world of territorial animals or plant
• Random pairing scheme– Plays game with a randomly chosen neighbor at every
round– Demonstrate evolution of cooperation behavior (in
random pairing)
14
Basic structure – Payoff Matrix
• Payoff Matrix of the game
15
Basic structure – Strategy Encoding• Single player has a single strategy
• Every Strategy is represented by 5 bit binary se-quence
– Example of strategy (TIT-FOR-TAT)
16
IPD game structure – World and Neighbor-hood
• Use 31 * 31 grid-world– All player locate on one cell– 961 player exist
• Examples of neighborhood structure
17
IPD game structure - Game play and Fitness
• NIPD(i)– The set of Player i and its neighbors
• Game play– The game is iterated for a pre-specified number of rounds
(e.g, 100 rounds)– Each player plays game against only its neighbors
• Randomly select opponents
• Fitness – Average payoff obtained from each round of the game
18
Mating strategy – formulation • NGA(i)
– Set of player i and its neighbors NIPD(i) = NGA(i) is not always hold
• Parents is selected from NGA(i)– Using roulette wheel selection
• Selection probability of strategy j
– f(si) : fitness of player i with strategy si
– Fmin(NGA(i)) : minimum fitness among the NGA(i)
19
Mating strategy – crossover and muta-tion
• One point crossover
• Bitmap mutation
20
Simulation• Two kinds of simulation
① Simulate two neighborhood structure with standard pairing scheme• Verify the effect of two neighborhood structure on evolution
of cooperative behavior② Simulate two neighborhood structure with random pair-
ing scheme• Examine the effect random pairing scheme on evolution of
cooperative behavior
• 961 spatially fixed player (31 * 31 grid-world)
• Mistake (noisy IPD model)– A player chooses an action different from its strategy
21
Standard Pairing Simulation – Parame-ter Setting
• Case of two neighborhood structure
• Parameter value
Mistake probability 0, 0.001, 0.01, 0.1Crossover probability 1.0Mutation probability 1 / (5*961)
Termination of IPD game 100 roundsTermination of evolution 1000 generations
22
Standard Pairing Simulation – Result
• NIPD has a significant effect on the evolution of coop-erative behavior
• NGA has a much smaller effect than NIPD
• Small NIPD facilitate the evolution of cooperative be-havior
<Mistake probability 0.1>
23
Standard Pairing Simulation – Result (2)
• Better results were obtained from smaller mistake probabilities
• Cooperative behavior were evolved independently from the two neighborhood structures
<Mistake probability 0.01>
<Mistake probability 0.001>
24
Random Pairing Scheme• Every player chooses its opponent randomly from NIPD at every round of the game
• The memory about the interaction with a neighbor may influence an player’s future action against an-other neighbor
25
Random Pairing Simulation – Result (1)
• The same parameter specifications were used as in the previous
• Evolution of cooperative behavior is very difficult to achieve
• Increase number of opponents Decreased the prob-ability to play against the same opponent Decrease in average payoff
<Mistake probability 0>
26
Random Pairing Simulation – Result (2)
• Strategy characterized by the genetic form “1***1”
Parameter ValueMistake probability 0
NIPD(i) 3NGA(i) 5
27
Random Pairing Simulation – Result (3)
• Strategy characterized by the genetic form “****0”– The existence of strategies of this type prevents the con-
secutive occurrence of mutual cooperation
Parameter ValueMistake probability 0
NIPD(i) 5NGA(i) 5
28
Random Pairing Simulation – Result (4)
• Strategy characterized by the genetic form “11**1” – Those strategies have the ability to recover from mutual
defection (D, D)– This ability seems to be important under a noisy situation
Parameter ValueMistake probability 0.01
NIPD(i) 3NGA(i) 5
29
Random Pairing Simulation – Result (5)
Parameter ValueMistake probability 0.01
NIPD(i) 5NGA(i) 5
• The TFT strategy “10011” increased its percentage to almost 100%• Higher average payoff was obtained from strategies of the form “11**1,” rather
than the TFT strategy “10011.”
30
Other Simulations
31
Conclusion• Formulated a spatial IPD game using the concept of two neighborhood structures
① Interaction among players through the IPD game② Mating strategies– Computer Simulation
• Use of a small interaction neighborhood facilitated the evolu-tion of cooperative behavior
• Introduced a random pairing scheme with the two neighborhood structures
– Computer Simulation• Cooperative behavior was evolved when we smallest interac-
tion neighborhood is used
• Future Work– Explain the results of random pairing scheme simulation– Use a stochastic strategy represented by a string of real
numbers between 0 and 1– Evolution of cooperative behavior under the random pair-
ing scheme in a large interaction neighborhood
Simulation on Worksite Interactions be-tween Laborers and Firms by using
Multi-Agent based Evolutionary Computa-tion
Soft Computing Laboratory, Yonsei Univer-sity
Hee-Taek Kim and Sung-Bae [email protected] , [email protected]
sei.ac.kr
Social Simulation Workshop at the International Joint Conference on Artificial Intelligence
Motivation
• Laborers and firms formulate strategic relationship– What is rational strategy in position of laborer or firm
• Can we drive mutual benefits relation between Labor-ers and firm?
• General economic belief• laborer tends to cooperate with cooperative firms• Firm tends to cooperate with cooperative laborers 33
Wage
Labor
Highwage
...
Low wage,
but high productiv-
ity<Firm>
<Laborer>
Introduction of the Simulation Model
• Construct computational work-site interaction model– Multi-agent based approach– Consist of worker agent and firm agent– Implement adaptive agent by using evolutionary computa-
tion
• Simulate interaction between workers and firms– Workers and firms are mutually interact each other– Make collaborative or competitive relationship
34
Evolutionary Computation• Based on Darwinism
– “Survivals of the fittest”– Apply evolutionism to computation
• Widely used to modeling social phenomena– Individual population, behavioral rule, selection and re-
production– Each individual can adapt to dynamic environment
• Basic evolution process
35
Population Selection
Reproduc-tion
(Crossover and muta-
tion)
CalculateFitness
Simulation Process – Laborer’s Phase• The interaction protocol between workers and firms can be divided into two phase
– Laborer’s phase and firm’s phase
36
• Laborers have to decide whether to resign from firm or not
• Laborers have to decide whether to cooperate or defect with his employer
<Laborers Phase>
Simulation Process – Firm’s Phase• Firm’s phase
37
• Firms have to decide whether to cooperate or defect with his opponent laborers
Overall Process of Simulation
38
Simulation framework
39
Internal Attributes – Laborer
Attributes of laborer Descriptionint ID Unique identifier of this laborer
int employedFirmID Unique identifier of a firm who employed this laborer
double asset Total asset of this laborer
double productivity The productivity offered to firm
double livingCost Living expenses per one generation. Subtract from asset
int state Current state { WORKING, JOBLESS, FRESH, FAILED }
int continues The counts of generations from employment to now
Array chromosome Array of integers representing strategy of this laborer
Array firmCareer After resignation, laborer never employed to same firm again
Queue firmPastBehaviors The cooperation history of the firm employed this laborer
Queue laborerPastBehaviors The cooperation history of this laborer
40
Internal Attributes– Firm
Attributes of firm Description
int ID Unique identifier of the firm
double capital Total capital of this firm. Correspond to laborer’s asset
double supportingCost The cost for maintenance of a firm
Array chromosome Array of integers representing strategy of this firm
Array myLaborers Array of laborers who are employed in this firm
41
Action of Agent• Cooperation and defection
• Laborer– Cooperation : High Productivity (ProdH)– Defection : Low Productivity (ProdL)– Resign : resign from opponent firm
• Firm– Cooperation : High wage (WageH)– Defection : Low wage (WageL)
42
(Laborer, Firm) Firmcooperation defection
La-borer
Cooperation (WageH, ProdH - WageH) (WageL, ProdH – WageL)
Defection (WageH, ProdL - WageH) (WageL, ProdL – WageL)
Behavioral Strategy of Agent• Behavioral strategy determine current action of the agent
– All individuals has its own strategy– All strategies evolve as the simulation being progressed
43
0 1011 1 1001
0 1 2 3 4 5 6 7 8 9
0 : Defection
1 : Cooperation
Cooperation number of opponent laborer
Cooperation number of opponent firm
If (laborerPastBehaviors.countCoperation == 5) then return COOPERATE
Strategy to decide cooperation or defection
Strategy to decide cooperation or defection
1 1001 0 0110
0 1 2 3 4 5 6 7 8 9
Strategy of firm encoded on firm chromosome
Strategy of laborer encoded on laborer chromosome
Evolutionary Engine• Fitness evaluation
– Firm• The capital attribute is treated as fitness of the firm
– Laborer• The asset attribute is treated as fitness of the laborer
• Selection– Used roulette wheel selection– Possibility of selection
44
'
0,,1',', )Profit()Capital()Profit()Capital(
t
titititit ffff
))),Wage()(Prod(('
0 1,,,,, CostSupportinglfl
t
t
m
jjititjit
'
0,,,
'
0,,,, )),ˆ(Wage()Profit()Asset(
t
tjitit
t
tjitjit livingCostlfll
k
i
m
jjit
jitjit
l
llP
0 1,,
,,,,
)Asset(
)Asset()(
k
iit
itit
fCapital
fCapitalfP
1,
,,
)(
)()(
Evolutionary Engine• Crossover and mutation
– One point cross over– One point bit mutation
• Elimination– Eliminate incapable agents from simulation
45
0)(Capital0)(Asset ,,, itjit forl
Experimental DesignDescription Value
Firm
Initial capital 2000Initial number of laborers per one firm 10Maximum number of laborers per one firm 30supportingCost 30WageH 12WageL WageH/2
Laborer
Initial asset 200livingCost 10ProdH 18
ProdL ProdH/2
Othe
Initial number of firms 30Maximum capacity of history queue ( ) 10
Mistake probability 0.01
46
Description ValueInitial population of firm 30Maximum population of firm InfiniteInitial population of laborers 330Maximum population of laborers InfiniteIncrement rate of laborers population(Reproduce rate) 0.005
Mutation rate 0.005Selection method Roulette wheel Crossover method 1 point crossover
(Worker, Firm) Firmcooperation Defection
WorkerCooperation (12, 6) (6, 12)
Defection (12, -3) (6, 3)
(Laborer, Firm) Firmcooperation defection
La-borer
Cooperation (WageH, ProdH - WageH) (WageL, ProdH – WageL)
Defection (WageH, ProdL - WageH) (WageL, ProdL – WageL)
Experimental Result
47
Experimental Result (2)
48
Conclusion – Second Experiment• Forbid resignation of laborers
– Laborers cannot escape from vicious firm– Firms just want to extort faithful laborer
• Results in breakdown of all agents because of selfish behavior of the firms
49
Current Works• Extend 2*2 interaction model Continuous model based on linear algebra
– Asset/livingCost X1 + RecentGivenPay X2 + Continuous X3 …
• Beside previous activity of opponent agent, many other factors can affect current action of the agent
– Environmental information, my current state, opponent state, and so on…
• Test various policies to simulation model and analysis it’s effect
50
과제
• nIPD game 을 직접 구현해 봅시다 ^^
• 기본적인 실험방법은 Robert Axelrod’s nIPD game 과 동일– Population, Generation, Mutation Rate, Crossover Rate,
payoff matrix, 게임 방식 모두 자유– 단 payoff matrix 는 prisoner’s dilemma game 의 조건을
만족해야 함– http://
www.aistudy.co.kr/biology/genetic/example_mitchell.htm참고
• 단 , 3 번의 이전게임이 아니라 , 바로 직전 1 번의 게임만 기억– 따라서 전략 길이는 6bit 가 됨
• 제출물– 보고서 , 소스코드– 기한 : 9 월 24– 언어 : VS2008 로 돌아가는 거 (C, C++, C# 등 )
51
보고서
• 실험 개요
• 실험 셋팅에 관한 내용– Population, Generation, Mutation Rate, Crossover Rate,
payoff matrix, 게임 방식 등
• 실험 결과– 실험결과 우세 전략이 어떻게 나왔는가 ?– 그래프 , 도표 등을 동원하여 진화 과정을 잘 보일 수도 있을 듯– 스크린 샷
• 결론
52
감 사 합 니 다