Vous êtes sur la page 1sur 111

Distributed Constraints

Distributed Constraints
Jos e M Vidal
Department of Computer Science and Engineering, University of South Carolina
January 15, 2010
Abstract
Algorithms for solving distributed constraint problems in
multiagent systems. Chapter 2.
Distributed Constraints
Constraint Satisfaction
Centralized
Outline
Distributed Constraints
Constraint Satisfaction
Centralized
Graph Coloring
Distributed Constraints
Constraint Satisfaction
Centralized
Graph Coloring
Distributed Constraints
Constraint Satisfaction
Centralized
Constraint Satisfaction Problem (CSP)
Given variables x
1
, x
2
, . . . x
n
with domains D
1
, D
2
, . . . D
n
and a set of
boolean constraints P of the form pk(x
k1
, x
k2
, . . . , x
kj
) {0, 1}, nd
assignments for all the variables such that no constraints are
violated.
Distributed Constraints
Constraint Satisfaction
Centralized
Depth First Search for the CSP
ocrtu-r|nst-sctnou-osr(i, g)
1 if i > n
2 then return g
3 for v D
i
4 do if setting x
i
v does not violate any constraint in P given g
5 then g

ocrtu-r|nst-sctnou-osr(i +1, g +{x


i
v})
6 if g


7 then return g

8
9 return
Distributed Constraints
Constraint Satisfaction
Distributed
Outline
Distributed Constraints
Constraint Satisfaction
Distributed
Denition (Distributed Constraint Satisfaction Problem (DCSP))
Give each agent one of the variables in a CSP. Agents are
responsible for nding a value for their variable and can nd out the
values of their neighbors via communication
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
Outline
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
ncv|sc(x
i
, x
j
)
1 old-domain D
i
2 for v
i
D
i
3 do if there is no v
j
D
j
consistent with v
i
4 then D
i
D
i
v
i
5 if old-domain D
i
6 then
k{neighbors of i}
k.utuotc-ucw-ocvt|u(i, D
i
)
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
x
3
x
2
x
1
x
3
x
2
x
1
x
3
x
2
x
1
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
x
3
x
2
x
1
x
3
x
2
x
1
x
3
x
2
x
1
ncv|sc(x
1
, x
3
)
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
x
3
x
2
x
1
x
3
x
2
x
1
x
3
x
2
x
1
ncv|sc(x
1
, x
3
)
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
x
3
x
2
x
1
x
3
x
2
x
1
x
3
x
2
x
1
ncv|sc(x
1
, x
3
)
Communicate
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
x
3
x
2
x
1
x
3
x
2
x
1
x
3
x
2
x
1
ncv|sc(x
1
, x
3
)
ncv|sc(x
2
, x
3
)
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
x
3
x
2
x
1
x
3
x
2
x
1
x
3
x
2
x
1
ncv|sc(x
1
, x
3
)
ncv|sc(x
2
, x
3
)
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
Filtering fails to detect no-solution.
Distributed Constraints
Constraint Satisfaction
Filtering Algorithm
x
1
x
2
x
3
Filtering fails to detect no-solution.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
Outline
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
Denition (k-consistency)
Given any instantiation of any k 1 variables that satisfy all
constraints it is possible to nd an instantiation of any k
th
variable
such that all k variable values satisfy all constraints.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
Denition (Strongly k-consistent)
A problem is strongly k-consistent if it is j-consistent for all j k.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
Denition (Hyper-Resolution Rule)
A
1
A
2
A
m
(A
1
A
11
)
(A
2
A
21
)
:
(A
m
A
m1
)
(A
11
A
21
A
m1
)
.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
x
1

x
2

x
3

Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=)
x
1

x
2

x
3

x
1
x
1
=x
1
=
(x
1
=x
2
=)
(x
1
=x
3
=)
(x
2
=x
3
=)
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
x
1

x
2

x
3

x
1
Sends (x
2
=x
3
=) to x
2
and x
3
.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
(x
3
=)
x
1

x
2

x
3

x
2
x
2
=x
2
=
(x
2
=x
3
=)
(x
2
=x
3
=)
(x
3
=)
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=)
x
1

x
2

x
3

x
1
x
1
=x
1
=
(x
1
=x
2
=)
(x
1
=x
3
=)
(x
2
=x
3
=)
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=)
x
1

x
2

x
3

x
1
Sends (x
2
=x
3
=) to x
2
and x
3
.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=)
(x
3
=)
x
1

x
2

x
3

x
2
x
2
=x
2
=
(x
2
=x
3
=)
(x
2
=x
3
=)
(x
3
=)
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=)
(x
3
=) (x
3
=)
x
1

x
2

x
3

x
2
Sends (x
3
=) and (x
3
=) to x
3
.
Distributed Constraints
Constraint Satisfaction
Hyper-Resolution Based Consistency Algorithm
x
1
x
2
x
3
x
1
=x
1
= x
2
=x
2
= x
3
=x
3
=
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
1
=x
2
=) (x
1
=x
2
=) (x
1
=x
2
=)
(x
2
=x
3
=) (x
2
=x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=) (x
2
=x
3
=)
(x
2
=x
3
=) (x
3
=)
(x
3
=) (x
3
=)
x
1

x
2

x
3

x
3
x
3
=x
3
=
(x
3
=)
(x
3
=)
Contradiction
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Outline
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
?
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Backtracking
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Agent Variables
priority: the agents xed priority number. All agents are
ordered.
local-view: current values of other agents variables.
current -value: current value of agents variable.
neighbors: initially, the set of agents with whom agent shares
a constraint.
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Remote Calls
utuotc-ck?(j, x
j
) This message asks the receiver if that
assignment does not violate any of his constraints.
utuotc-ucccco(j, nogood) which means that j is reporting that it
cant nd a value for his variable because of nogood.
utuotc-too-uc|cuacn(j) which requests the agent to add some
other agent j as its neighbor.
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
utuotc-ck?(j, x
j
)
1 local-view local-view+(j, x
j
)
2 oucok-tcott-v|cw()
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
oucok-tcott-v|cw()
1 if local-view and x
i
are not consistent
2 then if no value in D
i
is consistent with local-view
3 then atoktntok()
4 else select d D
i
consistent with local-view
5 x
i
d
6
kneighbors
k.utuotc-ck?(i, x
i
)
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
utuotc-ucccco(j, nogood)
1 record nogood as a new constraint
2 for (k, x
k
) nogood where k neighbors
3 do k.utuotc-too-uc|cuacn(i)
4 neighbors neighbors +k
5 local-view local-view+(k, x
k
)
6 old-value x
i
7 oucok-tcott-v|cw()
8 if old-value x
i
9 then j.utuotc-ck?(i, x
i
)
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
atoktntok()
1 nogoods {V | V = inconsistent subset of local-view using hyper-resolution rule}
2 if an empty set is an element of nogoods
3 then broadcast that there is no solution
4 terminate this algorithm
5 for V nogoods
6 do select (j, x
j
) where j has lowest priority in V
7 j.utuotc-ucccco(i, V)
8 local-view local-view(j, x
j
)
9 oucok-tcott-v|cw()
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Example
x
1

x
2

x
3

x
2
x
3
o
k
?
(
x
2
,

)
o
k
?
(
x
3
,

)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
Added link
ok?(x
2
, )
local-view = (x
2
, )
nogood(x
2
, )
Distributed Constraints
Constraint Satisfaction
Asynchronous Backtracking
Theorem (ABT is Complete)
The ABT algorithm always nds a solution if one exists and
terminates with the appropriate message if there is no solution.
Proof.
By induction. First show that the agent with the highest priority
never enters an innite loop. Then show that given that all the
agents with lower priority that k never fall into an innite loop then
k will not fall into an innite loop.
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Outline
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Asynchronous Weak-Commitment (AWC)
Use dynamic priorities.
Change ok? messages to include agents current priority.
Use min-conict heuristic.
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
oucok-tcott-v|cw
1 if x
i
is consistent with local-view
2 then return
3 if no value in D
i
is consistent with local-view
4 then atoktntok()
5 else select d D
i
consistent with local-view
and which minimizes constraint
violations with lower priority agents.
6 x
i
d
7
kneighbors
k.utuotc-ck?(i, x
i
, priority)
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
atoktntok
1 generate a nogood V
2 if V is empty nogood
3 then broadcast that there is no solution
4 terminate this algorithm
5 if V is a new nogood
6 then
(k,x
k
)V
k.utuotc-ucccco(i, j, priority)
7 priority 1+max{neighbors priorities}
8 select d D
i
consistent with local-view
and which minimizes constraint
violations with lower priority agents.
9 x
i
d
10
kneighbors
k.utuotc-ck?(i, x
i
, priority)
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0 priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Example
x
1

x
2

x
3

priority = 0
priority = 0
priority = 0
x
2
x
3
o
k
?
(
x
2
,

,
0
)
o
k
?
(
x
3
,

,
0
)
local-view = (x
2
, ), (x
3
, )
n
o
g
o
o
d
(
x
2
=

x
3
=

)
,
1
priority = 1
Added link
ok?(x
2
, , 0)
local-view = (x
2
, )
nogood(x
2
, )
priority = 2
Distributed Constraints
Constraint Satisfaction
Asynchronous Weak-Commitment Search
Theorem (AWC is complete)
The AWC algorithm always nds a solution if one exists and
terminates with the appropriate message if there is no solution.
Proof.
The priority values are changed if and only if a new nogood is
found. Since the number of possible nogoods is nite the priority
values cannot be changed indenitely. When the priority values are
stable AWC becomes ABT, which is complete.
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Outline
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Hill Climbing
?
?
?
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Denition (Quasi-local-minimum)
An agent x
i
is in a quasi-local-minimum if it is violating some
constraint and neither it nor any of its neighbors can make a
change that results in lower cost for all.
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Remote Procedure Calls
utuotc-ck?(i, x
i
) where i is the agent and x
i
is its current value,
utuotc-|vrncvc(i, improve, eval) where improve is the maximum
i could gain by changing to some other color and eval is its
current cost.
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
utuotc-ck?(j, x
j
)
1 received-ok[j] tnuc
2 agent -view agent -view+(j, x
j
)
3 if
kneighbors
received-ok[k] = tnuc
4 then scuo-|vrncvc()
5
kneighbors
received-ok[k] rttsc
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
scuo-|vrncvc()
1 cost evaluation of x
i
given current weights and values.
2 my-improve possible maximal improvement
3 new-value value that gives maximal improvement
4
kneighbors
k.utuotc-|vrncvc(i, my-improve, cost )
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
utuotc-|vrncvc(j, improve, eval)
1 received-improve[j] improve
2 if
kneighbors
received-improve[k] ucuc
3 then scuo-ck
4 agent -view
5
kneighbors
received-improve[k] ucuc
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
scuo-ck()
1 if
kneighbors
my-improve received-improve[k]
2 then x
i
new-value
3 if cost > 0
kneighbors
received-improve[k] 0 quasi-local opt.
4 then increase weight of constraint violations
5
kneighbors
k.utuotc-ck?(i, x
i
)
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Example
3
2 5
4
1 6
1
1
1 1
1
1
1 1
1
1
1 1
1
1
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Example
3
2 5
4
1 6
1
1
2 2
1
1
2 2
1
1
2 2
1
1
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Example
3
2 5
4
1 6
1
1
2 2
1
1
2 2
1
1
2 2
1
1
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Example
3
2 5
4
1 6
1
1
2 2
1
1
2 2
1
1
2 2
1
1
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Theorem (Distributed Breakout is not Complete)
Distributed breakout can get stuck in local optima. Therefore, there
are cases where a solution exists and it cannot nd it.
Proof.
By example.
In practice, its really good.
Distributed Constraints
Constraint Satisfaction
Distributed Breakout
Theorem (Distributed Breakout is not Complete)
Distributed breakout can get stuck in local optima. Therefore, there
are cases where a solution exists and it cannot nd it.
Proof.
By example.
In practice, its really good.
Distributed Constraints
Distributed Constraint Optimization
Centralized
Outline
Distributed Constraints
Distributed Constraint Optimization
Centralized
Denition (Constraint Optimization Problem (COP))
Given variables x
1
, x
2
, . . . x
n
with domains D
1
, D
2
, . . . D
n
and a set of
constraints P of the form pk(x
k1
, x
k2
, . . . , x
kj
) , nd
assignments for all the variables such that the sum of the
constraint values is minimized.
Distributed Constraints
Distributed Constraint Optimization
Centralized
antuou-tuo-acuuo-ocr()
1 c Minimum cost found. Global variable.
2 g Best solution found. Global variable.
3 antuou-tuo-acuuo-ocr-uctrcn(1, )
4 return g

antuou-tuo-acuuo-ocr-uctrcn(i, g)
1 if i = n
2 then if P(g) < c

3 then g

g
4 c

P(g)
5 return
6 for v D
i
7 do g

g +{x
i
v}
8 if P(g) < c

9 then antuou-tuo-acuuo-ocr-uctrcn(i +1, g

)
Distributed Constraints
Distributed Constraint Optimization
Centralized
Denition (Distributed Constraint Optimization Problem (DCOP))
Give each agent one of the variables in a COP. Agents are
responsible for nding a value for their variable and can nd out the
values of their neighbors via communication
Distributed Constraints
Distributed Constraint Optimization
Adopt
Outline
Distributed Constraints
Distributed Constraint Optimization
Adopt
Remote Procedure Calls
threshold tell children how much cost they can incur, ignore
anything that costs more than that.
value tell descendants what value agent sets itself to.
cost tell parent lower and upper bounds of cost given the
current value assignments of ancestors.
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 0
x
2
= 1 x
3
= 0
x
4
= 1
p p
p
p
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 0
x
2
= 0
x
3
= 0 x
4
= 0
p
p
p p
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 0
x
2
= 0
x
3
= 0 x
4
= 0
value
x
1
= 0
value
x
1
= 0
value
x
2
= 0
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 0
x
2
= 0
x
3
= 0 x
4
= 0
cost
1,
x
1
= 0
cost
2,2
x
1
= 0
x
2
= 0
cost
1,1
x
2
= 0
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 1
x
2
= 0
x
3
= 0 x
4
= 0
value
x
1
= 1
value
x
1
= 1
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 1
x
2
= 1
x
3
= 1 x
4
= 0
cost
0,
x
1
= 1
cost
2,2
x
1
= 1
x
2
= 0
value
x
2
= 1
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 1
x
2
= 1
x
3
= 1 x
4
= 1
cost
0,3
x
1
= 1
cost
0,0
x
1
= 1
x
2
= 1
cost
0,0
x
2
= 1
Distributed Constraints
Distributed Constraint Optimization
Adopt
d
i
d
j
p(d
i
, d
j
)
0 0 1
0 1 2
1 0 2
1 1 0
x
1
= 1
x
2
= 1
x
3
= 1 x
4
= 1
cost
0,0
x
1
= 1
Distributed Constraints
Distributed Constraint Optimization
OptAPO
Outline
Distributed Constraints
Distributed Constraint Optimization
OptAPO
1
2 3
4 5
Distributed Constraints
Distributed Constraint Optimization
OptAPO
1
2 3
4 5
Distributed Constraints
Distributed Constraint Optimization
OptAPO
1
2 3
4 5
Distributed Constraints
Distributed Constraint Optimization
OptAPO
1
2 3
4 5
2
Distributed Constraints
Distributed Constraint Optimization
OptAPO
1
2 3
4 5
2
Distributed Constraints
Distributed Constraint Optimization
OptAPO
1
2 3
4 5
2
5
Distributed Constraints
Distributed Constraint Optimization
OptAPO
Theorem (APO worst case is centralized search)
In the worst case APO (OptAPO) will make one agent do a
completely centralized search of the complete problem space.
Proof.
By example.
Distributed Constraints
Distributed Constraint Optimization
OptAPO
Adopt versus OptAPO
Adopt is better when communications are fast.
OptAPO is better when communications are slow.
Both have very bad worst-case but seem to perform well.

Vous aimerez peut-être aussi