700 likes | 815 Vues
This paper introduces an Asynchronous Partitioning Framework (APF) designed for improving the performance of distributed constraint satisfaction problems (DCSPs). By leveraging the structure of constraint graphs, the framework utilizes a cooperative analysis of constraints and aims to enhance the Fail-First principle. It consists of algorithms for group partitioning, local search, and global search, allowing agents to collaborate efficiently. The proposed method focuses on identifying heavily constrained regions and solving local problems to achieve a globally consistent assignment, facilitating better agent cooperation and coordination in parallel search processes.
E N D
Asynchronous Partitioning Framework Vitaliy Freidovich Department of Mathematics and Computer Science Vice President R&D of www.TheCTO.co.il/en Vitaliy@TheCTO.co.il Ben-Gurion University Of the Negev The Open University of Israel Amnon Meisels Department of Computer Science www.cs.bgu.ac.il/~am am@cs.bgu.ac.il
Missing features of DCSP algorithms • Order of search unrelated to structure of constraints graph • Structure of constraints graph can enhance the use of the fail first principle • Utilization of graph structure in distributed search needs a method for agent cooperation and coordination
A better idea might be • Analyze cooperatively the constraints graph • Find regions which are the most heavily constrained, and partition the graph by those regions • Solve the local problem inside each region • Achieve globally consistent assignment by propagating relevant assignments between the different regions
Advantages • Enhancing the Fail First Principle • Concentrating on the toughest parts of the problem first • Improving performance by allowing parallel search inside different regions
Asynchronous Partitioning Framework • A general framework for agent cooperation and coordination • Composed of 4 distinct components: • GroupPartition algorithm - pluggable • Partition into disjoint groups • Select a group leader • LocalSearch algorithm - pluggable • GlobalSearch algorithm - pluggable • Agents are represented by their group leaders • Coordination engine • Adapt to assignments in higher priority groups • Ignore constraints with lower priority groups
Asynchronous Partitioning Framework • Requirements: • GroupPartition algorithm: • Form disjoint groups • Each group must contain at least one ‘fully’ connected agent • Elect one such agent to be a group leader • Assign injective priorities to groups • Order the agents inside each group • LocalSearch algorithm: • Synchronous - exactly one token • Allocate each agent an agent view • Update the agent view upon reception of a token • GlobalSearch algorithm: • Synchronous - exactly one token • The above requirements enable correctness
Asynchronous Group Partition • A first implementation of APF • Phases: • Initialization • Priority calculation • Group partitioning • Group ordering • Search for a solution • SBT for LocalSearch • CBJ for GlobalSearch • Phases 2-4 implement GroupPartition
An Example • 3-coloring problem • Find an assignment out of: {Red, Green, Blue}, such that no two connected agents are painted with the same color a10 a1 a8 a3 a4 a5 a9 a2 a6 a7
Phase 1: Initialization • Main goal: Initialize agent priority • Pai = ki + ∑j=1ki (CommonNeighbors(ai, aj)) • ki – number of neighbors of ai • Initially: Pai = ki a10 P=2 a1 P=2 a8 P=2 a3 P=4 a4 P=2 a5 P=5 a9 P=4 a2 P=1 a6 P=3 a7 P=3
Phase 2: Priority calculation • Each agent sends a list of its neighbors, to all its neighbors • Upon receiving this message, each agent replies with the number of joint neighbors • The originating agent, adds the replies to its priority, and notifies all the agents about its priority a10 P=2 a1 P=2 a8 P=2 a4 a6 a7 a8,a9 1 a3 P=4 a4 P=2 a5 P=5 a9 P=4 a4 a6 a7 a8,a9 a4 a6 a7 a8,a9 0 2 a4 a6 a7 a8,a9 a4 a6 a7 a8,a9 1 a2 P=1 a6 P=3 a7 P=3 2
Phase 2: Priority calculation • Each agent sends a list of its neighbors, to all its neighbors • Upon receiving this message, each agent replies with the number of joint neighbors • The originating agent, adds the replies to its priority, and notifies all the agents about its priority a10 P=2 a1 P=2 a8 P=4 a3 P=4 a4 P=2 a5 P=11 a9 P=8 a2 P=1 a6 P=5 a7 P=7
Phase 3: Group partitioning • Each agent performs a local search in its neighborhood • When an agent receives such a request: • If group leader: approves • If not a group leader: denies • If not determined: wait until is, and reply • The search continues until: • Some agent had approved the request • The current agent has the highest priority
Phase 3: Group partitioning a10 P=2 a1 P=2 a8 P=4 JOIN JOIN a4 P=2 a5 P=11 a9 P=8 a3 P=4 JOIN W:{a1} W:{a10} JOIN W:{a9} JOIN a2 P=1 a6 P=5 a7 P=7 W:{a3}
Phase 3: Group partitioning a10 P=2 a1 P=2 a8 P=4 a4 P=2 a9 P=8 a3 P=4 W:{a1} a5 P=11 W:{a9,a6} W:{a10} a2 P=1 a6 P=5 a7 P=7 W:{a3}
Phase 3: Group partitioning a10 P=2 a1 P=2 a8 P=4 a4 P=2 a9 P=8 a3 P=4 W:{a1} GL a5 P=11 NOT_JOINED JOINED W:{a10} JOINED a2 P=1 a6 P=5 NOT_JOINED a7 P=7 W:{a3}
Phase 3: Group partitioning a10 P=2 a1 P=2 a8 P=4 JOINED a4 P=2 a9 P=8 GL a5 P=11 GL a3 P=4 JOINED JOIN a2 P=1 a6 P=5 a7 P=7
Phase 3: Group partitioning JOIN a10 P=2 a1 P=2 NOT_JOINED a8 P=4 JOIN JOINED a4 P=2 a9 P=8 GL a5 P=11 GL a3 P=4 JOIN JOINED JOINED JOIN a2 P=1 a6 P=5 a7 P=7 • a1 and a10 have the same priority • a1 has a higher lexicographical priority
Phase 3: Group partitioning GL a10 P=2 a1 P=2 a8 P=4 a4 P=2 a9 P=8 GL a5 P=11 GL a3 P=4 a2 P=1 a6 P=5 a7 P=7
Phase 4: Group ordering • Group Priority Group Leader Priority • Inner Group Priority (IGP): • Calculated for each agent inside a group • IGPai = PGai + ∑jPcgij • IGPai – The Inner Group Priority of agent ai • PGai – The Priority of the Group of agent ai • Pcgij – The Priority of Connected Group j –The priority of the jth Group, to which agent ai is connected • In this way, agents connected to a greater number of bigger groups will have a higher IGP
Phase 4: Group ordering GLa10 P=2 a1 P=2 a8 P=4 IGP=4+2 IGP=17 IGP=6 IGP=11 GLa5 P=11 a9 P=8 GL a3 P=4 a4 P=2 IGP=4+11+11 IGP=11 IGP=15 IGP=26 IGP=13 a2 P=1 a6 P=5 a7 P=7 IGP=4 IGP=4 IGP=15 IGP=11 • Each agent notifies the other agents in its group about its IGP • The agents in each group are ordered by their calculated IGP • Equal priorities are resolved lexicographically
Phase 4: Group ordering GLa10 a1 IGP=6 O=2 IGP=17 O=1 a8 IGP=11 O=6 GLa5 a9 GL a3 IGP=26 O=1 a4 IGP=15 O=1 IGP=11 O=4 IGP=13 O=3 a2 IGP=4 O=3 a7 a6 IGP=15 O=2 IGP=11 O=5
Phase 5: Search for solution • The search proceeds in two levels in parallel: • SBT as APF’s LocalSearch • CBJ as APF’s GlobalSearch • Inside each group: • The token is being expanded through the group leader • Keeps consistency with: • Inter-group constraints • Higher priority intra-group constraints • Lower priority intra-group constrained agents are notified upon value changes
Phase 5: Search for solution • A global token is moved between the group leaders • When a group leader receives the global token: • Group is consistent: advance • Group is inconsistent: backtrack • Groups’ state hasn’t been determined: wait • Termination: • Last group is consistent • First group is inconsistent • Detailed example: Appendix (No time )
AGP-CBJ • A second implementation of APF • Identical to AGP; the LocalSearch algorithm is upgraded to be CBJ • Was formally proven to be correct
Experimental Evaluation • Three sets of experiments on randomly generated problems: • (n=10, k=10, 0.1≤p1≤0.9, 0.1≤p2≤0.9) • (n=15, k=10, 0.1≤p1≤0.9, 0.1≤p2≤0.9) • (n=20, k=10, 0.1≤p1≤0.9, 0.1≤p2≤0.9) • For each combination 10 instances • 2430 problems in total
Partitioning – What good is it? AGP-CBJ Partitioning appears to be beneficial 1 Group → Most likely an almost Clique
APF – Where is it best? We expect it to be best for low values of p1
Where is coordination best ? P1=0.4
Conclusions • Preliminary results indicate that partitioning into groups can be beneficial • Most efficient for sparse problems and for highly dense problems • Upgrading LocalSearch & GlobalSearch may improve performance • AFC-CBJ • Can APF’s requirements be relaxed ? • ABT
Future work • Upgrading LocalSearch & GlobalSearch • AFC-CBJ • Relaxing APF’s requirements • ABT • Upgrading heuristics • Partitioning priorities • Group ordering heuristic • Upgrading the partitioning strategy • Limiting the number of agents in a group?
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a10 is the first agent to start execution • a10 as a group leader: • Not the first one - generates no global token • Generates a new Token • Sends Token to the first agent in its group
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a10 as an agent: • Finds consistent assignment • Returns token to its group leader • a10 as a group leader: • Enters the consistent state
Phase 5: Search for solution • Group Leader a5 starts execution • First one - Generates a new GlobalToken • Generates a new Token • Sends Token to the first agent in its group GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token V_C a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a4: • Finds consistent assignment • Notifies a3 • Returns Token to a5
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token V_C Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a3 – group leader: • First generates a new Token • Sends to first agent • a3 – agent: • Finds consistent assignment • Returns Token to group leader
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token V_C Token V_C_H a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a3 - Group leader: • Forwards the value change message to the addressee • a3 - agent: • Updates agent view • Notifies group leader that value change was handled
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token R_T Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a3 - Group leader: • Asks a3 to regenerate new token • a3 - agent: • Regenerates Token • Returns Token to group leader
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a3 – group leader: • Sends Token to a3 • a3 – agent: • Finds consistent assignment
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 • a3 – group leader: • Sends Token to a3 • a3 – agent: • Finds consistent assignment • Returns Token to group leader
Phase 5: Search for solution GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5
Phase 5: Search for solution V_C GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken Token GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5
Phase 5: Search for solution V_C GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 Token Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5
Phase 5: Search for solution V_C GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 a4 P=2 O=1 V_C Token Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5 V_C
Phase 5: Search for solution V_C GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 Token V_C a4 P=2 O=1 Token V_C a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5
Phase 5: Search for solution V_C GLa10 P=2 O=1 a1 P=2 O=2 a8 P=4O=6 Token GlobalToken GLa5 P=11O=4 a9 P=8 O=3 GL a3 P=4 O=1 V_C a4 P=2 O=1 Token V_C Token a2 P=1 O=3 a6 P=5O=2 a7 P=7O=5