You are on page 1of 124

Multiagent Systems

Distributed Constraint Optimization

Francesco Amigoni
Many of the following slides are taken from:
• the “lecture slides provided by authors”, Chapter 12, available
at:
http://www.the-mas-book.info/index.html
• the “Tutorial on Multi-agent Distributed Constrained
Optimization” at AAMAS2019, available at:
https://www2.isye.gatech.edu/~fferdinando3/cfp/AAMAS19/

Francesco Amigoni
Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Chapter 12: Distributed Constraint Handling and


Optimization

A. Farinelli1 M. Vinyals1 A. Rogers2 N.R. Jennings2

1
Computer Science Department
University of Verona, Italy
2
Agents, Interaction and Complexity Group
School of Electronics and Computer Science
University of Southampton,UK

Multi-Agent Systems. MIT Press, 2012 (2nd edition), edited by


Gerhard Weiss. http://www.the-mas-book.info

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Constraints

Pervade our everyday lives


Are usually perceived as elements that limit solutions to the
problems we face

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Constraints

From a computational point of view, they:


Reduce the space of possible solutions
Encode knowledge about the problem at hand
Are key components for efficiently solving hard problems

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Constraint Processing

Many different disciplines deal with hard computational problems that


can be made tractable by carefully considering the constraints that
define the structure of the problem.

Planning Operational Automated Reasoning Computer


Scheduling Research Decision Theory Vision

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Constraint Processing in Multi-Agent Systems

Focus on how constraint processing can be used to address


optimization problems in Multi-Agent Systems (MAS) where:

A set of agents must come to some agreement, typically via some


form of negotiation, about which action each agent should take in
order to jointly obtain the best solution for the whole system.

M2
M1

A1 A2 A2 A3

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Distributed Constraint Optimization Problems (DCOPs)


We will consider Distributed Constraint Optimization Problems (DCOP)
where:

Each agent negotiates locally with just a subset of other agents


(usually called neighbors) that are those that can directly influence
his/her behavior.

M2
M1

A2

A1 A3

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Constraint Networks

A constraint network N is formally defined as a tuple hX , D , C i where:

X = {x1 , . . . , xn } is a set of discrete variables;


D = {D1 , . . . , Dn } is a set of variable domains, which enumerate
all possible values of the corresponding variables; and
C = {C1 , . . . , Cm } is a set of constraints; where a constraint Ci is
defined on a subset of variables Si ✓ X which comprise the
scope of the constraint
r = |Si | is the arity of the constraint
Two types: hard or soft

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Hard constraints

A hard constraint Cih is a relation Ri that enumerates all the valid


joint assignments of all variables in the scope of the constraint.

Ri ✓ Di1 ⇥ . . . ⇥ Dir

Dj = Dk = {0, 1} Ri xj xk
0 1
1 0

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Soft constraints

A soft constraint Cis is a function Fi that maps every possible joint


assignment of all variables in the scope to a real value.
Fi : Di1 ⇥ . . . ⇥ Dir ! ¬

Fi xj xk
2 0 0
0 0 1
0 1 0
1 1 1

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Binary Constraint Networks

x1
Binary constraint networks are those where:

F 1,3
,2
Each constraint (soft or hard) is defined

F1
over two variables.
Every constraint network can be mapped to
a binary constraint network x2 x3

,4
requires the addition of variables and

F1
constraints

4
F2,
may add complexity to the model
They can be represented by a constraint
graph x4

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Different objectives, different problems

Constraint Satisfaction Problem (CSP)

Objective: find an assignment for all the variables in the network


that satisfies all constraints.

Constraint Optimization Problem (COP)

Objective: find an assignment for all the variables in the network


that satisfies all constraints and optimizes a global function.

Global function = aggregation (typically sum) of local functions.


F (x ) = Âi Fi (xi )

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Distributed Constraint Reasoning

A1
When operating in a
decentralized context:
a set of agents control
variables
A2
agents interact to find a A4
solution to the constraint
network

A3

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Distributed Constraint Reasoning

Two types of decentralized problems:


distributed CSP (DCSP)
distributed COP (DCOP)

Here, we focus on DCOPs.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Distributed Constraint Optimization Problem (DCOP)

A DCOP consists of a constraint network N = hX , D , C i and a set of


agents A = {A1 , . . . , Ak } where each agent:
controls a subset of the variables Xi ✓ X
is only aware of constraints that involve variable it controls
communicates only with its neighbours

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Distributed Constraint Optimization Problem (DCOP)

Agents are assumed to be fully cooperative


Goal: find the assignment that optimizes the global function, not
their local local utilities.
Solving a COP is NP-Hard and DCOP is as hard as COP.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems
Complete algorithms for DCOPs
Approximated Algorithms for DCOPs
Conclusions

Motivation

Why distribute?
Privacy
Robustness
Scalability

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Real World Applications

Many standard benchmark problems in computer science can be


modeled using the DCOP framework:
graph coloring
As can many real world applications:
human-agent organizations (e.g. meeting scheduling)
sensor networks and robotics (e.g. target tracking)

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Graph coloring

Popular benchmark
Simple formulation
Complexity controlled with few parameters:
Number of available colors
Number of nodes
Density (#nodes/#constraints)
Many versions of the problem:
CSP, MaxCSP, COP

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Graph coloring - CSP

Nodes can take k colors


Any two adjacent nodes should have different colors
If it happens this is a conflict

Yes! No!

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Graph coloring - Max-CSP

Minimize the number of conflicts

0 -1

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Graph coloring - COP

Different weights to violated constraints


Preferences for different colors

0 -2
-1

-3 -2

-1

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Graph coloring - DCOP

Each node:
controlled by one agent
Each agent:
Preferences for different colors
Communicates with its direct neighbours in the graph

-1
A1 A3 A1 and A2 exchange
-3 -2 preferences and conflicts
A3 and A4 do not
A2 A4 communicate
-1
Chapter 12: Distributed Constraint Handling and Optimization
Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Meeting Scheduling

Motivation:
Privacy
Robustness
Scalability

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Meeting Scheduling

In large organizations many people, possibly working in different


departments, are involved in a number of work meetings.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Meeting Scheduling

People might have various private preferences on meeting start times

Better after 12:00am

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Meeting Scheduling

Two meetings that share a participant cannot overlap

Window: 15:00-18:00
Duration: 2h

Window: 15:00-17:00
Duration: 1h

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

DCOP formalization for the meeting scheduling problem

A set of agents representing participants


A set of variables representing meeting starting times according
to a participant.
Hard Constraints:
Starting meeting times across different agents are equal
Meetings for the same agent are non-overlapping.
Soft Constraints:
Represent agent preferences on meeting starting times.

Objective: find a valid schedule for the meeting while maximizing the
sum of individuals’ preferences.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Graph coloring
Applications and Exemplar Problems
Meeting Scheduling
Complete algorithms for DCOPs
Target Tracking
Approximated Algorithms for DCOPs
Conclusions

Target Tracking

Motivation:
Privacy
Robustness
Scalability

Chapter 12: Distributed Constraint Handling and Optimization


MOTIVATING DOMAIN: 

SENSOR NETWORK
x1 x2

x3 x4

x5 x6

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


5
DCOP
DISTRIBUTED CONSTRAINT OPTIMIZATION

a1 a2
x1 x2

a3 c2 a4
c1
x3 x4

a5 a6
x5 x6

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


26
Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Complete Algorithms

Always find an optimal solution


Exhibit an exponentially increasing coordination overhead
Very limited scalability on general problems.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Complete Algorithms

Completely decentralised
Search-based.
Synchronous: SyncBB, AND/OR search
Asynchronous: ADOPT, NCBB and AFB.
Dynamic programming.

Partially decentralised
OptAPO

Next, we focus on completely decentralised algorithms

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Decentralised Complete Algorithms

Search-based Dynamic programming


Uses distributed search Uses distributed inference
Exchange individual values Exchange constraints
Small messages but Few messages but
. . . exponentially many . . . exponentially large
Representative: ADOPT [Modi Representative: DPOP [Petcu
et al., 2005] and Faltings, 2005]

We will discuss DPOP in detail

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

DPOP

DPOP (Dynamic Programming Optimization Protocol) [Petcu and


Faltings, 2005]:
Based on the dynamic programming paradigm.
Special case of Bucket Tree Elimination Algorithm (BTE)
[Dechter, 2003].

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

DFS arrangement

The same happens


for DPOP!

Before executing ADOPT, agents must be arranged in a depth


first search (DFS) tree.
DFS trees have been frequently used in optimization because
they have two interesting properties:
Agents in different branches of the tree do not share any
constraints;
Every constraint network admits a DFS tree.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

DPOP by example

x1 x1

Fi ,j xi xj
F 1,3
,2
F1

P2 , child !
2 0 0

, PP4 !

PP 3 , p
0 0 1
,4

F2,3
F1

x2 x3 0 1 0

ochild

seudo
1 1 1

pseud
x2

child
,4
F2

!
=>

P3
P4

, ch
ld ,
chi
x4

ild
DFS arrangement

!
Objective: find assignment x4 x3
with maximal value

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

DPOP phases

Given a DFS tree structure, DPOP runs in two phases:


Util propagation: agents exchange util messages up the tree.
Aim: aggregate all info so that root agent can choose optimal
value
Value propagation: agents exchange value messages down the
tree.
Aim: propagate info so that all agents can make their choice given
choices of ancestors

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Sepi : set of agents preceding Ai in the pseudo-tree order that are


connected with Ai or with a descendant of Ai .

x1 Sep1 = 0/

P2 , child !
, PP4 !

PP 3 , p
ochild

seudo
pseud

x2 Sep2 = {x1 }

child
!

!
P3
P4

, ch
ld ,
chi

ild
!

Sep4 = {x1 , x2 } x4 x3 Sep3 = {x1 , x2 }

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Util message

The Util message Ui !j that agent Ai sends to its parent Aj can be


computed as:
!
N N
Ui !j (Sepi ) = max Uk !i ⌦ Fi , p
xi Ak 2Ci Ap 2Pi [PPi

Size exponential All incoming messages Shared constraints with


in Sepi from children parents/pseudoparents
The ⌦ operator is a join operator that sums up functions with different
but overlapping scores consistently.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Join operator

F2,4 x2 x4 max{x4 } (F1,4 ⌦ F2,4 )


F1,4 ⌦ F2,4
2 0 0
x1 x2 x4 x1 x2 x4
0 0 1
4 0 0 0 0 0 0
0 1 0 max(4,0)
0 0 0 1 0 0 1
1 1 1
2 0 1 0
Project 0 1 0
Add max(2,1)
1 0 1 1 out x4 0 1 1
F1,4 x1 x4
2 1 0 0 1 0 0
2 0 0 max(2,2)
2 1 0 1 1 0 1
0 0 1
0 1 1 0 1 1 0
0 1 0 max(0,2)
2 1 1 1 1 1 1
1 1 1

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Complexity exponential to the largest Sepi .


Largest Sepi = induced width of the DFS tree ordering used.

A1 (root)
U2!1 x1 Sep2

U1!2
0 10
Sep4 1 5
A2 max(U3!2 ⌦ U4!2 ⌦ F1,2 )
x2
U4!2 x1 x2 U3!2 x1 x2 Sep3
U3
4 0 0 4 0 0
!2
4!

!
U

2 0 1 2
2 0 1
2 1 0 2 1 0
2 1 1 A3 2 1 1
A4

1 max(F1,3 ⌦ F2,3 )
2
max(F1,4 ⌦ F2,4 )
x4 x3
Chapter 12: Distributed Constraint Handling and Optimization
Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

Value message

Keeping fixed the value of parent/pseudoparents, finds the value that


maximizes the computed cost function in the util phase:
!
xi⇤ = arg max
xi
 Uj !i (xi , xp⇤ ) +  Fi ,j (xi , xj⇤ )
Aj 2Ci Aj 2Pi [PPi

S
where xp⇤ = Aj 2Pi [PPi {xj⇤ } is the set of optimal values for Ai ’s parent
and pseudoparents received from Ai ’s parent.
Propagates this value through children down the tree:
[

Vi !j = {xi = xi } [ {xs = xs⇤ }
xs 2Sepi \Sepj

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

A1 x1⇤ = max U1!2 (x1 )


x1

V1!2
!
A2 x2⇤ = max(U3!2 (x1⇤ , x2 ) ⌦ U4!2 (x1⇤ , x2 ) ⌦ F1,2 (x1⇤ , x2 ))
x2
V2 !
4
2!

!
V

A4 A3

x4⇤ = max(F1,4 (x1⇤ , x4 ) ⌦ F2,4 (x2⇤ , x4 )) x3⇤ = max(F1,3 (x1⇤ , x3 ) ⌦ F2,3 (x2⇤ , x3 ))
x4 x3

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Applications and Exemplar Problems Search Based: ADOPT
Complete algorithms for DCOPs Dynamic Programming DPOP
Approximated Algorithms for DCOPs
Conclusions

DPOP extensions

MB-DPOP [Petcu and Faltings, 2007] trades-off message size


against the number of messages.
A-DPOP trades-off message size against solution quality [Petcu
and Faltings, 2005(2)].

Chapter 12: Distributed Constraint Handling and Optimization


Example run of DPOP
SBB
B { } xi xj Cost
 Cost
 Cost
 Cost

(A,B) (A,C) (B,C) (B,D)

D 5 5 5 3

A { } 8 10 4 8

{ } C 20 20 3 10

{ } 3 3 3 3

Katsutoshi Hirayama, Makoto Yokoo: Distributed Partial Constraint Satisfaction Problem. CP 1997: 222-236

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


38
Francesco Amigoni
PSEUDO-TREE
B { } A { }

D
A { } B { }
{ } C

{ }
Definition: A spanning tree of the constraint C D

graph such that no two nodes in sibling subtrees { } { }


share a constraint in the constraint graph
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
60
DPOP
Pseudo-tree Ordering
A { }
B D (B,D)
r r 3
r g 8
g r 10 B { }
g g 3

UTIL C D

{ } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
B D (B,D)
r r 3
r g 8
min{3, 8} = 3
g r 10 B { }
g g 3
min{10, 3} = 3

MSG to B
B cost
UTIL C D
r 3
g 3 { } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A B C (B,C) (A,C)

r r r 5 5 10 A { }
r r g 4 8 12
r g r 3 5 8
r g g 3 8 11
g r r 5 10 15
g r g 4 3 7 B { }
g g r 3 10 13
g g g 3 3 6

UTIL C D

{ } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A B C (B,C) (A,C)

r r r 5 5 10 A { }
r r g 4 8 12
r g r 3 5 8
r g g 3 8 11
g r r 5 10 15
g r g 4 3 7 B { }
g g r 3 10 13
g g g 3 3 6

UTIL
MSG to B A
r
B
r 10
C D

r
g
g
r
8
7
{ } { }
AAMAS-19 Tutorials g g 6 Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
Util Util
A B (A,B)
C D
r r 5 10 3 18
r g 8 8 3 19
g r 20 7 3 30
B { }
g g 3 6 3 12

UTIL C D

{ } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
Util Util
A B (A,B)
C D
r r 5 10 3 18
r g 8 8 3 19
g r 20 7 3 30
B { }
g g 3 6 3 12

MSG to A
A cost
UTIL C D
r 18
g 12 { } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
A cost
r 18
g 12

optimal cost = 12 B { }

UTIL C D

{ } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
A cost
r 18 VALUE
g 12

•Select value for A = ‘g’ B { }


•Send MSG A = ‘g’ to 

agents B and C
C D
Alternative version in which
value messages xi = xi* are { } { }
sent to children and
AAMAS-19 Tutorials
pseudo-children Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
Util Util
A B (A,B)
C D
VALUE
r r 5 10 3 18
r g 8 8 3 19
g r 20 7 3 30
B { }
g g 3 6 3 12

•Select value for B = ‘g’


•Send MSG B = ‘g’ to 
 C D

agents C and D { } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
A B C (B,C) (A,C) Pseudo-tree Ordering
r r r 5 5 10
A { }
r r g 4 8 12
r g r 3 5 8 VALUE
r g g 3 8 11
g r r 5 10 15
g r g 4 3 7
g g r 3 10 13 B { }
g g g 3 3 6

•Select value for C = ‘g’ C D

{ } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
DPOP
Pseudo-tree Ordering
A { }
VALUE
B D (B,D)
r r 3
r g 8
g r 10 B { }
g g 3

•Select value for D = ‘g’ C D

{ } { }
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Why Approximate Algorithms

“Very often optimality in practical applications is not achievable”

Approximate algorithms
Sacrify optimality in favor of computational and communication
efficiency
Well-suited for large scale distributed applications:
sensor networks
mobile robots

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Centralized Local Greedy approaches

Start from a random assignment for all the variables


Do local moves if the new assignment improves the value (local
gain)
Local: changing the value of a small set of variables (in most
case just one)
The search stops when there is no local move that provides a
positive gain, i.e., when the process reaches a local maximum.

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Distributed Local Greedy approaches

When operating in a decentralized context:


Problem: Out-of-date local knowledge
Assumption that other agents do not change their values
A greedy local move might be harmful/useless
Solution:
Stochasticity on the decision to perform a move (DSA)
Coordination among neighbours on who is the agent that should
move (MGM)

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Distributed Stochastic Algorithm (DSA)

Activation probability to mitigate issues with parallel executions

[S. Fitzpatrick and L. Meetrens, 2003]

Initialize agents with a random assignment and communicate


values to neighbors
Each agent:
Generates a random number and executes only if it is less than
the activation probability
When executing choose a value for the variable such that the local
gain is maximized
Communicate and receive possible variables change to/from
neighbors

Chapter 12: Distributed Constraint Handling and Optimization


Example run of DSA

DSA ALGORITHM
Utility
 Utility

xi xj
(A,B) (B,C)
5 5

A B C 5 0

{ } { } { } 0 0

8 8

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


80

Francesco Amigoni
Example run of DSA

DSA ALGORITHM
Assume that all agents are activated

xi xj Utility
 Utility

U=10, Δ=5 (A,B) (B,C)
U=5, Δ=0 5 5
U=5 U=0
A B C 5 0

U=5, Δ=0 U=0, Δ=0 0 0

U=8, Δ=3 U=8, Δ=8 8 8

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


81

Francesco Amigoni
Example run of DSA

DSA ALGORITHM
Assume that only agent B is activated

Utility
 Utility

U=0, Δ=0 xi xj
(A,B) (B,C)
U=16, Δ=16 5 5
U=0 U=0
A B C 5 0

U=5, Δ=5 U=5, Δ=5 0 0

U=0, Δ=0 U=0, Δ=0 8 8

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


83

Francesco Amigoni
Example run of DSA

DSA ALGORITHM
Assume that all agents are activated

xi xj Utility
 Utility

U=0, Δ=-16 (A,B) (B,C)
U=16, Δ=0 5 5
U=8 U=8
A B C 5 0

U=0, Δ=-8 U=0, Δ=-8 0 0

U=8, Δ=0 U=8, Δ=0 8 8

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


84

Francesco Amigoni
Example run of DSA

DSA ALGORITHM
U=5 U=0
A B C Utility
 Utility

xi xj
(A,B) (B,C)

U=8 U=0 5 5
A B C
5 0
U=0 U=0
A B C 0 0

U=8 U=8 8 8
A B C

One possible execution trace

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


85

Francesco Amigoni
Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

DSA-1: discussion

Extremely low computation/communication


Shows an anytime property (not guaranteed)
Activation probability:
Must be tuned
Domain dependent (no general rule)

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Maximum Gain Message (MGM-1)

Coordination among neighbours to decide which single agent can


perform the move.

[R. T. Maheswaran et al., 2004]

Initialize agents with a random assignment and communicate


values to neighbors
Each agent:
Compute and exchange possible gains
Agent with maximum (positive) gain executes
Communicate and receive possible variables changes to/from
neighbors

Chapter 12: Distributed Constraint Handling and Optimization


Example run of MGM-1

Domains: {green, blue, red}


Constraints: ≠
1 2

3 4

5 6

Satisfied constraints cost 0, while


violated constraints cost 1

Francesco Amigoni
Example run of MGM-1

1 2

3 4

5 6

Francesco Amigoni
Example run of MGM-1

1 2

3 4

5 6

Francesco Amigoni
Example run of MGM-1

❷❸❹ ❶❸❹❺

1 2

❶❷❺❻ ❶❷❺❻

3 4

❷❸❹❻ ❸❹❺

5 6

Francesco Amigoni
Example run of MGM-1

0 ❶ 0 ❷
1 2

0 ❸ 1 ❹

3 4

1 ❺ 2 ❻

5 6

Francesco Amigoni
Example run of MGM-1

1 2

3 4

5 6

Francesco Amigoni
Example run of MGM-1

0 ❶ 0 ❷
1 2
0,0,1 0,0,1,1
0 ❸ 1 ❹

3 4
0,0,1,2 0,0,1,2
1 ❺ 2 ❻

5 6
0,0,1,2 0,1,1

Francesco Amigoni
Example run of MGM-1

0 ❶ 0 ❷
1 2
0,0,1 0,0,1,1
0 ❸ 1 ❹

3 4
0,0,1,2 0,0,1,2
1 ❺ 2 ❻

5 6
0,0,1,2 0,1,1

Francesco Amigoni
Example run of MGM-1

0 ❶ 0 ❷
1 2
0,0,1 0,0,1,1
0 ❸ 1 ❹

3 4
0,0,1,2 0,0,1,2
1 ❺ 2 ❻

5 6
0,0,1,2 0,1,1

Francesco Amigoni
Example run of MGM-1

1 2

3 4

5 6

Francesco Amigoni
Example run of MGM-1

1 2

3 4

5 6

Francesco Amigoni
Example run of MGM-1

❷❸❹ ❶❸❹❺

1 2

❶❷❺❻ ❶❷❺❻

3 4

❷❸❹❻ ❸❹❺

5 6

Francesco Amigoni
Example run of MGM-1

0 ❶ 0 ❷
1 2

0 ❸ 0 ❹

3 4

0 ❺ 0 ❻

5 6

Francesco Amigoni
Example run of MGM-1

0 ❶ 0 ❷
1 2

0 ❸ 0 ❹

3 4

0 ❺ 0 ❻

5 6

Francesco Amigoni
Why?

Local maximum vs. global maximum


MGM has reached a local maximum and, changing only a value, cannot escape from it

Francesco Amigoni
Local maximum vs. global maximum

1 2

3 4

5 6

Francesco Amigoni
Local maximum vs. global maximum

1 2

3 4

5 6

Francesco Amigoni
Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

MGM-1: discussion

= More communication than DSA but still linear


= Empirically similar to DSA
Guaranteed to be anytime
Does not require any parameter tuning.

Chapter 12: Distributed Constraint Handling and Optimization


MGM vs. DSA

1 2

𝑈(𝑟𝑒𝑑, 𝑟𝑒𝑑) = 0
𝑈(𝑟𝑒𝑑, 𝑔𝑟𝑒𝑒𝑛) = 𝑈(𝑔𝑟𝑒𝑒𝑛, 𝑟𝑒𝑑) = 1
𝑈(𝑔𝑟𝑒𝑒𝑛, 𝑔𝑟𝑒𝑒𝑛) = – 1000

If both agents are allowed to alter their value in the same round, we could end up in the adverse
state (green, green)
When using DSA, there is always a positive probability for any time horizon that (green, green)
will be the resulting assignment

Francesco Amigoni
MGM vs. DSA

When applying MGM, the global utility strictly increases at each round until convergence

Francesco Amigoni
Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Decentralised greedy approaches

Very little memory and computation


Anytime behaviours
Could result in very bad solutions
local maxima arbitrarily far from optimal

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

The Max-Sum algorithm

Agents iteratively exchange messages to build a local function that


depends only on the variables they control

A1
x1

m1
1)
!
1 (x

!
F 1,3

!1 )
,2

m3
2)

3 !
2!

(x 3
x
F1

2 (x
1(

!
m
)

)
1
4!
,4

1!

(x 1
x4
F2,3
F1

4(

m
m2!3 (x3 )

)
x2 x3 =>

1!
!

m
A2 A3
,4

m3!2 (x2 )

!)
x2
F2

2(
4!

)
x4
m

4(
x4 m
2!
A4

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Max-Sum messages

At each execution step, each agent Ai sends to each of its neighbors


Aj the message:
!
mi !j (xj ) = aij + maxxi Fij (xi , xj ) + Â mk !i (xi )
k 2N (i )\j

Shared constraint with Aj All incoming messages except from Aj

where:
aij is a normalization constant added to all components of the
message so that Âxj mi !j (xj ) = 0
N (i ) is the set of indices for variables that are connected to xi

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Max-Sum by example

A1

2)
2 (x
1!
m

A2 A3
m3!2 (x2 )
!2 )
x
2(
4!
m

m1!2 (x2 ) = maxx1 (F1,2 (x1 , x2 ) + m3!1 (x1 ) + m4!1 (x1 ))

A4
Shared constraint with A2 All incoming messages except from A2

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Max-Sum assignments

At each iteration, each agent Ai :


computes its local function as:
zi (xi ) = Â mk !i (xi )
k 2N (i )

All incoming messages

sets its assignment as the value that maximizes its local function:

x̃i = arg max zi (xi )


xi

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Max-Sum by example

A1

2)
2 (x
1!
m

A2 A3
m3!2 (x2 )
!2 )
x
2(
4!
m

z1 (x1 ) = m2!1 (x1 ) + m3!1 (x1 ) + m4!1 (x1 )

A4
All incoming messages: from A4 , A3 and A1

Chapter 12: Distributed Constraint Handling and Optimization


Example run of Max-Sum

Consider this grid environment, divided in three areas (denoted a b c


by patterns)
Each area is controlled by an agent, which has to place a sensor A
in the area with the constraint that there cannot be two sensors
on the same row (A, B, C) nor on the same column (a,b,c)
B

Agents are {1,2,3}, their variables are the positions of the


sensors in their areas {P1, P2, P3}, their domains are {Aa, Ab}, C
{Ac, Bc, Cc}, and {Ba, Bb}, respectively, and the constraints are:

F12 P1 P2 F13 P1 P3 F23 P2 P3


-¥ Aa Ac -¥ Aa Ba 0 Ac Ba
0 Aa Bc 0 Aa Bb 0 Ac Bb
0 Aa Cc 0 Ab Ba -¥ Bc Ba
-¥ Ab Ac -¥ Ab Bb -¥ Bc Bb
0 Ab Bc 0 Cc Ba
0 Ab Cc 0 Cc Bb

Francesco Amigoni
Example run of Max-Sum

Assume normalization constants a equal to 0


In the first execution round, agent 1 sends the following messages:
m1à2(P2) = a12 + maxP1 F12(P1,P2) = PAc2 m -¥
1à2

Bc 0
Cc 0

m1à3(P3) = a13 + maxP1 F13(P1,P3) = P3 m1à3


Ba 0
Bb 0

Similarly, agent 2 sends the following messages: P1 m2à1 P3 m2à3


Aa 0 Ba 0
Ab 0 Bb 0

And agent 3 sends the following messages: P1 m3à1 P2 m3à2


Aa 0 Ac 0
Ab 0 Bc -¥
Cc 0

Francesco Amigoni
Example run of Max-Sum

Agent 1 computes z1(P1) = m2à1(P1) + m3à1(P1) = P1 z1


Aa 0
Ab 0

and selects one value that maximizes z1(P1), namely ~P1 = Aa (according to the lexicographic
order)

Agent 2 does the same: computes z2(P2) = m1à2(P2) + m3à2(P2) = P2 z2


Ac -¥
Bc -¥
Cc 0

and selects the value ~P2 = Cc

Agent 3 does the same: computes z3(P3) = m1à3(P3) + m2à3(P3) = P3 z3


Ba 0
Bb 0

and selects the value ~P3 = Ba (according to the lexicographic order)

Then, Max-Sum continues with the next iteration…

Francesco Amigoni
Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Max-Sum on acyclic graphs

A1
Optimal on acyclic graphs
Different branches are independent
z functions provide correct estimations of A2 A3
agents contributions to the global problem
Convergence guaranteed in a polynomial
number of cycles
A4

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Max-Sum on cyclic graphs

On cyclic graphs, limited theoretical results:


Lack of convergence guarantees
When converges, it does converge to a neighborhood maximum
Neighborhood maximum: guaranteed to be greater than all other
maxima within a particular region of the search space

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Quality guarantees

So far, algorithms presented (DSA-1, MGM-1, Max-Sum) do not


provide any guarantee on the quality of their solutions
Quality highly dependent on many factors which cannot always
be properly assessed before deploying the system.
Particularly adverse behaviour on specific pathological instances.
Challenge:
Quality assessment on approximate algorithms

Chapter 12: Distributed Constraint Handling and Optimization


Introduction
Distributed Constraint Reasoning
Local greedy methods: DSA-1, MGM-1 (Heuristic)
Applications and Exemplar Problems
GDL-based approaches: Max-Sum (Heuristic)
Complete algorithms for DCOPs
Quality guarantees: k-optimality, region optimality, bounded Max-Sum
Approximated Algorithms for DCOPs
Conclusions

Quality guarantees for approx. techniques

Key area of research


Address trade-off between guarantees and computational effort
Particularly important for:
Dynamic settings
Severe constrained resources (e.g. embedded devices)
Safety critical applications (e.g. search and rescue)

Chapter 12: Distributed Constraint Handling and Optimization


DCOP APPLICATIONS
• Scheduling Problems
• Taking DCOP to the Real World: Efficient Complete Solutions for Distributed Multi-Event Scheduling. AAMAS 2004
• Radio Frequency Allocation Problems
• Improving DPOP with Branch Consistency for Solving Distributed Constraint Optimization Problems. CP 2014
• Sensor Networks
• Preprocessing techniques for accelerating the DCOP algorithm ADOPT. AAMAS 2005
• Home Automation
• A Multiagent System Approach to Scheduling Devices in Smart Homes. AAMAS 2017, IJCAI 2016
• Traffic Light Synchronization
• Evaluating the performance of DCOP algorithms in a real world, dynamic problem. AAMAS 2008
• Disaster Evacuation
• Disaster Evacuation Support. AAAI 2007; JAIR 2017
• Combinatorial Auction Winner Determination
• H-DPOP: Using Hard Constraints for Search Space Pruning in DCOP. AAAI 2008

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


107
TRAFFIC FLOW CONTROL
• Given a set of traffic lights in adjacent intersections

• How coordinate them to create green waves?

N/S N/S N/S


W/E W/E W/E

de Oliveira, D., Bazzan, A. L., & Lesser, V.. Using cooperative mediation to coordinate traffic lights: a case study. AAMAS 2005: 371-378
Junges, R., & Bazzan, A. L. Evaluating the performance of DCOP algorithms in a real world, dynamic problem. AAMAS 2008: 463-470

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


110
TRAFFIC FLOW CONTROL
• Agents: Each traffic light
• Values: Flow traffic direction

x1 x2 x3

N/S N/S N/S


W/E W/E W/E

de Oliveira, D., Bazzan, A. L., & Lesser, V.. Using cooperative mediation to coordinate traffic lights: a case study. AAMAS 2005: 371-378
Junges, R., & Bazzan, A. L. Evaluating the performance of DCOP algorithms in a real world, dynamic problem. AAMAS 2008: 463-470

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


111
TRAFFIC FLOW CONTROL
• Agents: Each traffic light
• Values: Flow traffic direction
• Conflict if 2 neighboring signals choose different directions

x1 x2 x3

N/S N/S N/S


W/E W/E W/E

de Oliveira, D., Bazzan, A. L., & Lesser, V.. Using cooperative mediation to coordinate traffic lights: a case study. AAMAS 2005: 371-378
Junges, R., & Bazzan, A. L. Evaluating the performance of DCOP algorithms in a real world, dynamic problem. AAMAS 2008: 463-470

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


112
TRAFFIC FLOW CONTROL
• Cost functions model the number of incoming vehicles 


• Maximize the traffic flow

x1 x2 x3

N/S N/S N/S


W/E W/E W/E

de Oliveira, D., Bazzan, A. L., & Lesser, V.. Using cooperative mediation to coordinate traffic lights: a case study. AAMAS 2005: 371-378
Junges, R., & Bazzan, A. L. Evaluating the performance of DCOP algorithms in a real world, dynamic problem. AAMAS 2008: 463-470

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


113
SMART DEVICES

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


114
HOME ASSISTANTS

AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust


115
SMART HOMES 

DEVICE SCHEDULING
battery charge
sensor
A smart home has:
• Smart devices (roomba, HVAC)
that it can control
• Sensors (cleanliness,
temperature)
• A set of locations

thermostat cleanliness
sensor
Ferdinando Fioretto, William Yeoh, Enrico Pontelli. "A Multiagent System Approach to Scheduling Devices in Smart Homes". AAMAS, 2017.
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
117
SMART HOMES 

DEVICE SCHEDULING
Smart device:
• A set of actions it can
perform (clean, charge)
• Power consumption
associated to each action.
Example 2 The scheduling rule (1) describes an ASR

 a goal state where the living room floor is at least
defining
75%Scheduling
clean (i.e., at least Rules:
75% of the floor is cleaned by a
vacuum cleaning robot) by 1800 hrs:
living room cleanliness 75 before 1800 (1)

and scheduling rules (2) and (3) describe PSRs stating that
the battery charge of the vacuum cleaning robot zv needs to
be between 0 and 100 % of its full charge at all the times:
Ferdinando Fioretto, William Yeoh, Enrico Pontelli. "A Multiagent System Approach to Scheduling Devices in Smart Homes". AAMAS, 2017.
AAMAS-19 Tutorials
zv battery charge Fioretto,
0 always (2)
Picard, Tran-Thanh, Rust
118 zv battery charge  100 always (3)
SMART HOMES 
 Example 2 The scheduling rule (1) describes an ASR
8

DEVICE SCHEDULING
> min(20, 100 !)
>
<
defining a goal state where the living room floor is at least 25
75% clean (i.e., at least 75% of the floor is cleaned by a > 0
vacuum cleaning robot) by 1800 hrs: >
:
?
living room cleanliness 75 before 1800 (1)
In other words, at each tim
and scheduling rules (2) and (3) describe PSRs stating that will increase by 20% if it is
S the battery
R Rcharge
C of the
C vacuum
R R C robot
cleaning R zvDevice
needs to
Schedule decrease by 25% if it is ru
be between 0 and 100 % of its full charge at all the times: charge, and no change if it
0 15 30 30 30 45 60 60 75 Cleanliness (%)

zv battery charge 0 always (2) Example 4 Consider the


65 40 15 35 55 30 5 25 0 Battery Charge (%) room, where the only actu
zv battery charge  100 always (3) a vacuum cleaning robot z
[t !t ] sume the room is 0% clean
Goal 75 For a home hi , we denote with Rp a b a scheduling rule 75
robot zv is ⇠zt v at that time
60 over a state property p 2 PH [PZ , and time interval [ta , t60 b ].

Battery Charge (%)


Cleanliness (%)

Each scheduling rule indicates a goal state (either a desired t+1


cleanliness (0, ⇠zt v ) = 0 +
45
state of a home if it is an ASR or a required state of a de- 45 ⇢
min
30 vice or a home if it is a PSR) at a location `Rp 2 Li [ 30 Zi t
cleanliness (!, ⇠zv ) =
of a particular state property p that must hold over the time 0
15
interval [ta , tb ] ✓ T. Each rule is associated with a set 15of
In other words, at each tim
0 actuators p ✓ Ai that can be used to reach the goal state. 0
Additionally, a rule is associated with will increase by 15% if the
1400 1500 1600 1700a sensor s p 2 Si ca-
1800
pable of sensing the state property p. Finally, in a PSRs the cleaned and no change oth
Time Deadline
device can also sense its own internal states. More formally, Using the predictive mo
predict the trajectory of a
Ferdinando Fioretto, William Yeoh, Enrico Pontelli. "A Multiagent System ApproachHto Scheduling Devices in Smart Homes". AAMAS, 2017.
p= {z 2 Ai | `z = `Rp ^ 9a 2 Az : p 2 z (a)} (4) steps given a schedule of a
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
p= {z 2 Ai | z = `Rp _`z = `R119
H
p
^9a 2 Az : p 2 z (a)} (5) Definition 3 (Predicted St
SMART HOMES 
 Example 2 The scheduling rule (1) describes an ASR
8

DEVICE SCHEDULING
> min(20, 100 !)
>
<
defining a goal state where the living room floor is at least 25
75% clean (i.e., at least 75% of the floor is cleaned by a > 0
vacuum cleaning robot) by 1800 hrs: >
:
?
living room cleanliness 75 before 1800 (1)
In other words, at each tim
and scheduling rules (2) and (3) describe PSRs stating that will increase by 20% if it is
S the battery
R Rcharge
C of the
C vacuum
R R C robot
cleaning R zvDevice
needs to
Schedule decrease by 25% if it is ru
be between 0 and 100 % of its full charge at all the times: charge, and no change if it
0 15 30 30 30 45 60 60 75 Cleanliness (%)

zv battery charge 0 always (2) Example 4 Consider the


65 40 15 35 55 30 5 25 0 Battery Charge (%) room, where the only actu
zv battery charge  100 always (3) a vacuum cleaning robot z
Goal 75
$ $ $ [t !t$]
For a home hi , we denote with Rp a b a scheduling rule
… 75
sume the room is 0% clean
robot zv is ⇠zt v at that time
60 over a state property p 2 PH [PZ , and time interval [ta , t60 b ].

Battery Charge (%)


Cleanliness (%)

Each scheduling rule indicates a goal state (either … a desired t+1


(0, ⇠zt v ) = 0 +
45
state of a home 8:00if it9:00 is an ASR10:00 11:00 state of a de-
or a required 45
cleanliness

min
30 vice or a home if it is a PSR) at a location `Rp 2 Li [ 30 Zi t
cleanliness (!, ⇠zv ) =
of a particular
real-time state property
energy that mustschema
p price hold over the time 0
15
interval [ta , tb ] ✓ T. Each rule is associated with a set 15of
In other words, at each tim
0 actuators p ✓ Ai that can be used to reach the goal state. 0
Additionally, a rule is associated with will increase by 15% if the
1400 1500 1600 1700a sensor s p 2 Si ca-
1800
pable of sensing the state property p. Finally, in a PSRs the cleaned and no change oth
Time Deadline
device can also sense its own internal states. More formally, Using the predictive mo
predict the trajectory of a
Ferdinando Fioretto, William Yeoh, Enrico Pontelli. "A Multiagent System ApproachHto Scheduling Devices in Smart Homes". AAMAS, 2017.
p= {z 2 Ai | `z = `Rp ^ 9a 2 Az : p 2 z (a)} (4) steps given a schedule of a
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
p= {z 2 Ai | z = `Rp _`z = `R120
H
p
^9a 2 Az : p 2 z (a)} (5) Definition 3 (Predicted St
3 Scheduling of Devices in Smartx2 Buildings Ui =
the provider sets energyz price
j 2Zi
Through the proliferation
a1 x1 ofxsmart devices (e.g.,forsmart
i < j ther-

SMART HOMES 

2
x1 ing schema specified at regula
mostats, smart lightbulbs, smart washers, etc.)x in xour Costs
x4 i j
homes horizon
The SBDS H. We problemuse T is= the{1, .
and offices, building 0 0 20
a2 automation
x3 x4 within the larger smart grid intervals
vices of eachandbuilding ✓ : T ! in theR+
0the automated
1 8

DEVICE SCHEDULING
is becoming inevitable. Building automation is associated
fashion so as to with the pricing
minimize thescm
x3 1 0 10 theminimize
cost per kWh of energy co
control of the building’s devices with thex objective of3 im- time, the discomfort
a3 x5 x6 6 1 1
Within each smart buildin
proved comfort of the occupants, improved energy efficiency, objective optimization problem
electric devices Zi networke
and reduced operational costs. In this paper, we are interested tiveshome
intoautomation
a single objective
(a) Constraint Graph x 5
(b) Constraint Cost Table system. Alt
in the scheduling devices in smart buildings in a decentral- sum:(i.e., they cannot be stopped X X o
Domains Environmental

ized way, where each user is responsible for the schedule of szj and minimizezj to denote the sta
Figure 1: Example
the devices in her building, under the assumption that each variables
DCOP in exact multiples oft2T timehiin2
user cooperate to ensure that the total energy consumption of zj 2↵Ziand . ↵ are weights
A solution is a value assignment to a set of variables where
the neighborhood is always within some maximum threshold The energyuconsumption oU
c
X ✓ X that Actionis consistent
State with the variables’
Pproperty domains. The such that ↵c + ↵u = 1. The S
Power (kW/h)
that is defined each hour that it is on. It wi
cost function FP ( ) = f2F,xf ✓X f( ) is the utility
by the energy provider such as a energy sum of the the following constraints:
company. costs of allrun cleanliness,
is off-the-shelf. We use the in
the applicable constraints in0.0. A solution is said
We nowto provide a description the state1 ofszthe device
T zjzjat ti
be complete = Xofcharge
if X battery isthe
theSmart
value Building
assignmentDe- for all j
vices Scheduling (SBDS)
charge problem.
battery We
charge describe
0.26 related so-8 exclusively
X when the device Cz
variables. The goal is
Example 2 The scheduling rule (1) describes an ASR to find an optimal complete solution
min(20, 100 !) if ⇠z= t t
= charge ^ ! <
> v⇢ z
lution approaches

x =where
defining a goal state argmin in Section
F (x).
the living 6. An SBDS
room floor is at least problem is com- >
< z j
tif ⇠zv = run
t 1j ^if! > szj2
stopx P 0.0 25
=
75% posed of a neighborhood
clean (i.e., atFollowing Fioretto
least 75% of H of
the floorsmart
et al.is buildings
[2016b],
cleaned by a hi 2 Hthethat
we introduce follow- t2T z
ifj ⇠zv = stop
t 0 otherw
vacuum
>
>
:
0 X
arecleaning
able toingrobot) by 1800 hrs:
definitions:
communicate with one another and whose energy ? t
otherwise
P  ` t
demands are served by an energy provider. We assume that Additionally, the executio
i
living Definition 1 For each agent ai 2A, Li ={xj 2InXother
room cleanliness 75 before 1800 (1) | ↵(xwords,
j )= atby eacha hcost
i 2H and
time step, athe discomfort
charge of v
ai } is(2)theandset(3)ofdescribe
and scheduling rules its localPSRs
variables. i = {xj 2will
stating Ithat | 9xk 2by 20%
Liincrease if it is charging
monetary expenseuntil it isuse
for the ful
the battery chargeX of thesvacuum
^ 9f 2F : ↵(x cleaning
k ) 6= arobot
i ^ {xzvj ,needs to s } isdecrease
xk }✓x f
the set ofbyits25% ifand
it is running tuntil it has less
we use Ci to denote the
be between 0 and 100 % of its
interface variables.full charge at all the times: Hard constraints
charge, and no change if it is stopped.
AAMAS-19 Tutorials at time
hiFioretto, stepTran-Thanh,
Picard, t, expressed
Rust as
Example 4 Consider the cleanliness state pro
zv battery charge
Definition 2 For each agent a 2A, its(2)
0 always
local constraint graph t
X
3 Scheduling of Devices in Smartx2 Buildings Uit = t
zj · µzj (t)

SMART HOMES 

the provider sets energy prices according
zj 2Zi
Through the proliferation
a1 x1 ofxsmart
2 devices
x1 (e.g.,forsmart
i < j ther- ing schema specified at regular intervals t
mostats, smart lightbulbs, smart washers, etc.) x4 i j
x in xour Costs
homes horizon
The SBDS H. We use T is
problem = the . . , H} to of
{1, .problem de
and offices, building 0 0 20
a2 automation
x3 x4 within the larger smart grid intervals
of eachandbuilding to represent
R neighborhoo
+
vices ✓ : T ! in the
DEVICE SCHEDULING
is becoming inevitable. Building automation x3
control of the building’s devices with thex objective
proved comfort of the a3 x5 x6 6
0
1 0
1
occupants, improved energy efficiency,
1
is the automated
1
8
10
of3 im-
associated
fashion
the
time,
objective
so as to
cost
minimizeper
with
the
the pricing
minimize
kWh of energy
discomfort
theschema
monetary
consumed
Within each smart building hi , there
optimization problem, we comb
of
adopte
users. by
co
Wa

electric devices Zi networked together an


and reduced operational costs. In this paper, we are interested tiveshomeintoautomation
a single objective
(a) Constraint Graph x 5
(b) Constraint Cost Table system. Allthrough the
the devices
in the scheduling devices in smart buildings in 
 a decentral-
Objective sum:(i.e., they cannot be stopped X X once they are
ized way, where each user(soft is responsible for the
constraints) Objective schedule of szj and minimize
(softzj to constraints)
denote the start time ↵c · C t
i +
and d
Figure 1: Example DCOP
the devices in her building, under the assumption that each in exact multiples oft2T timehiintervals), resp
2H
user cooperate to ensure that the total energy consumption of zj 2↵Ziand . ↵ are weights in the open
A solution is a value assignment to a set of variables where
the neighborhood is always within some maximum threshold The energyuconsumption of
c Ui each 0.3 device
0.2 3.
X ✓ X that is consistent P with the variables’ domains. The such that
each hour ↵ + ↵ = 1. The SBDS
c that uit is on. It will not consum proble
that is defined by the energy
cost function FP ( ) provider
= f2F,xsuch asf(a energy
is the utility
sum of the
f ✓X ) the isfollowing constraints:
off-the-shelf. We use the indicator funct
company. costs of all the applicable constraints in . A solution is said
We nowto provide a description
be complete if X = Xofisthe theSmart
value Building
assignmentDe-
$ the$state
for all 1 ofszthe
exclusively
j $T zjz$jat time…
device
X when the device Czj is on at tim
step
8ht,i 2an
vices Scheduling
variables.(SBDS)
The goalproblem.
is to findWe describecomplete
an optimal related solution
so- t ⇢ i
lution approaches
⇤ in Section 6. An SBDS problem is com- zj = zj 8hi 2
x = argmin F
x P (x). 1 if s  …t ^ szj +
posed of a neighborhood
Following FiorettoH of smart
et al. buildings
[2016b], hi 2 Hthethat
we introduce 8:00
follow- 9:00t2T
X j
t
z10:00
= 11:00
0 otherwise
z j

are able toing definitions: with one another and whose energy
communicate Pit the `t execution of device z
demands are served1byForaneach
energy real-time energy Additionally, price schema
Definition agentprovider.
ai 2A, LWe assume that
i ={xj 2 X | ↵(xj )= by a cost and a discomfort value. The c
hi 2H
ai } is the set of its local variables. Ii = {xj 2 Li | 9xk 2 monetary expense for the user to schedule
X ^ 9fs 2F : ↵(xk ) 6= ai ^ {xj , xk }✓xfs } is the set of its and we use Cit to denote the aggregated c
interface variables. hi at time step t, expressed as:
Ferdinando Fioretto, William Yeoh, Enrico Pontelli. "A Multiagent System Approach to Scheduling Devices in Smart Homes". AAMAS, 2017.
Definition 2 For each agent ai 2A, its local constraint graph Cit = Pit · ✓(t),
AAMAS-19 Tutorials Fioretto, Picard, Tran-Thanh, Rust
Gi = (Li , EFi ) is a subgraph of the constraint graph, where
fj where X

You might also like