compapo : a complete version of the apo algorithm

37
CompAPO: A complete CompAPO: A complete version of the APO version of the APO Algorithm Algorithm Tal Grinshpoun and Amnon Meisels Department of Computer Science Ben-Gurion University of the Negev

Upload: tessa

Post on 06-Feb-2016

39 views

Category:

Documents


0 download

DESCRIPTION

CompAPO : A complete version of the APO Algorithm. Tal Grinshpoun and Amnon Meisels Department of Computer Science Ben-Gurion University of the Negev. Talk outline. Distributed Constraint Satisfaction Problems The APO algorithm A flaw in APO’s correctness proof Running APO on our example - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: CompAPO : A complete version of the APO Algorithm

CompAPO: A complete version CompAPO: A complete version of the APO Algorithmof the APO Algorithm

Tal Grinshpoun and Amnon MeiselsDepartment of Computer Science

Ben-Gurion University of the Negev

Page 2: CompAPO : A complete version of the APO Algorithm

Talk outlineTalk outline

Distributed Constraint Satisfaction Problems The APO algorithm A flaw in APO’s correctness proof Running APO on our example Identifying the problems Solving the problems Preliminary experimental evaluation

Page 3: CompAPO : A complete version of the APO Algorithm

The Nurses exampleThe Nurses exampleThree Shifts:

S1 8:00 – 16:00, S2 16:00 – 24:00, S3 24:00 – 8:00

Three Nurses:

Nurses: Anna, Bella, Clarissa

Constraints:

Personal: Anna can’t work between 8:00 – 9:00

Bella Can’t work between 17:00 – 20:00

Clarissa Can’t work nights

System: One nurse for every shift

Page 4: CompAPO : A complete version of the APO Algorithm

NP-complete problem, relevant for real-world problems such as timetabling, scheduling verification...

Structure: [V,D,R] (Variablesshifts , Domains of Valuesnurses, Constraints)

V1, V2, … Vn

]val1,val2,val

3 []val1,val2 [ ]val1,val2,val

3 [

Constraint Satisfaction ProblemConstraint Satisfaction Problem

Page 5: CompAPO : A complete version of the APO Algorithm

Two wards in a Hospital Nurses – ward 1: Diana, Emilia, Flora ward 2: Anna, Bella, Clarissa Anna, Bella, Diana are ‘Senior’ nurses In every shift there should be at least one senior nurse

S3

S1

S2

S3

S1

S2

First ward Second ward

Local Constraint Inter Constraint

One senior nurseOne senior nurse

A Distributed CSP exampleA Distributed CSP example

Page 6: CompAPO : A complete version of the APO Algorithm

APO algorithm – overviewAPO algorithm – overview

1. The problem is partitioned into groups

2. In each group a mediator is selected

3. Each mediator solves its local problem trying to minimize external constraints

4. Violated external constraints lead to growth of the group

5. If consistent – stop

6. Else, update the partitioning and goto 2

Page 7: CompAPO : A complete version of the APO Algorithm

Some building blocksSome building blocks…… pi – agent’s priority

Highest priority among conflicted agents mediator

mi – agents’ desire to mediate

Switched on by conflicts

mediate – participating in mediation session

If invited, generates a wait! message

good_list, agent_view – dynamic lists of relevant agentsAttempts to include all externally conflicting agents!!!

A very complicated algorithm…

Page 8: CompAPO : A complete version of the APO Algorithm

A1

A5

A9A8

A7

A3

An exampleAn example

A4

A2

A6

Page 9: CompAPO : A complete version of the APO Algorithm

Violated constraint

Violated constraint

A1

A5

A9A8

A7

A3

A2, A5, A7 and

A8 Send ok? too

InitializationInitialization

A4

A2

A6

ok?ok?

Page 10: CompAPO : A complete version of the APO Algorithm

A1

A5

A9A8

A7

A3

Attempt to mediateAttempt to mediate

A4

A2

A6

Can NOT

change itself –

has to mediate

evaluate?

evaluate?

evaluate?

evaluate?

evaluate?

Page 11: CompAPO : A complete version of the APO Algorithm

A1

A5

A9A8

A7

A3

Mediation by A4Mediation by A4

A4

A2

A6

evaluate!

evaluate!

evaluate!

evaluate!

evaluate!

Mediation group

Mediator

Page 12: CompAPO : A complete version of the APO Algorithm

APO correctness proofAPO correctness proof* *

Key point - growth of initially partitioned groups

*As presented in: Roger Mailler and Victor Lesser, “Asynchronous partial overlay: A new algorithm for solving distributed constraint satisfaction problems”, JAIR, 2006.

Group size (good_list)is increased

Group size (good_list)is not increased

Algorithm is complete

Infinite looping throughvalues may occur

Page 13: CompAPO : A complete version of the APO Algorithm

Our exampleOur example

A DisCSP with 8 agents, to allow at least 2 concurrent mediations

We assume finite message delays The problem to be solved – variation of a

coloring problem

Page 14: CompAPO : A complete version of the APO Algorithm

Solid lines – regular coloring constraints

Dashed lines – allow all except (G,G) and (B,B)

A2A1

A3

A4

A5A6

A7

A8

The exampleThe example

Page 15: CompAPO : A complete version of the APO Algorithm

Violated

constraint

Violated constraint

A2A1

A3

A4

A5A6

A7

A8 ok?ok?ok?

ok?

A4, A8 and A7

Send ok? too

Initialization – configuration 1Initialization – configuration 1

Page 16: CompAPO : A complete version of the APO Algorithm

Can NOT

change itself –

has to mediate

A2A1

A3

A4

A5A6

A7

A8

evaluate?

evaluate?

evaluate?evaluate?

Can NOT

change itself –

has to mediate

Attempt to mediateAttempt to mediate

Page 17: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8 evaluate!

evaluate!

evaluate!

evaluate!

Mediation group

Mediator

Mediation by A1Mediation by A1

Page 18: CompAPO : A complete version of the APO Algorithm

Meanwhile…

Page 19: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

evaluate?

evaluate?

evaluate?

evaluate?

Concurrent mediationConcurrent mediation

Page 20: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

evaluate?

evaluate!

wait!

evaluate!

Concurrent mediationConcurrent mediation

Page 21: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

Sub-problem

is consistent,

no external

constraints

violated, so

good_list of

A1 is NOT

expanded

Special

coloring

constraint

Mediation resultMediation result

Page 22: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

accept!accept!accept!accept!

Announce mediation resultAnnounce mediation result

Page 23: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8ok? ok?ok? ok?ok?

A3A8

A3

ok?

ok?ok?ok?ok?

ok?ok?

ok? message delayok? message delay

Page 24: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

evaluate?

A3

Remember ME?

evaluate!

A3

Concurrent mediationConcurrent mediation

A8

Page 25: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

A3

A3

Problem

consistent!

No external

Constraints

violations

Concurrent mediationConcurrent mediation

A8

Page 26: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

A3

A3

accept!accept!accept!

Assignment notificationAssignment notification

A8

Page 27: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

Can NOT

change itself –

has to mediate

Can NOT

change itself –

has to mediate

All ok? messages arriveAll ok? messages arrive (configuration 3)(configuration 3)

Page 28: CompAPO : A complete version of the APO Algorithm

A2A1

A3

A4

A5A6

A7

A8

……back at configuration 1back at configuration 1

Page 29: CompAPO : A complete version of the APO Algorithm

Identifying the problemsIdentifying the problems

Partial mediation sessions good_list does not grow Failing to get a lock when the good_list is full

Neighboring mediation sessions Concurrent Sequential

A2A1

A3

A4

A5A6

A7

A8

evaluate!

wait!

evaluate!

A8

A2A1

A3

A4

A5A6

A7

A8

A3

A3

Page 30: CompAPO : A complete version of the APO Algorithm

An aggressive approach Bumping into ongoing mediation sessions

A well-coordinated approach Cancel the mediation session upon receiving a

wait! message Agents are still aware of the mediator’s

willingness to mediate Highest priority agent will eventually obtain a

lock on all the agents in its good_list

Preventing partial mediation sessionsPreventing partial mediation sessions

Page 31: CompAPO : A complete version of the APO Algorithm

Sequential mediation sessions Add to accept! messages the complete mediated solution

Concurrent mediation sessions Maintain concList – list of agents that are potentially

involved in a concurrent mediation session Inform the mediator post factum of conflicts created due

to concurrent sessions Mediator adds the conflicting agent to its good_list good_list must grow (no partial mediation sessions)

Handling neighboringHandling neighboringmediation sessionsmediation sessions

Page 32: CompAPO : A complete version of the APO Algorithm

Two versions of APO APO-BB. The mediator performs a Branch and Bound

search to minimize the number of violated external constraints [Mailler & Lesser 2005]

APO-BT. The mediator finds the first satisfying solution [Benisch & Sadeh 2006]

Setup: 15 agents, 1 variable each, 10 values. Random DisCSPs:

P1 (Density)= 0.4, P2 (Tightness)= 0.3 – 0.9

Experimental evaluationExperimental evaluation

Page 33: CompAPO : A complete version of the APO Algorithm

Handling neighboringHandling neighboringmediation sessions – messages sentmediation sessions – messages sent

Page 34: CompAPO : A complete version of the APO Algorithm

Non-Concurrent Constraint ChecksNon-Concurrent Constraint Checks

Page 35: CompAPO : A complete version of the APO Algorithm

Maximal mediation sizeMaximal mediation size

Page 36: CompAPO : A complete version of the APO Algorithm

Maximal mediation sizeMaximal mediation size

Page 37: CompAPO : A complete version of the APO Algorithm

Thank you!Thank you!