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

Slides:



Advertisements
Similar presentations
Lecture 15. Graph Algorithms
Advertisements

Jecho and Donatus Depth First and Breadth First Search.
Nattee Niparnan. Distance of nodes  The distance between two nodes is the length of the shortest path between them S  A 1 S  C 1 S  B 2.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 13.
Module 5 – Networks and Decision Mathematics Chapter 24 – Directed Graphs.
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
Graphs – Depth First Search ORD DFW SFO LAX
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Breadth-First and Depth-First Search
Introduction This chapter explores graphs and their applications in computer science This chapter explores graphs and their applications in computer science.
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
Graphs Graphs are the most general data structures we will study in this course. A graph is a more general version of connected nodes than the tree. Both.
Data Structure and Algorithms (BCS 1223) GRAPH. Introduction of Graph A graph G consists of two things: 1.A set V of elements called nodes(or points or.
CS 206 Introduction to Computer Science II 11 / 10 / 2008 Instructor: Michael Eckmann.
© 2004 Goodrich, Tamassia Directed Graphs1 JFK BOS MIA ORD LAX DFW SFO.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
CS 206 Introduction to Computer Science II 11 / 03 / 2008 Instructor: Michael Eckmann.
Karsten Steinhaeuser Aaron Wenger December 09, 2003.
1 Directed Graphs CSC401 – Analysis of Algorithms Lecture Notes 15 Directed Graphs Objectives: Introduce directed graphs and weighted graphs Present algorithms.
CS 206 Introduction to Computer Science II 03 / 25 / 2009 Instructor: Michael Eckmann.
Directed Graphs1 JFK BOS MIA ORD LAX DFW SFO. Directed Graphs2 Outline and Reading (§6.4) Reachability (§6.4.1) Directed DFS Strong connectivity Transitive.
Fall 2007CS 2251 Graphs Chapter 12. Fall 2007CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs To.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
Tirgul 13 Today we’ll solve two questions from last year’s exams.
Graphs & Graph Algorithms 2 Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 9: Graphs Spanning Trees Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Directed graphs Definition. A directed graph (or digraph) is a pair (V, E), where V is a finite non-empty set of vertices, and E is a set of ordered pairs.
Nattee Niparnan. Graph  A pair G = (V,E)  V = set of vertices (node)  E = set of edges (pairs of vertices)  V = (1,2,3,4,5,6,7)  E = ((1,2),(2,3),(3,5),(1,4),(4,
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Algorithms and Running Time Algorithm: Well defined and finite sequence of steps to solve a well defined problem. Eg.,, Sequence of steps to multiply two.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Graphs Data Structures and Algorithms A. G. Malamos Reference Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction to Algorithms,Third.
Algorithmic Software Verification III. Finite state games and pushdown automata.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
Lazy Annotation for Program Testing and Verification Speaker: Chen-Hsuan Adonis Lin Advisor: Jie-Hong Roland Jiang November 26,
CSE 2331 / 5331 Topic 12: Shortest Path Basics Dijkstra Algorithm Relaxation Bellman-Ford Alg.
© 2004 Goodrich, Tamasia Recall: Digraphs A digraph is a graph whose edges are all directed Short for “directed graph” Applications one-way streets flights.
A Unified View of Graph Searching
1 Chapter 22: Elementary Graph Algorithms II. 2 About this lecture Depth First Search DFS Tree and DFS Forest Properties of DFS Parenthesis theorem (very.
Connectivity1 Connectivity and Biconnectivity connected components cutvertices biconnected components.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
A* Path Finding Ref: A-star tutorial.
R-customizers Goal: define relation between graph and its customizers, study domains of adaptive programs, merging of interface class graphs.
An Algorithm for the Consecutive Ones Property Claudio Eccher.
A directed graph G consists of a set V of vertices and a set E of arcs where each arc in E is associated with an ordered pair of vertices from V. V={0,
GRAPH ALGORITHM. Graph A pair G = (V,E) – V = set of vertices (node) – E = set of edges (pairs of vertices) V = (1,2,3,4,5,6,7) E = ( (1,2),(2,3),(3,5),(1,4),(4,5),(6,7)
Graph Theory Def: A graph is a set of vertices and edges G={V,E} Ex. V = {a,b,c,d,e} E = {ab,bd,ad,ed,ce,cd} Note: above is a purely mathematical definition.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Paths and circuits.
Jesse proposal1 Jesse’s proposal Karl Lieberherr.
Directed Graphs1 JFK BOS MIA ORD LAX DFW SFO. Directed Graphs2 Outline and Reading (§12.4) Reachability (§12.4.1) Directed DFS Strong connectivity Transitive.
Case tool Relational Database Schema Designer Cai Xinlei Tang Ning Xu Chen Zhang Yichuan CS4221 P06.
Directed Graphs Directed Graphs Shortest Path 12/7/2017 7:10 AM BOS
Directed Graphs 12/7/2017 7:15 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Directed Graphs 9/20/2018 1:45 AM Presentation for use with the textbook Data Structures and Algorithms in Java, 6th edition, by M. T. Goodrich, R. Tamassia,
Directed Graphs 5/1/15 12:25:22 PM
Directed Graphs Directed Graphs 1 Shortest Path Shortest Path
Short paths and spanning trees
A Unified View of Graph Searching
Network Notes Ms Allan 2012 AS91260 (2.5) Designed to teach from,
Graphs & Graph Algorithms 2
A* Path Finding Ref: A-star tutorial.
Directed Graphs Directed Graphs Directed Graphs 2/23/ :12 AM BOS
Discrete Math 2 Shortest Path Using Matrix
Producing short counterexamples using “crucial events”
Graphs Chapter 7 Visit for more Learning Resources.
Midterm COM3220 Open book/open notes Tuesday, April 28, 6pm pm
Chapter 9: Graphs Spanning Trees
Presentation transcript:

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

Outline Global constraints on strategies Traversal algorithm Checking constraints algorithm Demo

Global Constraints on Strategies Given: class graph CG, strategy graph SG, source s,target t, constraint X < 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

Constraint Example 1 Class Graph Strategy Graph ABX AX Traversal Graph AB X A < B true B < A false A < X true X < A false B < X true X < B false Note: A < B even if B can come before A (e.g. path ABXABX)

Constraint Example 2 Class Graph Strategy Graph Traversal Graph P < Q true Q < P true X ABPQC ABC X X AB Since neither P nor Q are part of any path from source to target, P < Q and Q < P = target node = source node

Constraint Example 3 Class Graph Strategy Graph Traversal Graph D< C false (ABCABDE) C < D false (ABDE) A E C ABDE C ABD E

Constraint Example 4 Class Graph Strategy Graph Traversal Graph D< C true C < D false A E C ABDE C ABD E

Traversal Graph Algorithm TG(CG,SG,s,t) Step1: For each SG edge (u,v), make a copy G uv of CG Step 2: For 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 G uv, v in G vw ) Step 3: Eliminate edges not reachable from some source s and target t

Class GraphStrategy Graph X ABPQC ABC X X ABPQC X ABPQC X ABPQC Traversal Algorithm:Step 1

Class GraphStrategy Graph X ABPQC ABC X X ABPQC X ABPQC X ABPQC Traversal Algorithm:Step 2

Class GraphStrategy Graph X ABPQC ABC X Traversal Algorithm:Step 3 X AB Traversal Graph

Traversal Algorithm Property Each node in the traversal graph can reach the target. This occurs in Step 3 of the algorithm

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

Algorithm to check constraint X<Y 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 Y s

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 t Y s

Checking Constraint Example 1 Class Graph Strategy Graph Traversal Graph check constraint P < Q X ABPQC ABC X X AB AQ compute traversal graph for class graph = strategy graph = X AB traversal graph is empty so constraint is satisfied

Checking Constraint Example 2 Class Graph Strategy Graph check constraint C < D compute traversal graph for class graph = strategy graph = traversal graph is not empty so constraint is not satisfied Traversal Graph A E C ABDE C ABDE ABD E A D

Checking Constraint Example 3 Class Graph Strategy Graph check constraint C < D Traversal Graph C ABDE C A D E C ABDE C ABDE C ABDE C ABDE ACDE C ABDE

Checking Constraint Example 3 (cont’d) check constraint C < D D2E2A2 A1B1D1E1 compute traversal graph for class graph = strategy graph = Ai Ej for i,j = 1 to 2 traversal graph non-empty for i=1 and j=1 constraint C < D is not satisfied

Implementation Details command line –java graph Cgfile SGfile source target X Y –check constraint X<Y 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 at end of each line