370 likes | 384 Views
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
E N D
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 • Identifying the problems • Solving the problems • Preliminary experimental evaluation
The Nurses example Three 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
Constraint Satisfaction Problem • 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,val3] [val1,val2] [val1,val2,val3]
A Distributed CSP example • 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 Local Constraint Inter Constraint One senior nurse S1 S1 S2 S2 S3 S3 First ward Second ward
APO algorithm – overview • The problem is partitioned into groups • In each group a mediator is selected • Each mediator solves its local problem trying to minimize external constraints • Violated external constraints lead to growth of the group • If consistent – stop • Else, update the partitioning and goto 2
Some 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 agents Attempts to include all externally conflicting agents!!! A very complicated algorithm…
An example A1 A2 A5 A3 A4 A6 A7 A9 A8
ok? ok? Initialization Violated constraint A1 A2 A5 A3 A4 Violated constraint A6 A7 A9 A2, A5, A7 and A8 Send ok? too A8
evaluate? evaluate? evaluate? evaluate? evaluate? Attempt to mediate A1 A2 A5 A3 A4 Can NOT change itself – has to mediate A6 A7 A9 A8
evaluate! evaluate! evaluate! evaluate! evaluate! Mediation by A4 Mediator A1 A2 A5 A3 A4 A6 A7 A9 Mediation group A8
APO correctness proof * Key point - growth of initially partitioned groups Group size (good_list) is increased Algorithm is complete Group size (good_list) is not increased Infinite looping throughvalues may occur *As presented in: Roger Mailler and Victor Lesser, “Asynchronous partial overlay: A new algorithm for solving distributed constraint satisfaction problems”, JAIR, 2006.
Our 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
The example Solid lines – regular coloring constraints Dashed lines – allow all except (G,G) and (B,B) A1 A2 A8 A3 A7 A4 A6 A5
ok? ok? ok? ok? Initialization – configuration 1 A1 A2 Violated constraint A8 A3 A7 A4 Violated constraint A4, A8 and A7 Send ok? too A6 A5
evaluate? evaluate? evaluate? evaluate? Attempt to mediate Can NOT change itself – has to mediate A1 A2 A8 A3 A7 A4 Can NOT change itself – has to mediate A6 A5
evaluate! evaluate! evaluate! evaluate! Mediation by A1 Mediator A1 A2 A8 A3 A7 A4 Mediation group A6 A5
evaluate? evaluate? evaluate? evaluate? Concurrent mediation A1 A2 A8 A3 A7 A4 A6 A5
evaluate? evaluate! wait! evaluate! Concurrent mediation A1 A2 A8 A3 A7 A4 A6 A5
Mediation result A1 A2 Sub-problem is consistent, no external constraints violated, so good_list of A1 is NOT expanded A8 A3 A7 A4 Special coloring constraint A6 A5
accept! accept! accept! accept! Announce mediation result A1 A2 A8 A3 A7 A4 A6 A5
ok? ok? ok? ok? ok? ok? ok? ok? ok? ok? ok? ok? ok? message delay A1 A2 A8 A3 A8 A3 A7 A4 A6 A5 A3
evaluate? evaluate! Concurrent mediation A1 A2 A8 A3 A8 A3 A7 A4 Remember ME? A6 A5 A3
Concurrent mediation A1 A2 No external Constraints violations Problem consistent! A8 A3 A8 A3 A7 A4 A6 A5 A3
accept! accept! accept! Assignment notification A1 A2 A8 A3 A8 A3 A7 A4 A6 A5 A3
All ok? messages arrive(configuration 3) Can NOT change itself – has to mediate A1 A2 A8 A3 A7 A4 Can NOT change itself – has to mediate A6 A5
…back at configuration 1 A1 A2 A8 A3 A7 A4 A6 A5
wait! evaluate! evaluate! A1 A2 A8 A3 A3 A7 A4 A6 A5 A3 Identifying 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 A1 A2 A8 A3 A7 A4 A8 A6 A5
Preventing partial mediation sessions • 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
Handling neighboringmediation 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)
Experimental evaluation • 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