Global Constraints for Strategy Graphs - PowerPoint PPT Presentation

About This Presentation
Title:

Global Constraints for Strategy Graphs

Description:

Traversal Graph Algorithm TG(CG,SG,s,t) Step1:For each SG edge (u, ... Previous algorithm is better in this sense ... If you use 'Alternate Traversal Algorithm' ... – PowerPoint PPT presentation

Number of Views:13
Avg rating:3.0/5.0
Slides: 21
Provided by: garyg71
Category:

less

Transcript and Presenter's Notes

Title: Global Constraints for Strategy Graphs


1
Global Constraints for Strategy Graphs
  • Gary Gengo
  • COM 3220
  • June 9, 1998

2
Outline
  • Global constraints on strategies
  • Traversal algorithm
  • Checking constraints algorithm
  • Demo

3
Global Constraints on Strategies
  • Given class graph CG, strategy graph SG, source
    s,target t, constraint X lt Y
  • Question Does the following constraint hold for
    all paths P in CG corresponding to some path from
    s to t in SG?
  • for every vertex Y in the path P, there is a
    vertex X in P that comes before Y

4
Constraint Example 1
Class Graph
A lt B true B lt A false A lt X true X lt A
false B lt X true X lt B false
Strategy Graph
Note A lt B even if B can come before A (e.g.
path ABXABX)
Traversal Graph
5
Constraint Example 2
Class Graph
P lt Q true Q lt P true
Strategy Graph
Since neither P nor Q are part of any path from
source to target, P lt Q and Q lt P
Traversal Graph
source node
target node
6
Constraint Example 3
Class Graph
Dlt C false (ABCABDE) C lt D false (ABDE)
Strategy Graph
Traversal Graph
7
Constraint Example 4
Class Graph
Dlt C true C lt D false
Strategy Graph
Traversal Graph
8
Traversal Graph Algorithm TG(CG,SG,s,t)
  • Step1For each SG edge (u,v), make a copy Guv of
    CG
  • Step 2For each vertex v in SG, and for each
    combination (u,v) (v,w) edges in SG add
    intercopy edges of the form (pred(v) in Guv , v
    in Gvw)
  • Step 3Eliminate edges not reachable from some
    source s and target t

9
Traversal AlgorithmStep 1
Class Graph
Strategy Graph
10
Traversal AlgorithmStep 2
Class Graph
Strategy Graph
11
Traversal AlgorithmStep 3
Class Graph
Strategy Graph
Traversal Graph
12
Traversal Algorithm Property
  • Each node in the traversal graph can reach the
    target.
  • This occurs in Step 3 of the algorithm

13
Alternate Algorithm
  • You might compute traversal graph by
  • First computing the TG for each edge
  • Then add intercopy edges
  • HOWEVER, property mentioned before holds ONLY if
    the strategy graph does not have any useless
    edges
  • Previous algorithm is better in this sense
  • We use previous algorithm in checking constraints
    algorithm

14
Algorithm to check constraint XltY
  • Step 1 Compute traversal graph TG1
    TG(CG,SG, s, t)
  • Step 2 Remove all edges with X as a vertex from
    TG1
  • Step 3 For each source s and each Y inTG1
  • compute newTG TG(TG1,newSG,s,Y) where newSG is
  • if newTG is not empty, constraint is violated

15
If you use Alternate Traversal Algorithm
  • Change Step 3 to For each source s, each target
    t, and each Y inTG1
  • compute newTG TG(TG1,newSG,s,t) where newSG is
  • if newTG is not empty, constraint is violated
  • change necessary because there might not be a
    path from Y to t in TG

i
16
Checking Constraint Example 1
check constraint P lt Q
Class Graph
compute traversal graph for class graph
strategy graph
Strategy Graph
Traversal Graph
traversal graph is empty so constraint is
satisfied
17
Checking Constraint Example 2
check constraint C lt D
Class Graph
compute traversal graph for class graph
strategy graph
Strategy Graph
Traversal Graph
traversal graph is not empty so constraint is
not satisfied
18
Checking Constraint Example 3
check constraint C lt D
Class Graph
Strategy Graph
Traversal Graph
19
Checking Constraint Example 3(contd)
compute traversal graph for class graph
check constraint C lt D
strategy graph
Ai
for i,j 1 to 2
traversal graph non-empty for i1 and j1
constraint C lt D is not satisfied
20
Implementation Details
  • command line
  • java graph Cgfile SGfile source target X Y
  • check constraint XltY on CG,SG
  • graphs stored as text files
  • first line is list of vertices
  • all other lines give adjacency list
  • no error checking on graph input
  • need ltreturngt at end of each line
Write a Comment
User Comments (0)
About PowerShow.com