370 likes | 376 Views
Dynamic Ordering for Asynchronous Backtracking on DisCSPs. Roie Zivan and Amnon Meisels Dept. of Computer Science Ben-Gurion University. A Distributed Constraint Network. Agents’ local network. V 1. [0,1,2,3]. V 6. V 4. [0,1]. [0,1,2]. Agent 1. A “realistic” example.
E N D
Dynamic Ordering for Asynchronous Backtracking on DisCSPs Roie Zivan and Amnon Meisels Dept. of Computer Science Ben-Gurion University
A Distributed Constraint Network Dynm Ordr ABT - CP-2005
Agents’ local network V1 [0,1,2,3] V6 V4 [0,1] [0,1,2] Agent1 Dynm Ordr ABT - CP-2005
A “realistic” example • Two wards in a Hospital. • Nurses – ward 1: Dina, Ela, Flora ward 2: Aviva, Bila, Gila • Aviva, Bila, Dina 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 Dynm Ordr ABT - CP-2005
Solving DisCSPs A2 A1 V1 = 2 V2 = ? Dynm Ordr ABT - CP-2005
Sequential (synchronous) BT An A2 A3 An-1 A1 [V1=2],[V2=1],[V3=?]… Current Partial Assignment (CPA) Dynm Ordr ABT - CP-2005
Asynchronous Backtracking Motivation: Concurrent computation. Highlights: • Agents always hold an assignment which is consistent with their view of the system. • On backtrack operations, agents change their views by eliminating inconsistent values. Dynm Ordr ABT - CP-2005
Asynchronous Backtracking Simplifying Assumptions: • Each agent holds exactly one variable • Every agent can send messages to any other agent Dynm Ordr ABT - CP-2005
Asynchronous Backtrack (ABT) A3 A2 A1 [A3=1] A4 [A1=2] Dynm Ordr ABT - CP-2005
Backtrack in ABT AgentView of Agent A4: A1=2, A3=1 Nogood Current Assignment A3 A1=2, A3=1 A4=1 Dynm Ordr ABT - CP-2005
Backtracking generates links A3 A2 A1 A4 [A1=2], [A3=1] Dynm Ordr ABT - CP-2005
ABT – Strong Assumption All Agents are ordered by afixed order of Priorities [Yokoo 92-2000] [BesBrMes 2001 – 2005] [Hammadi 98 – 2002] [Gomez et. al 2002 – 2005] Dynm Ordr ABT - CP-2005
Motivation for dynamic reordering Results of recent studies of sequential assigning algorithms for DisCSPs: Nguyen & Faltings 2004 Brito & Meseguer 2004 Dynm Ordr ABT - CP-2005
Why is it a problem? [1] [1] V1 ≠ V2 V1 ≠ V2 A2 A1 V1 = 1 Dynm Ordr ABT - CP-2005
A2 A1 V1 = 1 Why is it a problem? [1] [1] V1 ≠ V2 V1 ≠ V2 Dynm Ordr ABT - CP-2005
Why is it a problem? [1] [1] V1 ≠ V2 V1 ≠ V2 A1 A2 V1 = 1 V2 = 1 Dynm Ordr ABT - CP-2005
A2 A1 V2 = 1 Why is it a problem? [1] [1] V1 ≠ V2 V1 ≠ V2 V1 = 1 Dynm Ordr ABT - CP-2005
A2 A1 Dynamic ordering can be a problem [1] [1] V1 ≠ V2 V1 ≠ V2 V2 = 1 V1 = 1 Dynm Ordr ABT - CP-2005
Reordering Asynchronous Backtracking • Asynchronous Weak Commitment - AWC [Yokoo 95 - 2000] (exponential space) • Hybridizing ABT and AWC into a polynomial space, complete protocol. [Silaghi and Faltings 2001] (complex algorithm with unrewarding results) Dynm Ordr ABT - CP-2005
Reordering – in standard backtracking 1 2 3 4 Dynm Ordr ABT - CP-2005
Reordering – sequential assignments algorithms 1 2 3 4 4 3 Dynm Ordr ABT - CP-2005
Reordering – sequential assignments algorithms 1 2 4 3 4 2 4 3 3 Dynm Ordr ABT - CP-2005
Reordering – standard backtracking Highlights: • Moving forward - choose a desirable order • Backtracking is done in the same order as the forward moves Same idea can be applied in Asynchronous Backtracking Dynm Ordr ABT - CP-2005
Ordering Rules for Agents in ABT • Change order only when changing assignment • Enforce reordering only on Agents with lower priority Dynm Ordr ABT - CP-2005
ABT with Dynamic Ordering [A1,2],[A2,1], [A4,1] A1,A3,A2,A4 A3 ≠ 1 A3 = 1 Dynm Ordr ABT - CP-2005
ABT with Dynamic Ordering [A1,2],[A2,1], [A4,1] A1,A3,A2,A4 A1,A3,A4,A2 A3 = 2 A1,A3,A4,A2 A3 = 2 Dynm Ordr ABT - CP-2005
Which order is most up-to-date? Time-Stamping method of Nguyen & Faltings 2004: • Each order is time-stamped • A time-stamp is an array of integers of size n, all initialized to 0 • Each agent that assigns its variable, updates the time-stamp as follows: • Counters of higher priority agents are untouched • The counter of the assigning agent is incremented by 1 • The counters of lower priority agents are set to zero • Time-stamps are compared lexicographically Dynm Ordr ABT - CP-2005
ABT with Dynamic Ordering [A1,1],[A3,1],[A2,3],[A4,2] A3 ≠ 1 A3 = 1 Dynm Ordr ABT - CP-2005
ABT with Dynamic Ordering [A1,1],[A3,1],[A2,3],[A4,2] [A1,1],[A3,1],[A2,3],[A4,2] [A1,1],[A3,1],[A4,2],[A2,3] [A1,1],[A3,2],[A4,0],[A2,0] [A1,1],[A3,1],[A2,3],[A4,2] A3 = 2 Dynm Ordr ABT - CP-2005
Choosing the right heuristic • Heuristics that work well for sequential assignment algorithms fail for ABT_DO (min-domain) • After each change of order, relevant Nogoodsare discarded • Nogood-triggered heuristic [Ginsberg-93] • Agent changes its current order only when it receives a Nogood which causes an assignment change • The Nogood sender is moved to a place immediately following that of the assigning agent • The only agent that moves up has no conflicts with newly formed lower priority agents few Nogoods are removed Dynm Ordr ABT - CP-2005
ABT_DO - Different Heuristics(20 Agents p1 = 0.4) Dynm Ordr ABT - CP-2005
ABT_DO - Different Heuristics(20 Agents p1 = 0.4) Dynm Ordr ABT - CP-2005
ABT_DO - Different Heuristics(20 Agents p1 = 0.7) Dynm Ordr ABT - CP-2005
ABT_DO - Different Heuristics(20 Agents p1 = 0.7) Dynm Ordr ABT - CP-2005
Nogoods removed by Different Heuristics( p1 = 0.4) Dynm Ordr ABT - CP-2005
Nogoods removed by Different Heuristics(p1 = 0.7) Dynm Ordr ABT - CP-2005
Conclusions • Dynamic Variable/Agent reordering is a powerful tool in CSP solving algorithms • Most previous studies of asynchronous backtracking used a fixed order of agents • Dynamic reordering for ABT with polynomial space can be achieved and implemented • The heuristic must take into consideration the loss of valid Nogoods • A Nogood-triggered heuristic, avoids Nogoods loss and improves the performance by a large factor • Number of messages decreases also Dynm Ordr ABT - CP-2005