compapo: a complete version of the apo algorithm tal grinshpoun and amnon meisels department of...

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: gannon-chatfield

Post on 14-Dec-2015

216 views

Category:

Documents


3 download

TRANSCRIPT

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

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

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

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

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

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

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…

A1

A5

A9A8

A7

A3

An exampleAn example

A4

A2

A6

Violated constraint

Violated constraint

A1

A5

A9A8

A7

A3

A2, A5, A7 and

A8 Send ok? too

InitializationInitialization

A4

A2

A6

ok?ok?

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?

A1

A5

A9A8

A7

A3

Mediation by A4Mediation by A4

A4

A2

A6

evaluate!

evaluate!

evaluate!

evaluate!

evaluate!

Mediation group

Mediator

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

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

Solid lines – regular coloring constraints

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

A2A1

A3

A4

A5A6

A7

A8

The exampleThe example

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

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

A2A1

A3

A4

A5A6

A7

A8 evaluate!

evaluate!

evaluate!

evaluate!

Mediation group

Mediator

Mediation by A1Mediation by A1

Meanwhile…

A2A1

A3

A4

A5A6

A7

A8

evaluate?

evaluate?

evaluate?

evaluate?

Concurrent mediationConcurrent mediation

A2A1

A3

A4

A5A6

A7

A8

evaluate?

evaluate!

wait!

evaluate!

Concurrent mediationConcurrent mediation

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

A2A1

A3

A4

A5A6

A7

A8

accept!accept!accept!accept!

Announce mediation resultAnnounce mediation result

A2A1

A3

A4

A5A6

A7

A8ok? ok?ok? ok?ok?

A3A8

A3

ok?

ok?ok?ok?ok?

ok?ok?

ok? message delayok? message delay

A2A1

A3

A4

A5A6

A7

A8

evaluate?

A3

Remember ME?

evaluate!

A3

Concurrent mediationConcurrent mediation

A8

A2A1

A3

A4

A5A6

A7

A8

A3

A3

Problem

consistent!

No external

Constraints

violations

Concurrent mediationConcurrent mediation

A8

A2A1

A3

A4

A5A6

A7

A8

A3

A3

accept!accept!accept!

Assignment notificationAssignment notification

A8

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)

A2A1

A3

A4

A5A6

A7

A8

……back at configuration 1back at configuration 1

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

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

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

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

Handling neighboringHandling neighboringmediation sessions – messages sentmediation sessions – messages sent

Non-Concurrent Constraint ChecksNon-Concurrent Constraint Checks

Maximal mediation sizeMaximal mediation size

Maximal mediation sizeMaximal mediation size

Thank you!Thank you!