Title: Gains of efficiency through coordination in Distributed search
1Gains of efficiency through coordination in
Distributed search
- Roie Zivan and Amnon Meisels
- Dept. of Computer Science
- Ben-Gurion University
2Constrained Satisfaction Problems (CSP)
- NP-complete problem, relevant for real-world
problems such as timetabling. - Structure V,D,R (Variables , Domains of
Values, Constraints).
V1, V2, Vn
val1,val2,val3
val1,val2
val1,val2,val3
3Constraints
- Define under what circumstances a value cannot be
assigned. - Unary constraints can be filtered in
preprocessing. - Binary constraints are a subset of the Cartesian
product of the domains of every two variables. -
V1 2
V3 4
4The Nurses example
Variables Shifts S1 800 1600, S2 1600
2400, S3 2400 800 Values Nurses
Aviva, Bila, Carmela Constraints Unary
Aviva cant work between 800 900
Bila Cant work between 1700 2000
Binary One nurse for every shift
(between each two variables there is a not equql
constraint)
5Solving the CSP
- Unary constraints can be filtered in
preprocessing (Aviva is extracted from S1s
domain and Bila from S2s). - Binary constraints are solved using some
centralized backtrack algorithm. - The solution
- S1,Bila,S2,Aviva,S3,Carmela
6A Distributed Constraint Network
7Distributed Constraints the Model
- Every Agent runs the same algorithm.
- Agents have no direct access to variables of
other Agents. - Agents can solve there local network.
- Agents send receive messages to check inter
constraints. - Messages eventually arrive at their destination.
- A FIFO order on messages in the same direction
between two agents.
8In our example
- Another department.
- Nurses Dina, Ela, Flora
- Aviva, Bila, Dina are Head nurses.
- In every shift there should be at least one head
nurse.
Local Constraint
Inter Constraint
S1
S1
S2
S2
S3
S3
First Department
Second Department
9Solving DisCSPs
A2
A1
V1 2
V2 ?
10First Approach Synchronous
- Inherited from centralized search.
- A total order is defined among agents
- Only one agent active at a time (other are idle).
- An agent receives the assignments of all the
agents with higher priority before it performers
its own assignment. - An agent that cannot find a consistent
assignment, backtracks.
11Synchronous search
A1
A2
A3
An-1
An
V12,V21,V3?
Current Partial Assignment (CPA)
12Second Approach Asynchronous
- Motivation
- Independency of agents.
- Concurrent effort.
- Principles
- Agents always hold an assignment which is
consistent with there view of the system. - On backtrack operations agents change there views
by eliminating inconsistent values.
13Asynchronous Backtrack (ABT)
A3
A2
A1
A4
A11
14Backtrack in Asynchronous search
Agent view of Agent A4 A12, A31
Nogood
A3
A12, A31
15ABT on Backtrack
A3
A2
A1
A4
A12, A31
16Yokoos comparison ABT vs SBT
17Advantages and drawbacks in AS
- Advantages
- Concurrent Computation.
- Backjumping.
- Forward-checking
- Drawbacks
- Computation is done against inconsistent partial
assignments. - Dependency on quality of communication
18Inconsistent computation in ABT
A3
A2
A1
A3,4
A4
A1,1,A3,1
A1,2
19Yokoos comparison ABT vs SBT
20Drawbacks in Yokoos experiment
- n-Queens is a solvable easy problem.
- Synchronous simulator (instantaneous messages)
for an asynchronous algorithm. - Most trivial synchronous algorithm.
- Synchronous backtrack can perform backjumping.
- Only one measurement
21Our experiments construction
- Asynchronous simulator. Agents implemented as
Java Threads - Measurement including
- Time steps
- Network load messages-sent
- Range of difficulties (including phase transition
problems) - The best algorithms among both families
- Different forms of communication.
- Instantaneous messages
- Fix message delay
- Random message delay
22Comparing concurrent steps
23Comparing message load
24Conclusion
- The basic assumption
- Asynchronous Search pays in network load
but increases efficiency - Back to the synchronous algorithms
- One active agent at a time
- One message at a time (low message load)
25Increasing Efficiency
- Two Ideas
- Asynchronous Forward-Checking
- Concurrent Backtrack Search
26Asynchronous Forward-Checking
A2
A1
A3
An-1
An
CPA
FC_CPAs (copies of the original CPA)
V12,V21,V3?
27A2
A1
A3
An-1
An
Not-OK Messages
V12,V22
Inconsistent partial assignment
28The proposed algorithm
- Keeps one Current Partial Assignment CPA
- The CPA is always consistent
- In every step, one agent holds the CPA and
attempts to (consistently) extend the partial
assignment on it - After adding their assignment to the CPA, agents
send copies of the CPA, to all unassigned agents - All unassigned agents receive the FC_CPA and
perform forward-checking asynchronously - When an empty domain occurs, a Not_OK message is
sent to all unassigned agents - A CPA received after a Not_OK, generates a
backtrack
29Recovery from collisions
A2
A1
A3
An-1
An
V12,V22 5
V12,V22 3
30Agent Dilemas
Mail Box
Current Message
A1,1,A2,2,A3,3 7
AgentView
A1,2,A2,1,A3,3 5
31Agent Dilemas
Mail Box
Current Message
A1,1,A2,1 3
AgentView
A1,1,A2,2,A3,3 7
32Agent Dilemas
Mail Box
Current Message
A1,1,A2,2 4
AgentView
A1,1,A2,2,A3,3 7
33Experimental analysis (outline)
- AFC is compared with the Asynchronous Backtrack
algorithm (Yokoo2000). - Randomly generated problems, n10 k10 a range
of tightness values - Algorithm performance is measured by the number
of steps and the number of messages. - Both algorithms are implemented within a
concurrent simulator with different forms of
communication. -
34Number of Steps
35Number of total MSGs sent
36Concurrent Synchronous Backtrack
Local data structures
CPAs
37Initial split of the search space
1,2,3,4
4
1
3
2
381
2
3
4
1
2
3
4
39The ConcBT algorithm
- The search space is initially split to a number
of sub-search-spaces no larger than the first
agent domain - One Current Partial Assignment CPA is kept for
each sub-search-space - Each CPA represents a synchronic search process.
- The assignments on the CPAs are always
consistent. - Each CPA carries a unique ID. An agent holding it
uses only the corresponding current-domain to
assign it. - Dynamic re-split is used in order to increase the
search on harder sub-search-spaces. - A simple heuristic is used to determine when
dynamic split is necessary.
40Agent actions
2,4
1,2,3,4
1,3
3,4
2,2
2,3,4
SP
A1,1,A2,2,A3,3 2,2
4,0
4
41Agent actions
2,4
1,2,3,4
1,3
3,4
2,2
2,3,4
SP
A1,3,A2,1,A3,3 4,0
4,0
4
42Dynamic split of the search space
1,2,3,4
_,_,_,_ 0
1
1,2,3,4
2
1,2,3,4
3
1,2,3,4
4
43Dynamic split of the search space
2,3,4
1
1,2,3,4
1,_,_,_ 1
2
1,2,3,4
3
1,2,3,4
4
44Dynamic split of the search space
2,3,4
1,_,_,_ 0
1
1,2,3,4
2
1,2,3,4
3
1,2,3,4
4
45Dynamic split of the search space
3,4
1
1,2,3,4
2,_,_,_ 1
2
1,2,3,4
3
1,2,3,4
4
46Dynamic split of the search space
3,4
1
2,3,4
2
1,2,3,4
2,1,_,_ 2
3
1,2,3,4
4
47Dynamic split of the search space
3,4
1
2,3,4
2
2,3,4
3
1,2,3,4
2,1,1,_ 3
4
48Dynamic split of the search space
3,4
1
2,3,4
2
2,3,4
2,1,1,_ 4
3
1,2,3,4
4
49Dynamic split of the search space
3,4
1
2,3,4
2
3,4
3
1,2,3,4
2,1,2,_ 5
4
50Dynamic split of the search space
3
4
0
1
2,3,4
1,2,3,4
2
3,4
2,1,2,_ 1
1,2,3,4
3
1,2,3,4
1,2,3,4
4
51Why not do the same in asynchronous search?
- IDIBT Interleaved Distributed Backtrack. Hammadi
(2001,2002) - Asynchronous search is performed in parallel on
split sub-search-spaces. - Drawbacks
- No possibility for dynamic splitting.
- The performance deteriorates for multiple
splitting.
52Hammadis results
53The splitting effect
54and in messages
55Comparison to asynchronous search
56Comparison to asynchronous search
57Conclusion
- The asynchronous approach for solving DisCSPs
does not achieve its goals. - AFC, and ConcBT are two ideas representing a new
approach some coordination in the concurrent
effort can increase efficiency. - The improvements are in both measurements time
and network-load.
58Future work
- Complete the picture ConcCBJ, AFC with DAC,
Ordering and privacy issues. - Formal evaluating model. The cycle model is not
compatible to an asynchronous system. - Generic representation for such algorithms (given
a centralized algorithm, generating a distributed
algorithm).
59CBJ vs ConcCBJ (no re splits yet)