Supplementary: Feasible Labels and Linear Programming  Consider the LP formulation of the shortest s-t path problem: (P) Minimize  (i, j)  A c ij x.

Slides:



Advertisements
Similar presentations
Duality for linear programming. Illustration of the notion Consider an enterprise producing r items: f k = demand for the item k =1,…, r using s components:
Advertisements

Linear Programming (LP) (Chap.29)
Transportation Problem (TP) and Assignment Problem (AP)
1 Introduction to Linear Programming. 2 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. X1X2X3X4X1X2X3X4.
Computational Methods for Management and Economics Carla Gomes Module 6a Introduction to Simplex (Textbook – Hillier and Lieberman)
Chapter 5 Shortest Paths: Label-Correcting Algorithms
MINIMUM COST FLOWS: NETWORK SIMPLEX ALGORITHM A talk by: Lior Teller 1.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
Chapter 7 Maximum Flows: Polynomial Algorithms
Operation Research Chapter 3 Simplex Method.
Optimization Linear Programming and Simplex Method
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.
Network Simplex Method Fatme Elmoukaddem Jignesh Patel Martin Porcelli.
Max-flow/min-cut theorem Theorem: For each network with one source and one sink, the maximum flow from the source to the destination is equal to the minimal.
LINEAR PROGRAMMING SIMPLEX METHOD.
Chapter 3 Linear Programming Methods 高等作業研究 高等作業研究 ( 一 ) Chapter 3 Linear Programming Methods (II)
Chapter 4 Shortest Path Label-Setting Algorithms Introduction & Assumptions Applications Dijkstra’s Algorithm.
Simplex method (algebraic interpretation)
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
Kerimcan OzcanMNGT 379 Operations Research1 Linear Programming: The Simplex Method Chapter 5.
Minimum Cost Flows. 2 The Minimum Cost Flow Problem u ij = capacity of arc (i,j). c ij = unit cost of shipping flow from node i to node j on (i,j). x.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
3.3 Implementation (1) naive implementation (2) revised simplex method
1 1 Slide © 2005 Thomson/South-Western Linear Programming: The Simplex Method n An Overview of the Simplex Method n Standard Form n Tableau Form n Setting.
Chapter 4 Linear Programming: The Simplex Method
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Hon Wai Leong, NUS (CS6234, Spring 2009) Page 1 Copyright © 2009 by Leong Hon Wai CS6234: Lecture 4  Linear Programming  LP and Simplex Algorithm [PS82]-Ch2.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
OR Chapter 7. The Revised Simplex Method  Recall Theorem 3.1, same basis  same dictionary Entire dictionary can be constructed as long as we.
Chapter 8 Maximum Flows: Additional Topics All-Pairs Minimum Value Cut Problem  Given an undirected network G, find minimum value cut for all.
Flow in Network. Graph, oriented graph, network A graph G =(V, E) is specified by a non empty set of nodes V and a set of edges E such that each edge.
Chapter 8 Network Models to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004 Brooks/Cole,
Simplex Method Simplex: a linear-programming algorithm that can solve problems having more than two decision variables. The simplex technique involves.
15.082J & 6.855J & ESD.78J September 30, 2010 The Label Correcting Algorithm.
Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘length’ c ij (cost, time, distance, …). Determine a path of shortest.
OR  Now, we look for other basic feasible solutions which gives better objective values than the current solution. Such solutions can be examined.
C&O 355 Lecture 19 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: A A A A A A A A A A.
1 Optimization Linear Programming and Simplex Method.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
EMGT 6412/MATH 6665 Mathematical Programming Spring 2016
St. Edward’s University
Chap 10. Sensitivity Analysis
The minimum cost flow problem
Perturbation method, lexicographic method
Chapter 5. Optimal Matchings
James B. Orlin Presented by Tal Kaminker
Chapter 4 Linear Programming: The Simplex Method
Chap 9. General LP problems: Duality and Infeasibility
Polyhedron Here, we derive a representation of polyhedron and see the properties of the generators. We also see how to identify the generators. The results.
Chapter 6. Large Scale Optimization
Chapter 5. Sensitivity Analysis
Chap 3. The simplex method
Analysis of Algorithms
Polyhedron Here, we derive a representation of polyhedron and see the properties of the generators. We also see how to identify the generators. The results.
Chapter 8. General LP Problems
2.2 Shortest Paths Def: directed graph or digraph
Chapter 5. The Duality Theorem
Flow Feasibility Problems
Chapter 8. General LP Problems
Chapter 2. Simplex method
Simplex method (algebraic interpretation)
Chapter 8. General LP Problems
Chapter 6. Large Scale Optimization
Chapter 2. Simplex method
Chapter 3. Pitfalls Initialization Ambiguity in an iteration
Presentation transcript:

Supplementary: Feasible Labels and Linear Programming  Consider the LP formulation of the shortest s-t path problem: (P) Minimize  (i, j)  A c ij x ij subject to  {j: (i, j)  A} x ij -  {j: (j, i)  A} x ji = +1, for i = s = -1, for i = t = 0, for i  N\{s, t} x ij  0 for all (i, j)  A It is guaranteed that the optimal solution to (P), if exists, is integer-valued (proof later when we study MCF). Hence we can solve the LP instead of IP.  Multiply (-1) on both sides of the constraints, then get  {j: (j, i)  A} x ji -  {j: (i, j)  A} x ij = -1, for i = s = +1, for i = t = 0, for i  N\{s, t} i.e consider (inflow to i) – (outflow from i) Network Theory and Applications

(P) Minimize  (i, j)  A c ij x ij (S-1) subject to  {j: (j, i)  A} x ji -  {j: (i, j)  A} x ij = -1, for i = s = +1, for i = t = 0, for i  N\{s, t} x ij  0 for all (i, j)  A  The dual of (P) is (D) maximize y t – y s (S-2) subject to y j - y i  c ij for all (i, j)  A  Note that, for a dual feasible solution y, we may subtract any constant  from each dual variable and we still have a dual feasible solution with the same objective value.  we may set y s = 0. Network Theory and Applications

 We assumed there exists a s-t path in G, hence (P) is feasible. If (P) has a finite optimal value (with directed s-t walk), then by strong duality, (D) is also feasible and its optimal value is the same as (P) (shortest s-t distance = y t ) Conversely, if (D) has a feasible solution, then (P) and (D) have the same optimal value (since (P) is feasible too). (Compare with Thm 5.1)  If the network contains a negative cycle, (P) is unbounded, hence (D) is infeasible, i.e. no y (d(  )) satisfies (5.2) Network Theory and Applications

 The constraint matrix in (P) has special structure; each column has exactly one 1 and one –1 (except nonnegativity constraints). Adding the rows of the matrix A, we get 0 vector, which implies the rows are linearly dependent (rank is  n-1).  Prop : Let G be a connected directed graph and D = {a e : e  A} be its node- arc incidence matrix ( a e is the column vector for arc e in the constraint matrix). A set {a e : e  T} is a column basis of D iff T is the arc-set of a spanning tree of G (not considering the directions of the arcs). ( G has n nodes, m arcs. D is n  m matrix. Spanning tree has n-1 arcs.) Network Theory and Applications

 So the rank of D is n-1. To solve the problem by the simplex method, we need nonsingular basis B. Two approaches:  Drop one of the constraints and solve the full row rank problem  Add an artificial variable to any one constraint (objective coefficient is 0). It makes D full row rank (the artificial variable always remains in the basis and has value 0 in any b.f.s).  b.f.s. and dual vector satisfies x e = 0 for all e  T y j – y i = c ij for all (i, j)  T ( From y’B = c B ’ for current basis B) This y vector gives the path length to each node j in the current tree T (If T is directed out-tree). Note that if we add artificial variable for node s (root), then we have y s = 0 in any b.f.s. ( from y’B = c B ’) Network Theory and Applications

 A b.f.s. for (P) does not necessarily correspond to an directed out-tree. It may be just a spanning tree. However, the simplex iteration can be modified so that we always have directed out-tree, once we started the algorithm with a directed out-tree.  Each step of the simplex method may correspond to multiple Ford’s step; (1) Change of directed out-tree (2) update the node labels so that it gives the actual path length in the directed out-tree. Network Theory and Applications

 Suppose we solve s-t shortest path problem by LP (with simplex method) and have a feasible directed out-tree (bfs);  entering nonbasic arc selection: choose arc (i, j) with c ij – (y j – y i ) < 0, i.e. c ij + y i < y j. ( from c j – y’A j < 0 since we solve min problem )  leaving basic variable: select the entering arc to node j in the current directed out- tree as leaving basic arc. (updating tree in Ford algorithm)  Update flow (x-value) so that we have value 1 for each arc on the s-t path.  Note that we may solve the shortest s-t path problem by LP. But, in an optimal basis (directed out-tree), we have shortest s-j path, for all j  N. ( If you use the above modified simplex method) ( We have feasible potential (label) y and the s-j paths in the directed out-tree for all j  N gives actual paths with length y j for all j  V.) Network Theory and Applications

 The identification of the basis of the LP as a spanning tree (not necessarily directed out-tree) is used in the network simplex algorithms for the minimum cost network flow problem. (Chapter 11) Network Theory and Applications

Other Interpretation of Ford-Bellman Algorithm  Reference: Combinatorial Optimization: Networks and Matroids, E. Lawler  Bellman’s equations: u 1 = 0 u j = min k  j { u k +a kj }, j=2, 3, …, n (necessary and sufficient conditions for shortest paths when G does not contain a nonpositive cycle.)  Solve Bellman’s eq. iteratively. Still effective if no negative cycle in G.  Initial values u 1 (1) = 0 u j (1) = a 1j, j  1 Iteration u j (m+1) = min { u j (m), min k  j { u k (m) + a kj }}  Interpretation u j (m) = the length of a shortest path from the origin to j, subject to the condition that the path contains no more than m arcs. (compare it with the presentation given in the text) Network Theory and Applications

5.6 All-Pairs Shortest Path Probelm  Assume G is strongly connected. (add (s, i) and (i, s) for i  N\{s} with large costs if not exist)  Two approaches:  Repeated shortest path algorithm (suitable for sparse graph)  All-pairs label-correcting algorithm (suitable for dense graph)  Repeated Shortest Path Algorithm: Let S(n, m, C) denote the time needed to solve a shortest path problem with nonnegative arc lengths. Select a node s as a source node and use FIFO label-correcting algorithm. Then, have c ij d = c ij + d(i) – d(j)  0 for all arcs (i, j). Using c ij d  0, solve single-source shortest path problem (n-1) times. From Property 5.2.(b) (  (i, j)  P c ij d =  (i, j)  P c ij + d(k) – d(l)), actual shortest path length from k to l is (  (i, j)  P c ij d + (d(l) – d(k) ) Running time: O(nm + nS(n, m, C)) = O(nS(n, m, C)). Network Theory and Applications

 All-Pairs Shortest Path Optimality Conditions:  Thm 5.5. Let d[i, j] represent the length of some directed path from node i to node j. Then d[i, j] optimal  d[i, j]  d[i, k] + d[k, j] for all i, j, and k. (5.3) Pf)  ) If d[i, k] + d[k, j] < d[i, j], use path from i → k → j walk. Contradiction to the optimality of d[i, j].  ) d[i, j] length of some path  upper bound on the shortest length Let i = i 1 – i 2 – i 3 - … - i k = j be any i-j path P  d[i, j] = d[i 1, i k ]  d[i 1, i 2 ] + d[i 2, i k ]  c i(1)i(2) + d[i 2, i k ], d[i 2, i k ]  c i(2)i(3) + d[i 3, i k ], … d[i k-1, i k ]  c i(k-1)i(k).  d[i, j]  c i(1)i(2) + c i(2)i(3) + … + c i(k-1)i(k) =  (i, j)  P c ij. Hence d[i, j] is a lower bound on any i-j path. d[i, j] also upper bound, so optimal. Network Theory and Applications

 All-Pairs Generic Label Correcting Algorithm: algorithm all-pairs label-correcting; begin set d[i, j] :=  for all [i, j]  N  N; set d[i, i] := 0 for all i  N; for each (i, j)  A do d[i, j] := c ij ; while the network contains three nodes i, j, and k satisfying d[i, j] > d[i, k] + d[k, j] do d[i, j] := d[i, k] + d[k, j]; end; Network Theory and Applications

 Correctness: Whenever d[i, j] < ,  walk of length d[i, j] from i to j. The walk may decompose into a path P and some directed cycles. At termination of the algorithm, all of the directed cycles must have length 0, hence the path length is d[i, j]. Also labels d[i, j] satisfy the optimality condition (5.3).  Finiteness: Distance label is bounded from above by nC, from below by –nC. Each iteration decreases some d[i, j]. Hence, total O(n 3 C) iterations.  O(n 3 ) implementation: Floyd-Warshall Algorithm Network Theory and Applications

 Floyd-Warshall Algorithm: d k [i, j]: i-j shortest path length using only the nodes 1, 2, …, k-1 as internal nodes. Then, d n+1 [i, j] represents shortest path length from i to j. Starting from d 1 [i, j], update the labels recursively.  Property 5.6. d k+1 [i, j] = min {d k [i, j], d k [i,k] + d k [k, i]}. Two cases: 1.Do not use node k. Then d k+1 [i, j] = d k [i, j] 2.Use node k. Then d k+1 [i, j] = d k [i,k] + d k [k, i] Network Theory and Applications

 Algorithm Floyd-Warshall; begin for all node pairs [i, j]  N  N d[i, j] :=  and pred[i, j] := 0; for all nodes i  N do d[i, i] := 0; for each arc (i, j)  A do d[i, j] := c ij and pred[i, j] := i; for each k := 1 to n do for each [i, j]  N  N do if d[i, j] > d[i, k] + d[k, j] then begin d[i, j] := d[i, k] + d[k, j]; pred[i, j] := pred[k, j]; end; Network Theory and Applications

 View as operation on matrix: Network Theory and Applications d[i, j] d[k, j] d[i, k] k k  If there exists no negative cycle, d k [i, i] = 0 for all i, k Hence row k, column k do not change.  maintain only one copy of the matrix. If there exists a negative cycle  d[i, i] < 0 for some i.

 Retrieving actual paths: pred[i, j] denotes the last node prior to node j in the tentative shortest path from node i to node j. Consider a path P from node k to node l. Starting from node l, let g=pred[k, l]. Then g is the last node prior to node l in P. Similarly, h = pred[k, g] is the node prior to node g in P, and so on. Repeat until we reach node k.  Thm 5.7. The Floyd-Warshall algorithm runs in O(n 3 ). Network Theory and Applications

 Detection of negative cycles: Two tests for negative cycle:  If i = j, check whether d[i, i] < 0.  If i  j, check whether d[i, j] < -nC.  Use predecessor graph to retrieve negative cycle. Network Theory and Applications

Other algebraic view  Reference: Combinatorial Optimization: Networks and Matroids, E. Lawler  Let d[i, j] = length of a shortest path from i to j. d k [i, j] = length of a shortest path from i to j using  k arcs. d 0 [i, i] = 0, d 0 [i, j] = +  (i  j) d k+1 [i, j] = min l { d k [i, l] + c lj } Have d (n-1) [i, j] = d[i, j]  Define the new matrix multiplication  as P = A  B, P ij = min k {a ik + b kj } We have D k+1 = D k  C D (0) = is identity matrix D (0)  C = C multiplication  is associative. D n-1 = D n-2  C = … = ((D 0  C)  C) …  C) = C n-1 Also C m = C n-1, m  n-1. Network Theory and Applications

 Can compute C n-1 as C → C 2 → C 4 → … → C 2(k), 2 k  n-1. log(n) steps  O(n 3 log n) Floyd-Warshall is a clever implementation of matrix multiplcation. Network Theory and Applications

5.7 Minimum Cost-To-Time Ratio Cycle Problem  Tramp steamer problem: Identify a directed cycle W of G with the maximum ratio (  (i, j)  W p ij )/(  (i, j)  W  ij ) Let cost c ij of arc (i, j) as c ij = -p ij, and identify W with minimum ratio. Assume data are integral and  ij  0 for (i, j)  A and  (i, j)  W  ij > 0 for every directed cycle W in G. Let  (W) = (  (i, j)  W c ij )/(  (i, j)  W  ij ) and  * is optimal value. Starting from arbitrary value of , define the length of each arc as l ij = c ij -  ij. Then use negative cycle detection algorithm. Network Theory and Applications

 Three cases: (1) G contains a negative length cycle W. have  (i, j)  W (c ij -  ij ) < 0. Alternatively,  > (  (i, j)  W c ij )/(  (i, j)  W  ij )   *. Therefore,  is a strict upper bound on  *. (2) G contains no negative cycle, but does contain a zero-length cycle W*. (see Exercise 5.19 on how to identify a zero-length cycle) no negative cycle implies  (i, j)  W (c ij -  ij )  0 for every directed cycle W. Alternatively,   (  (i, j)  W c ij )/(  (i, j)  W  ij ) for every directed cycle W. Also, existence of zero-length cycle W* implies  = (  (i, j)  W* c ij )/(  (i, j)  W*  ij ). Hence  =  *, and W* is a minimum cost-to-time ratio cycle. (3) Every directed cycle W in G has a positive length. have  (i, j)  W (c ij -  ij ) > 0 for every directed cycle W. Alternatively,  < (  (i, j)  W c ij )/(  (i, j)  W  ij ) for every directed cycle W. Hence,  is a strict lower bound on  *. Network Theory and Applications

 Search procedures: Guess a value  and use shortest path algorithm If negative cycle,    *. Use smaller value of . If zero-length cycle, then optimal. If positive length cycle,  <  *. Use larger value of .  Sequential search algorithm: Let  0 be a known upper bound on  *. Solve the shortest path problem with (c ij -  0  ij ) as arc lengths. Either find a zero-length cycle W or a negative cycle W. In the former case, optimal found, stop. In the latter case, let  1 = (  (i, j)  W c ij )/(  (i, j)  W  ij ) as our next guess. Have  0 >  1   *. Obtain sequence of values  0 >  1 … >  k =  *. Network Theory and Applications

 Binary search algorithm: Let [  L,  U ] be the interval that contains  *. (e.g. [-C, C]) Use  0 = (  L +  U )/2, and check for negative cycle. If a negative cycle exists,  0 >  *. Reset  U =  0. Otherwise,  0   *. Reset  L =  0. After sufficiently large number of iterations, the search interval has a unique solution.  Let c(W) and  (W) denote the cost and travel time of any directed cycle W, and let  0 = max{  ij : (i, j)  A}. Claim: The interval of size at most 1/  0 2 contains at most one value from the set {c(W)/  (W): W is a directed cycle} Let W 1 and W 2 be two directed cycles with distinct ratios. Then |c(W 1 )/  (W 1 ) - c(W 2 )/  (W 2 )|  0, or | {c(W 1 )/  (W 2 ) - c(W 2 )/  (W 1 )} / {  (W 1 )  (W 2 )} |  0. Smallest value of the left-hand side is 1/  0 2. Hence if the interval becomes smaller than 1/  0 2, using  U as the value of  identifies the optimal cycle W. Network Theory and Applications

Network Theory and Applications  Handout: Combinatorial Optimization: Networks and Matroids, E. Lawler  Enumerate simple paths in nondecreasing order with respect to the weights.  Let P be the set of all 1-n paths. Find shortest path P 1 initially. Modify the lengths using c d ij  0. Partition P – {P 1 } into subsets P 1, P 2, …, P k, where k  n-1, so that we can determine the shortest path in each subset. Let P 2 be the shortest of these shortest paths identified. Suppose P 2  P j. We then partition P j - {P 2 } into subsets in the same way, and so on.  The procedure can be described as a tree. How to partition the subset so that we do not lose any path and we can find a shortest path in each subset easily? M Shortest Paths without Repeated Nodes

 Suppose we have shortest paths P 1, P 2, …, P m. Let P be the set of all 1-n paths. We divide the set P – {P 1, P 2, …, P m } into P 1, P 2, …, P k, where k  n- 1. Each P j includes paths with the condition that (a) they include the arcs in a certain specified path from node 1 to another node p, and (b) certain arcs from node p are excluded. Then we can find a shortest path in P j by finding a shortest path from node p to n after deleting nodes in the path from 1 to p, and deleting the arcs excluded from node p.  In general, suppose that P m is the shortest path (1, 2), (2, 3), …, (q-1, q), (q, n) in P j. Paths in P j have restrictions that they should include arcs (1, 2), (2, 3), …, (p-1, p), where p  q, and that certain arcs from node p are excluded. Partition P j – {P m } as follows:  If p = q, apply Dijkstra’s to obtain 1-n shortest path, subject to the conditions that arcs (1, 2), (2, 3), …, (p-1, p) are included, and that (p, n) is excluded, in addition to the arcs from p excluded for P m. Network Theory and Applications

 If p < q, apply Dijkstra’s to find the shortest path from 1 to n, subject to the following sets of conditions: (1) Arcs (1, 2), (2, 3), …, (p-1, p) are included and arc (p, p+1) is excluded, in addition to the arcs from p excluded for P m. (2) Arcs (1, 2), (2, 3), …, (p, p+1) are included and arc (p+1, p+2) is excluded. … (q-p-2) Arcs (1, 2), (2, 3), …, (q-2, q-1) are included and arc (q-1, q) is excluded. (q-p-1) Arcs (1, 2), (2, 3), …, (q-1, q) are included and arc (q, n) is excluded.  Network Theory and Applications