Institute for Applied Information Processing and Communications (IAIK) 1 TU Graz/Computer Science/IAIK Graz, 2009 AK Design and Verification Presentation.

Slides:



Advertisements
Similar presentations
Bellman-Ford algorithm
Advertisements

Graph Algorithms - 3 Algorithm Design and Analysis Victor AdamchikCS Spring 2014 Lecture 13Feb 12, 2014Carnegie Mellon University.
Lecture 7. Network Flows We consider a network with directed edges. Every edge has a capacity. If there is an edge from i to j, there is an edge from.
Min Cost Flow: Polynomial Algorithms. Overview Recap: Min Cost Flow, Residual Network Potential and Reduced Cost Polynomial Algorithms Approach Capacity.
Uri Zwick Tel Aviv University Simple Stochastic Games Mean Payoff Games Parity Games.
Single Source Shortest Paths
ECE 667 Synthesis and Verification of Digital Circuits
* Bellman-Ford: single-source shortest distance * O(VE) for graphs with negative edges * Detects negative weight cycles * Floyd-Warshall: All pairs shortest.
1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
Introduction to Algorithms
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
© DEEDS 2008Graph Algorithms1 Remarks on Dijkstra  Determining the minimum marginal element (code line: v = the vertex in M 2 with minimum v.L; ) accounts.
October 31, Algorithms and Data Structures Lecture XIII Simonas Šaltenis Nykredit Center for Database Research Aalborg University
Breadth-First Search of Graphs Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
Midwestern State University Department of Computer Science Dr. Ranette Halverson CMPS 2433 CHAPTER 4 - PART 2 GRAPHS 1.
Graphs By JJ Shepherd. Introduction Graphs are simply trees with looser restrictions – You can have cycles Historically hard to deal with in computers.
Clock Skewing EECS 290A Sequential Logic Synthesis and Verification.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
Algorithm Strategies Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Chapter 3 The Greedy Method 3.
Great Theoretical Ideas in Computer Science.
1 Discrete Structures & Algorithms Graphs and Trees: II EECE 320.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
Jim Anderson Comp 122, Fall 2003 Single-source SPs - 1 Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph.
Shortest Paths Definitions Single Source Algorithms –Bellman Ford –DAG shortest path algorithm –Dijkstra All Pairs Algorithms –Using Single Source Algorithms.
1 8-ShortestPaths Shortest Paths in a Graph Fundamental Algorithms.
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 15 Shortest paths algorithms Properties of shortest paths Bellman-Ford algorithm.
Shortest Paths Definitions Single Source Algorithms
Tirgul 13. Unweighted Graphs Wishful Thinking – you decide to go to work on your sun-tan in ‘ Hatzuk ’ beach in Tel-Aviv. Therefore, you take your swimming.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each decision is locally optimal. These.
Dijkstras Algorithm Named after its discoverer, Dutch computer scientist Edsger Dijkstra, is an algorithm that solves the single-source shortest path problem.
Crossing Minimisation (1) Ronald Kieft. Global contents Specific 2-layer Crossing Minimisation techniques After the break, by Johan Crossing Minimisation.
1 ELEC692 Fall 2004 Lecture 1b ELEC692 Lecture 1a Introduction to graph theory and algorithm.
Uri Zwick Tel Aviv University Simple Stochastic Games Mean Payoff Games Parity Games TexPoint fonts used in EMF. Read the TexPoint manual before you delete.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
Chapter 24: Single-Source Shortest Paths Given: A single source vertex in a weighted, directed graph. Want to compute a shortest path for each possible.
Max Flow – Min Cut Problem. Directed Graph Applications Shortest Path Problem (Shortest path from one point to another) Max Flow problems (Maximum material.
SPANNING TREES Lecture 20 CS2110 – Fall Spanning Trees  Definitions  Minimum spanning trees  3 greedy algorithms (incl. Kruskal’s & Prim’s)
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Network Formation Games. NFGs model distinct ways in which selfish agents might create and evaluate networks We’ll see two models: Global Connection Game.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
Honors Track: Competitive Programming & Problem Solving Seminar Topics Kevin Verbeek.
TIRGUL 10 Dijkstra’s algorithm Bellman-Ford Algorithm 1.
Minimum Spanning Trees
Shortest Paths and Minimum Spanning Trees
Single-Source Shortest Path
Algorithms and Data Structures Lecture XIII
Introduction to Graphs
Minimum Spanning Trees
ICS 353: Design and Analysis of Algorithms
Graphs Chapter 11 Objectives Upon completion you will be able to:
Algorithms (2IL15) – Lecture 5 SINGLE-SOURCE SHORTEST PATHS
Data Structures and Algorithms (AT70. 02) Comp. Sc. and Inf. Mgmt
Uri Zwick Tel Aviv University
Algorithms and Data Structures Lecture XIII
Autumn 2015 Lecture 10 Minimum Spanning Trees
Analysis of Algorithms
Flow Networks and Bipartite Matching
Honors Track: Competitive Programming & Problem Solving Avoiding negative edges Steven Ge.
Algorithms (2IL15) – Lecture 7
Lecture 14 Shortest Path (cont’d) Minimum Spanning Tree
EE5900 Advanced Embedded System For Smart Infrastructure
Chapter 24: Single-Source Shortest Paths
Chapter 24: Single-Source Shortest Paths
Lecture 13 Shortest Path (cont’d) Minimum Spanning Tree
Analysis of Algorithms
More Graphs Lecture 19 CS2110 – Fall 2009.
Presentation transcript:

Institute for Applied Information Processing and Communications (IAIK) 1 TU Graz/Computer Science/IAIK Graz, 2009 AK Design and Verification Presentation for the Lecture: AK Design and Verification by Robert Könighofer A Strategy Improvement Algorithm for Mean Payoff Games

Institute for Applied Information Processing and Communications (IAIK) 2 TU Graz/Computer Science/IAIK AK Design and Verification Contents  Main Source: H. Björklund, S. Sandberg, S. Vorobyov: A combinatorial strongly subexponential strategy improvement algorithm for mean payoff games. [1]  Recap: Mean Payoff Games  0-Mean Partition Problem  Longest Shortest Path Problem  Algorithm  Improvements  Ergodic Partition Problem  Complexity  Appendix: proof sketches of main theorems

Institute for Applied Information Processing and Communications (IAIK) 3 TU Graz/Computer Science/IAIK AK Design and Verification Recap: Mean Payoff Games (MPG) Given:  Finite, directed, edge weighted, leafless graph: G = (V, E, w)  V = V MAX ∪ V MIN, w: E  {-W, …, 0, …, W} Example: V MAX...V MIN

Institute for Applied Information Processing and Communications (IAIK) 4 TU Graz/Computer Science/IAIK AK Design and Verification Recap: Mean Payoff Games (MPG) Notation:  2 Player: MIN and MAX  Play ρ = e 0 e 1 e 2 e 3 …  payoff(ρ) = val(ρ) = average(w(e i ))  Positional Strategy for MAX: σ MAX : V MAX  V so that (v, σ (v)) ∈ E Goals:  MAX: maximize val(ρ)  MIN: minimize val(ρ)

Institute for Applied Information Processing and Communications (IAIK) 5 TU Graz/Computer Science/IAIK AK Design and Verification MPG: Properties  Optimal strategy is positional  val(v) = val(ρ) when ρ starts in v and both players play optimal  Optimal σ MAX : ensures payoff(ρ) ≥ val(v)  Optimal σ MIN : ensures payoff(ρ) ≤ val(v)  Play ρ = finite stem + loop  val(ρ) = average(loop)

Institute for Applied Information Processing and Communications (IAIK) 6 TU Graz/Computer Science/IAIK AK Design and Verification Computational Problems Decision Problem:  Can MAX guarantee payoff > p from v 0 ? p-Mean Partition:  Divide V into V ≤p and V >p  MAX can guarantee payoff >p from all v ∈ V >p  MIN can guarantee payoff ≤p from all v ∈ V ≤p Ergodic Partition:  Compute val(v) for all v ∈V

Institute for Applied Information Processing and Communications (IAIK) 7 TU Graz/Computer Science/IAIK AK Design and Verification 0-Mean Partition: Approach  MPG  LSP (Longest Shortest Path Problem)  Solve LSP by Strategy Improvement: σ = σ 0 while(σ changes): σ = Improve(σ)

Institute for Applied Information Processing and Communications (IAIK) 8 TU Graz/Computer Science/IAIK AK Design and Verification Longest Shortest Path Problem Given:  Finite, directed, edge weighted graph: G = (V, t, E, w)  V = V MAX ∪ V MIN  t = unique sink, t ∉ V MAX  here: σ 0, avoiding negative cycles Find:  positional σ : shortest path from every v to t is as long as possible in G σ = G ∩ σ

Institute for Applied Information Processing and Communications (IAIK) 9 TU Graz/Computer Science/IAIK AK Design and Verification Transformation MPG  LSP  Insert ‘retreat vertex’ t  For all v i ∈ V MAX : ad d edge e i = (v i,t), w(e i ) = 0  Add edge (t,t) with w(t,t) = 0  Example: V MAX...V MIN t

Institute for Applied Information Processing and Communications (IAIK) 10 TU Graz/Computer Science/IAIK AK Design and Verification Relation MPG  LSP MPGLSP  v ∈ V >0  dist(v,t) = ∞  MAX: enforce pos. loop  MAX: enforce pos. loop  MIN: enforce neg. loop  MAX: retreat, dist(v,t) < ∞ t t

Institute for Applied Information Processing and Communications (IAIK) 11 TU Graz/Computer Science/IAIK AK Design and Verification Relation MPG  LSP Admissable strategy:  enforces positive loops  OR retreat  we iterate over admissable strategies only  σ 0 : go to t from every v ∈V MAX

Institute for Applied Information Processing and Communications (IAIK) 12 TU Graz/Computer Science/IAIK AK Design and Verification Remember our approach:  MPG  LSP (Longest Shortest Path Problem)  Solve LSP by Strategy Improvement: σ = σ 0 while(σ changes): σ = Improve(σ)

Institute for Applied Information Processing and Communications (IAIK) 13 TU Graz/Computer Science/IAIK AK Design and Verification Quality of a Strategy  Only admissable strategies  MIN: take shortest path to t (any other loop is positive)  val σ ( v): shortest distance from v to t in G σ  σ is better than σ* (σ > σ*) iff:  ∀v∈V: val σ ( v) ≥ val σ* ( v) AND  ∃v∈V: val σ ( v) > val σ* ( v)

Institute for Applied Information Processing and Communications (IAIK) 14 TU Graz/Computer Science/IAIK AK Design and Verification Computing val σ ( v): Shortest Path Problem Given:  Finite, directed, edge weighted graph: G = (V, t, E, w)  t = unique sink Find:  shortest path from every v to t Algorithms:  Dijkstra's algorithm: only positive weights  Bellman Ford algorithm: also negative weights

Institute for Applied Information Processing and Communications (IAIK) 15 TU Graz/Computer Science/IAIK AK Design and Verification Bellman Ford Algorithm [3] Foreach v in V distance[v]= ∞ succ[v] = None distance[t] = 0 succ[t] = t do |V|-1 times: foreach (u,v) in E: if(distance[v] + w(u,v) < distance[u]): distance[u] = distance[v] + w(u,v)‏ succ[u] = v uv uv 2 4 2

Institute for Applied Information Processing and Communications (IAIK) 16 TU Graz/Computer Science/IAIK AK Design and Verification Bellman Ford Algorithm Example: t v0v0 v1v1 v2v2 v3v3...V MAX...V MIN t v0v0 v1v1 v2v2 v3v3 e1e1 e2e2 e3e3 e4e4 e5e t v0v0 ∞∞ v1v1 ∞ v2v2 ∞∞∞∞ 6 v3v3 ∞∞∞ distances:

Institute for Applied Information Processing and Communications (IAIK) 17 TU Graz/Computer Science/IAIK AK Design and Verification Bellman Ford Algorithm Another Example: 0 t v0v0 v1v1 012 t0000 v0v0 ∞12 9 v1v1 ∞∞ 10 distances: e2e2 e1e1 e3e3  Bellman Ford does not work with negative loops

Institute for Applied Information Processing and Communications (IAIK) 18 TU Graz/Computer Science/IAIK AK Design and Verification Switching the strategy  Picking another successor in a V MAX vertex:  Notation: σ [x  y]  σ [x  y](x) = y  σ [x  y](a) = σ(a) Switch σ [v  u] is:  attractive iff: w(v,u) + val σ (u) > val σ (v)  profitable iff: σ [v  u] > σ  expensive to check vu vu 3 5 2

Institute for Applied Information Processing and Communications (IAIK) 19 TU Graz/Computer Science/IAIK AK Design and Verification Main Theorems Theorem 5.1:  Switch is attractive  Switch is profitable  Also holds for combinations of switches Theorem 5.2:  No more attractive switches  strategy at least as good as any other admissable strategy.

Institute for Applied Information Processing and Communications (IAIK) 20 TU Graz/Computer Science/IAIK AK Design and Verification Putting the pieces together solve_0-mean_partition(G’): G = MPGtoLSP(G’)‏ σ 0 = computeInitialAdmissableStrategy(G)‏ σ = σ 0 while(σ changes): (σ, distance) = Improve(σ, G)‏ V MAX = V MIN = emptySet foreach v in (G.V\t): distance[v] == ∞ ? V MAX.add(v) : V MIN.add(v)‏ return (V MAX, V MIN, σ)‏ Improve(σ, G): G σ = restrictGraph(G, σ)‏ distance = BellmanFord(G σ )‏ (v, u, failed) = findAttractiveSwitch(distance)‏ if(failed): return (σ, distance)‏ return (σ[v->u], None)‏ findAttractiveSwitch(distance): foreach (v,u) in (G.E \ G σ.E): if(w(v,u) + distance[u] > distance [v]): return (v,u,0)‏ return (None, None,1)‏

Institute for Applied Information Processing and Communications (IAIK) 21 TU Graz/Computer Science/IAIK AK Design and Verification Putting the pieces together Example: t 0 0 MPG to LSP σ = σ t ∞ ∞ ∞ ∞ σ = Improve(σ) t σ = Improve(σ) t σ = Improve(σ)

Institute for Applied Information Processing and Communications (IAIK) 22 TU Graz/Computer Science/IAIK AK Design and Verification Improvements: Switches  Any combination of attractive switches improves the strategy  Multiple switches per iteration  Try heuristics for selecting single or multiple attractive switches  Random, all attractive switches,...  Initial Multiple Switching  Proceeding in Stages

Institute for Applied Information Processing and Communications (IAIK) 23 TU Graz/Computer Science/IAIK AK Design and Verification Improvements: Randomization  Order of switches is crutial for complexity  Facet F[u  v] = set of strategies  where succ[u] = v, u ∈ V MAX  Randomization scheme [4]: find_best_strategy(σ,G)‏ if(G == G σ ): return σ while(true): randomly pick some F[u->v] not containing σ σ* = find_best_strategy(σ, G\(u,v)) if(σ* is optimal in G): return σ* G = F σ = σ[u->v]

Institute for Applied Information Processing and Communications (IAIK) 24 TU Graz/Computer Science/IAIK AK Design and Verification Improvements: Randomization Example: t v0 v1 v2 v3 pick F[v1  v0] t v0 v1 v2 v3 (G\(v1,v0), σ): (G, σ): σ* optimal in G? NO! There is an attractive switch! t v0 v1 v2 v3 σ = σ*, G = F[v1  v0] (G, σ): t v0 v1 v2 v3 σ* = find_best_strategy(σ, G\(v1,v0)) (G, σ*): call recursive

Institute for Applied Information Processing and Communications (IAIK) 25 TU Graz/Computer Science/IAIK AK Design and Verification Improvements: Randomization Example continued: t v0 v1 v2 v3 pick F[v0->t] (G\(v0,t), σ ): t v0 v1 v2 v3 σ* optimal in G? YES! No more attractive switches! t v0 v1 v2 v3 (G, σ): σ* = find_best_strategy(σ, G\(v0,t)) (G, σ*): t v0 v1 v2 v3 0 recursive call

Institute for Applied Information Processing and Communications (IAIK) 26 TU Graz/Computer Science/IAIK AK Design and Verification Improvements: Recomputing the measure  Switch from σ to σ* = σ [v  u]  val σ ( v) = val σ* (v) for some v  Compute nodes that change their value  Bellman Ford Algorithm only for these nodes

Institute for Applied Information Processing and Communications (IAIK) 27 TU Graz/Computer Science/IAIK AK Design and Verification Which values change?  σ* = σ[u 1  v 1 ][u 2  v 2 ]...  U = {u 1, u 2,...} Mark all vertices in U while(U not empty): u = U.pop()‏ foreach unmarked predecessors p of u in G σ* : if w(p,x) + d[x] > d[p] for all unmarked succ x of p in G σ* : mark u U.push(u)‏ u p x1x1 x2x

Institute for Applied Information Processing and Communications (IAIK) 28 TU Graz/Computer Science/IAIK AK Design and Verification Which values change? Example: t v0v0 v1v1 v2v2 v3v3 0 0 (G, σ): t v0v0 v1v1 v2v2 v3v3 (G, σ*): σ* = σ[v 0  v 3 ] Switch t 0 0 v0v0 v1v1 v2v2 v3v3 (G σ*, σ*): markedUu{p i }{x j }conditionTRUE for all x j ? v0v0 {v 0 }v0v0 v2v2 v3v3 w(v 2,v 3 )+d[v 3 ]>d[v 2 ] 7-1 > -8 YES v 0, v 2 {v 2 }v2v2 ----

Institute for Applied Information Processing and Communications (IAIK) 29 TU Graz/Computer Science/IAIK AK Design and Verification Complexity: p-Mean Partition Without Improvement:  n·W finite values  n²·W switches  Bellman Ford: O(n·m)  O(n³·m·W) With Improvement:  Bellman Ford: O(n i · m), n i = |changing nodes|  Σ(n i ) = n²·W  O(n²·m·W)

Institute for Applied Information Processing and Communications (IAIK) 30 TU Graz/Computer Science/IAIK AK Design and Verification Complexity: p-Mean Partition With Randomization [4]: All together:

Institute for Applied Information Processing and Communications (IAIK) 31 TU Graz/Computer Science/IAIK AK Design and Verification Ergodic Partition  w -, w + : smallest and biggest edge weights  val(ρ) = average(w(e i )) in [w -, w + ]  denominator ≤ n  Repeated p-mean partitioning:  Break interval [w -, w + ] in parts of length 1/n²  decide which v are in each interval  Min. difference between 2 values:  Unique value in each interval

Institute for Applied Information Processing and Communications (IAIK) 32 TU Graz/Computer Science/IAIK AK Design and Verification Complexity: Comparison This ApproachZwick / Paterson Ergodic Partition p-Mean Partition

Institute for Applied Information Processing and Communications (IAIK) 33 TU Graz/Computer Science/IAIK AK Design and Verification Summary  The first strongly subexponential algorithm  Algorithm for p-Mean Partition problem  Longest Shortest Path Problem  Strategy improvement  Improvements  Extended to Ergodic Partition problem

Institute for Applied Information Processing and Communications (IAIK) 34 TU Graz/Computer Science/IAIK AK Design and Verification References [1]H. Björklund, S. Sandberg, S. Vorobyov, A combinatorial strongly subexponential strategy improvement algorithm for mean payoff games, in: Proc. 29th International Symposium on Mathematical Foundations of Computer Science (MFCS), Vol of Lecture Notes in Computer Science, Springer-Verlag, 2004, pp. 673–685. [2] U. Zwick and M. Paterson. The complexity of mean payoff games on graphs. Theor.Comput. Sci., 158:343–359, [3]T. H. Cormen, C. E. Leiserson, R. L. Rivest, and C. Stein. Introduction to Algorithms. MIT Press and McGraw-Hill Book Company, Cambridge, MA, 2nd edition, [4]J. Matousek, M. Sharir, and M. Welzl. A subexponential bound for linear programming. In 8th ACM Symp. on Computational Geometry, pages 1–8, 1992.

Institute for Applied Information Processing and Communications (IAIK) 35 TU Graz/Computer Science/IAIK AK Design and Verification Questions / Discussion... thank you for your attention

Institute for Applied Information Processing and Communications (IAIK) 36 TU Graz/Computer Science/IAIK AK Design and Verification Appendix  Proof sketches for Theorem 5.1 and 5.2

Institute for Applied Information Processing and Communications (IAIK) 37 TU Graz/Computer Science/IAIK AK Design and Verification Proof sketch: Theorem 5.1 (attractive  profitable) Value increases at least in one vertex:  Attractive switch σ * = σ [v  u]:  w(v,u) + val σ (u) > val σ (v)  val σ * (v) > val σ (v) Values do not decrease:  New loops are positive  New paths to the sink are longer

Institute for Applied Information Processing and Communications (IAIK) 38 TU Graz/Computer Science/IAIK AK Design and Verification Proof sketch: Theorem 5.1 (attractive  profitable) New loops are positive:  Switch σ * = σ [v  u]:  New loop must contain switching vertex v 0 t v y u x y = val σ (v) < w(v,u) + val σ (u) ≤ x + y  x > 0 switch is attractive val σ (u) ≤ x – w(v,u) + y

Institute for Applied Information Processing and Communications (IAIK) 39 TU Graz/Computer Science/IAIK AK Design and Verification Proof sketch: Theorem 5.1 (attractive  profitable) New paths to the sink are longer :  Switch σ * = σ [v  u]:  New path from any vertex n to t must contain switching vertex v 0 t v y u x y = val σ (v) < w(v,u) + val σ (u) ≤ x  y < x n a switch is attractive val σ (u) ≤ x – w(v,u)

Institute for Applied Information Processing and Communications (IAIK) 40 TU Graz/Computer Science/IAIK AK Design and Verification Proof sketch: Theorem 5.2 (stable  optimal) Proof for one-player games:  MIN has no choices  Finite values cannot become infinite  no more attractive switches  no more new positive loops  Finite values do not improve finitely  no more attractive switches  no more new longer paths to t Extension to two-player games:  MIN does not need choices

Institute for Applied Information Processing and Communications (IAIK) 41 TU Graz/Computer Science/IAIK AK Design and Verification Proof sketch: Theorem 5.2 (stable  optimal) No more new positive loops:  Assumption: there is a new positive loop 0 t v y u x switch attractive  y < x + y no attractive switches  y ≥ x + y  x ≤ 0

Institute for Applied Information Processing and Communications (IAIK) 42 TU Graz/Computer Science/IAIK AK Design and Verification Proof sketch: Theorem 5.2 (stable  optimal) No more new longer paths to t :  Assumption: there is a new longer path to t switch attractive  y < x no attractive switches  y ≥ x  can not have better finite values 0 t v y u x n a