Asynchronous Partitioning Framework

Preview:

DESCRIPTION

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. - PowerPoint PPT Presentation

Citation preview

Asynchronous Partitioning Framework

Amnon Meisels

Vitaliy Freidovich

Department of Computer Science

www.cs.bgu.ac.il/~amam@cs.bgu.ac.il

Department of Mathematics and Computer ScienceVice President R&D of

www.TheCTO.co.il/en Vitaliy@TheCTO.co.il

Ben-Gurion UniversityOf the Negev

The Open Universityof Israel

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:

1. Initialization2. Priority calculation3. Group partitioning4. Group ordering5. 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

a1

a3

a2

a4 a9

a8

a6 a7

a10

a5

Phase 1: Initialization

Main goal: Initialize agent priority Pai = ki + ∑j=1

ki (CommonNeighbors (ai, aj)) ki – number of neighbors of ai

Initially: Pai = ki

a1

P=2

a3

P=4

a2

P=1

a4

P=2a9

P=4

a8

P=2

a6

P=3a7

P=3

a10

P=2

a5

P=5

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

a1

P=2

a3

P=4

a2

P=1

a4

P=2a9

P=4

a8

P=2

a6

P=3a7

P=3

a10

P=2

a5

P=5

a4 a6

a7 a8

,a9

a4 a6 a7 a8,a9

a4 a

6 a7 a

8,a9

a4 a6 a7 a8,a9

a4 a6 a7 a8,a9

0

1

2

1

2

Phase 2: Priority calculation

a1

P=2

a3

P=4

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

a10

P=2

a5

P=11

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

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

a1

P=2

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

a10

P=2

a5

P=11

JOIN

W:{a1} JOIN

W:{a3}

JOIN

W:{a9}

JOIN

W:{a10}

JOIN

a3

P=4

Phase 3: Group partitioning

a1

P=2

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

a10

P=2

W:{a3}

W:{a10}

a5

P=11W:{a9,a6}

a3

P=4W:{a1}

Phase 3: Group partitioning

a1

P=2

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

a10

P=2

a3

P=4W:{a1}

W:{a3}

W:{a10}

JOINED

NOT_

JOIN

ED

GLa5

P=11

JOINEDNOT_JOINED

Phase 3: Group partitioning

a1

P=2

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

a10

P=2

GLa3

P=4

GLa5

P=11

JOINED

JOIN

JOIN

ED

a1 and a10 have the same priority a1 has a higher lexicographical

priority

Phase 3: Group partitioning

a1

P=2

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

a10

P=2

GLa3

P=4

GLa5

P=11

JOIN

JOIN

JOIN

JOINED

JOINED

JOINED

JOIN

NOT_JOINED

Phase 3: Group partitioning

a1

P=2

a2

P=1

a4

P=2a9

P=8

a8

P=4

a6

P=5a7

P=7

GLa3

P=4

GLa5

P=11

GLa10

P=2

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

a1

P=2

a2

P=1

a9

P=8

a8

P=4

a6

P=5a7

P=7

GLa3

P=4

GLa5

P=11

IGP=4+2

IGP=4+11+11

IGP=4

IGP=6

IGP=15IGP=26

IGP=4

IGP=11

IGP=15

a4P=2

IGP=11

IGP=11

IGP=13

IGP=17

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

GLa10

P=2

Phase 4: Group ordering

a1IGP=

6O=2

a2

IGP=4

O=3

a9

a8

a7

GLa3

IGP=26O=1

GLa5

IGP=11O=4

a6IGP=15O=2

a4

IGP=15O=1

IGP=11O=5

IGP=11O=6

IGP=13O=3

IGP=17O=1

GLa10

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

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 )

Phase 5: Search for solution

AGP-CBJ A second implementation of APF Identical to AGP; the LocalSearch

algorithm is upgraded to be CBJ Was formally proven to be correct

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

Experimental Evaluation

How important is LocalSearch?

Partitioning appears to be beneficial 1 Group → Most likely an almost

Clique

Partitioning – What good is it?

AGP-CBJ

APF – Where is it best?

We expect it to be best for low values of p1

Why static partitioning?

Where is coordination best ?

P1=0.4

Where is coordination best ?

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

Conclusions

Thank You!

Appendix – AGP’s Search For Solution

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?

Future work

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

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

Token

GLa10

P=2O=1

Phase 5: Search for solution

a10 as an agent: Finds consistent assignment Returns token to its group leader

a10 as a group leader: Enters the consistent state

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

Group Leader a5 starts execution First one - Generates a new GlobalToken Generates a new Token Sends Token to the first agent in its group

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

a4: Finds consistent assignment Notifies a3

Returns Token to a5

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenV_C

a3 – group leader: First generates a new Token Sends to first agent

a3 – agent: Finds consistent assignment Returns Token to group leader

Token

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

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenV_CToken

V_C_H

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenR_T

a3 - Group leader: Asks a3 to regenerate new token

a3 - agent: Regenerates Token Returns Token to group leader

Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenToken

a3 – group leader: Sends Token to a3

a3 – agent: Finds consistent assignment

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

a3 – group leader: Sends Token to a3

a3 – agent: Finds consistent assignment Returns Token to group leader

Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenToken

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

V_C

V_C

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

V_C

V_C

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

V_C

V_C

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

V_C

V_C

V_C

V_C_H

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenToken

V_C

V_C_H

R_T

Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

TokenToken

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token GLa10

P=2O=1

GlobalToken

TokenToken

V_C

V_C_H

R_T

Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

Token

GLa10

P=2O=1

GlobalToken

Token

Token

A more complicated example

Demonstrating the backtracking mechanisms of AGP: a10 is prohibited to be assigned any value different from Red

Execution continues as before, till a10 handles value changes from a1 and a9

a1

a3

a2

a4 a9

a8

a6 a7

a10

a5

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

B_Token GLa10

P=2O=1

TokenToken

State after token had been regenerated in a10‘s group a10 tries to find consistent assignment:

Checks first against a9, as it is in the highest priority group a9 eliminates all values

Execution continues as before till a10 receives the global token

Token

GlobalToken

C={a9}

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

TokenToken

a10 as a group leader: Requests conflict sets from all agents in its group

a10 as an agent: Returns its conflict set

a10 as a group leader: Backtracks GlobalToken with C={a9}

B_GlobalToken

R_C_S

C={a9}

R_TToken

GlobalToken

B_TOKEN

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

TokenToken

GlobalToken

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token Token

GlobalToken

B_Token

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

TokenToken

GlobalToken V_C

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token Token

GlobalToken V_CV_C

B_Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

Token

GlobalToken V_CV_C

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token Token

GlobalToken V_CV_C

V_CV_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

Token

GlobalToken V_CV_C

V_C

V_C

B_Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token Token

GlobalToken V_CV_C

V_C

V_C

V_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

Token

GlobalToken V_CV_C

V_C

V_CV_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

Token

GlobalToken V_CV_C

V_C

V_CV_C

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

Token

GlobalToken

V_CV_CV_CV_C

Token

B_TokenC={a1}

R_C_S

B_GlobalToken

R_T

Token

B_Token

Phase 5: Search for solution

a1

P=2

O=2

a2

P=1O=3

a9

P=8O=3

a8

P=4O=6

a6

P=5O=2

a7

P=7O=5

GLa3

P=4O=1

GLa5

P=11O=4

a4

P=2O=1

GLa10

P=2O=1

Token

GlobalToken

Token

Token

V_C

Token

Recommended