Workshop In Advanced Data Structures Push-Relabel Heuristics. Maya Orshizer Sagi Hed

Size: px
Start display at page:

Download "Workshop In Advanced Data Structures Push-Relabel Heuristics. Maya Orshizer Sagi Hed"

Transcription

1 Workshop In Advanced Data Structures Push-Relabel Heuristics Maya Orshizer Sagi Hed 1

2 Contents 1 Overview And Goals 3 2 Our Implementation Of Push Relabel Definitions Maintained Data Initialization Termination Methods Phase II Active Node Selection Strategy Heuristics Global Relabeling Heuristic Overview The Heauristic Correctness Layout Code Variation Level-Cut Heuristic Overview Intention Gap Relabeling Heuristic Code Correctness Layout Maintaining Minimum Cuts A Maximum Flow Bound For Global Relabeling Timestamp Heuristic Overview Intention Correctness Layout Code Implementation Details 15 5 Graphs And Work Plan 15 6 Testing Plan 16 7 Appendix Correctness Of Gap Relabeling References 16 2

3 1 Overview And Goals In our workshop we implement the push-relabel algorithm of A.V. Goldberg and R.E. Tarjan for the maximum flow problem (see [1]). We add to the current implementation of A.V. Goldberg by 2 variations, and 2 more original heuristics of our own. Our primary goal is to show some factor of improvement compared to A.V. Goldberg s h prf code (it was renamed to hi pr in its newest version - The h prf implementation of pushrelabel uses highest level active node selection - slightly different than our own suggestion (see 2.7), global relabeling heuristic - slightly different then our own suggestion (see 3.1), and gap relabeling heuristic - which is generalized by our level-cut heuristic (see 3.2). We also add the timestamp heuristic (see 3.3). It is possible that our code will not be directly comparable to h prf (i.e. will not perform better than h prf even without the suggested heuristics). However if our code will show an improvement factor compared to itself without the heuristics, then it might be deduced that the heuristics are worthwhile (and perhaps then attempt to integrate them into h prf). 2 Our Implementation Of Push Relabel The push-relabel algorithm has many variations, namely in the form of different active node selection strategies. In this section we will outline the steps of the algorithm, providing pseudo code for the main methods and specifications of the data that is maintained throughout the algorithm. We will do so in light of our chosen variation so that pseudo codes here should correspond to the actual layout of our later implemented code. The push-relabel algorithm is fully described in [1]. We will not provide a full description here, only a recap in light of our own implementation. Our heuristic additions to the algorithm are described in section Definitions G = (V, E) - The input graph. V = n, E = m. G f = (V, E f ) - The residual graph of G with the pre-flow f, consisting of edges and anti-edges. c(e) is a capacity function on the edges of G f. For a residual anti-edge e, c(e ) = 0. f(e) is a pre-flow function on the edges of G f. For a residual anti-edge e, f(e ) = f(e ). c f (e) is a residual capacity on the edges of G f. c f (e) = c(e) f(e) for any edge e. e(v) is the amount of excess flow on node v. e(s) =. Active node is a node v s with e(v) > 0. d(v) is a label value on node v. s is the source node for the maximum flow problem. t is the sink node for the maximum flow problem. 3

4 2.2 Maintained Data We will provide a generic adjacency list graph implementation. This will be used to maintain G f. In this implementation each edge e will hold c(e) and f(e). It will also hold whether e is an edge or an anti-edge. For the final output, the flow on anti-edges will be meaningless. Each node will hold d(v) and e(v). This will provide O(1) access to all the definitions in 2.1. Each node v also holds current edge(v) which maintains one of v s edges as the current one, and first edge(v) which is the first edge on v s adjacency list. The active node data structures are described in Initialization Initialization() for all edges e: f(e) = 0 for all nodes v: current edge(v) = f irst edge(v) d(s) = n, d(t) = 0 for all v s, t: d(v) = 1 and for all edges e coming from s, Push(s,e) treating e(s) as (see 2.5) 2.4 Termination The algorithm terminates when there are no more active nodes. Correctness is proven in [1]. For details of how termination is determined see Methods Not surprisingly, there are two simple basic methods in push-relabel: push and relabel. Push(v, e = (v, u)) Applicable: if v is active ( e(v) > 0 ) and d(v) = d(u) + 1. amount to push = min {e(v), c f (e)} Add a flow of amount push to edge e. Update e(u), flow on edges (v, u) and (u, v) and consequently the residual graph G f. Relabel(v) Applicable: if v is an active node and no push can be applied to it (the relabel can be run if a push is applicable but it will simply do nothing) d(v) = min (v,u) Ef {d(u) + 1} 4

5 These methods are combined using the Discharge method Discharge(v) Applicable: if v is active (e(v) > 0) next min label(v) = For each edge e = (v, u) of v starting from current edge(v): if d(v) = d(u) + 1 then Push(v,e) if e(v) = 0 then break (exit loop) if d(v) < d(u) + 1 then: if d(u) < next min label(v) then do: next min label(v) = d(u) if e(v) > 0 then: // otherwise next sweep will continue from current edge(v) current edge(v) = f irst edge(v) Relabel(v) using next min label(v) Remembering the current edge(v) after the sweep, in case we did not finish going through all edges, is critical to keeping the time complexity of the algorithm (in fact it keeps the amount of unproductive edge checks at O(nm) during the entire run, see [1] Theorem 4.2). 2.6 Phase II Although this is only remotely described in [3], A.V. Goldberg uses a two phase variant of push-relabel in his h prf implementation. Phase I operates normally as described above (and in 2.7) on all active nodes v in G f with d(v) < n. All active nodes v with d(v) n are accumulated and ignored until phase II when there are no more active nodes v with d(v) < n. Note that nodes v with d(v) n have no path to t, since such a path would be of at most n 1 edges contradictory to the label which is a lower bound on the distance to t. So phase II simply returns all excess flow back to s. Note that phase II is unnecessary if you are interested only in the maximum flow value (it will be e(t) at the end of phase I), or in the minimum cut that creates it. Phase2() Applicable: when all active nodes have d(v) n Run backwards DFS from s: if encountered a black node (already marked by DFS): reduce the minimal flow along the circuit from the entire circuit thus breaking it (removed the minimal edge) when done with edge (v, u): reduce e(u) flow on edge (v, u) thus adding to e(v) 5

6 2.7 Active Node Selection Strategy The general run of the algorithm is to use some active node selection strategy and apply the Discharge method to the active nodes until there are no more active nodes v with d(v) < n. We intend to use the HL - Highest Level active node selection strategy. With this strategy, the algorithm has a proven time bound of O(n 2 m) according to [3]. To implement the HL selection efficiently, a few modifications and some extra data structures are needed. We will now describe these. The algorithm will maintain an array actives of size n (there are n possible label values during phase I of the algorithm). actives[i] will be a doubly linked list holding all the active nodes with label i. highest level will hold the current highest level (highest active node label). next levels will be an array of size n. next levels[i] will be next highest level after level i (the index in actives we should turn to when we are done with the active node list in actives[i]). If there is not a second highest level, next levels[i] = i. Initialize() actives = allemptylists highest level = 1 for every i: next levels[i] = i Note that after Initialize() all active nodes are in level 1 so highest level, actives and next levels are initially correct. Selection() While actives[highest level] is not empty: For some node v in actives[highest level] do: Discharge(v) When there are no more active nodes, highest level will remain the last highest level, and actives[highest level] will be an empty list which will make the loop indeed terminate. We will show correctness by induction on the algorithm steps - we will assume by induction that highest level indeed holds the current highest level of any active node, and that actives and next levels are also correct by the definition above. We can see with that assumption, the Discharge (and therefore Push and Relabel) will always operate on some highest level active node. It remains only to see that Push and Relabel correctly update highest level, actives and next levels (as to prove the induction step). We will add to the Relabel method - 6

7 Relabel(v) remove v from actives[highest level] if d(v) < n: add v to actives[d(v)] if actives[highest level] is now empty: next levels[d(v)] = next levels[highest level] else: next levels[d(v)] = highest level highest level = d(v) else: if actives[highest level] is now empty: highest level = next levels[highest level] Obviously if v was active before Relabel, then it remains active afterwards (only the label changes). So v is updated into the correct list in actives. If we assume highest level used to be the highest level of active nodes and since d(v) > highest level (Relabel strictly increases labels, see [1]), then there are no other active nodes with label between highest level and d(v). Therefore it is easy to see that next levels is updated correctly. It also entails that d(v) is the new highest level. We will add to the Push method - Push(v, e = (v, u)) if e(u) < 0 then u previously not active = true if u previously not active = true and e(u) > 0: add u to actives[highest level 1] next levels[highest level] = highest level 1 if e(v) = 0: remove v from actives[highest level] if actives[highest level] is now empty: highest level = next levels[highest level] From the definition of when Push is applicable, we see that d(v) = highest level and d(u) = highest level 1. If u becomes active during a push into u (this is the only way a node can become active) then we update actives[d(u)]. Obviously the second highest level with active nodes will now be highest level 1 (there are no other levels between highest level and highest level 1) and so we update next levels correctly. highest level did not change, as no higher active nodes were created. If v becomes inactive during a push from v (this is the only way a node can become inactive) then we update actives[d(v)]. We 7

8 rely on the inductive correctness of next levels and update highest level to be the next highest level that still has some active nodes. The primary result of this effort, is that we obtain O(1) access to some highest level active node for every discharge, with O(1) update cost at every Push or Relabel operation. This enables us to implement the HL active node selection with minimum cost (and no asymptotic theoretical cost). Notice that h prf code works differently - highest level is updated, but next highest level is not maintained but rather manually searched for by iterating through the levels. This has no asymptotic importance as this costs O(n 2 ) compared to the O(n 2 m) total cost of the algorithm (since we are not implementing this anyhow, no proof is attached). 3 Heuristics 3.1 Global Relabeling Heuristic Overview This heuristic is suggested in [1], [2] and [3], and implemented in h prf (see 1) The Heauristic Every some c m steps of the algorithm run a backwards BFS from t (i.e. find shortest paths from nodes to t rather than vice-versa), and update node labels according to the BFS label. If t is reachable from node v and d is the level BFS assigned to v, then update d(v) = d. For all nodes v from which t is not reachable, assign d(v) = n (so they will be ignored until phase II, see 2.6) Correctness Layout It can be shown that the heuristic does not harm the correctness of the algorithm, since a global relabeling is the same as running a normal relabel operation on all nodes in a certain order (in fact a single relabel is the exact basic step of a BFS) Code We intend to implement this heuristic in our push-relabel implementation. Notice that highest level, actives and next levels will have to be updated during each global relabeling, whenever we encounter a BFS level with active nodes Variation We will run a global relabeling if either of the following applies - 1. c m work (push / relabel) has been done since the last global relabel. 8

9 2. c max flow bound m/n 2 units of flow or more have been added to t since the last global relabel (this is inspired from [2]). max flow bound is a parameter obtainable through the level-cut heuristic (see 3.2). (1) is suggested already in [1]. Since it is performed at most once every O(m) work of the algorithm and performs O(m) work itself, it obviously does not change the asymptotic time bound of the algorithm. (2) is our own variation. In general, max flow bound will always be an n upper bound on maximum flow of the network. Since after at most c m 2 times that (2) is performed, maximum flow has reached t, t is no longer reachable by any active node (otherwise excess could still reach the sink), thus one more global relabeling will cause all active nodes to have label > n and end phase I. Therefore (2) is performed at most O(n 2 / m) times and since every global relabeling takes O(m) time (BFS), we reach a total maximum cost of O(n 2 m) which keeps the algorithm within its asymptotic time bound. 3.2 Level-Cut Heuristic Overview This heuristic generalizes the gap relabeling heuristic suggested in [3], in the sense that it is expected to improve in at least any scenario in which gap relabeling is expected to improve. It is a simple heuristic in concept. Generally described, we maintain a number of certain cut values in G f. We attempt to never push more flow towards t then some minimum cut which blocks us allows, since this flow will never reach t anyhow Intention Hopefully, if we push less extra flow towards t, we will have less flow to push back and try through other paths. This is the heuristic intention. There are easy obvious examples where this heuristic works, such as the one below, but it is not clear how it performs in practice. In the example in Figure 1, a is the only active node. We can see clearly that normally we would push 2 units of flow towards t, then push back 1 unit of flow from c back to a. We will see that with the level-cut heuristic, the cut of {a, b, c} {d, f} is recognized as a cut with cut value = 1, and therefore only 1 unit of flow will be pushed all the way to t, and no flow will be pushed back from c to a, thus saving unnecessary pushes Gap Relabeling Heuristic In gap relabeling heuristic we maintain an array A of size n, holding in A[i] the number of nodes for each label (up to n). If a label d is found, such that A[d] = 0, then all nodes with label > d are relabeled to label n. This is due to 9

10 Figure 1: Level Cut Heuristic Example the observation that t is unreachable from all such nodes (see proof in 7.1). Let S + d be the set of nodes with label d (which includes the source), and S d the set of nodes with label < d (which includes the sink), for any 0 < d < n. To see how our heuristic generalizes the gap relabeling heuristic, we need only to note that whenever the gap relabeling heuristic applies to level d (i.e. A[d] = 0), (S + d, S d ) is a cut in G f with cut value = 0 (in fact, in this case, (S + d+1, S d+1 ) will be the same cut). The cut value is 0, since no residual edge exists between S + d and S d with orientation towards S d (a consequent of the proof in 7.1) Code Maintain an array cuts of size n. cuts[i] will be the cut value induced by the cut (S + i, S i ) in G f. Also maintain an array min cuts of size n. min cuts[i] will be min j i {cuts[j]}. For any node v with d(v) = i, v S + j for any j i. Therefore the amount of flow that v further pushes that can actually reach t is limited by any of the cuts (S + j, S j ) such that j i. Therefore it is limited by min cuts[i]. We use this information to make the following modification to Push. Push(v, e = (v, u)) if min cuts[d(v)] < c f (e): c(e) = min cuts[d(v)] + f(e) update c f (e) by definition // = min cuts[d(v)] 10

11 To deal with nodes that have been blocked out by cuts from reaching t, but are stuck with excess that will return to s during phase II, we add the following adjustments. Relabel(v) if v has no edges: d(v) = n Phase2() restore all original capacities of residual edges In addition, to imitate the effects of gap relabeling (and more), we can add Discharge(v) if min cuts[d(v)] = 0: d(v) = n For a general understanding, it suffices to say that changing the capacities alters the attempts to push flow towards t, preventing us from pushing unnecessary excess flow towards t, that would have otherwise never reached it because of the minimum cut. However, to enable the excess flow to later return to s, we must keep active nodes until phase II before which we will restore all original capacities to enable the excess to return to s. Note that even without the addition to Discharge, a node v with min cuts[d(v)] = 0 would not have pushed any flow at any rate. However, this check saves the iteration through its edges Correctness Layout For an attempt at a full proof of correctness, we follow the proof of push-relabel in [1] lemma The sections that invalidate are Theorem 3.4 and lemma 3.5 (and consequently 3.7). Lemma 3.5 is irrelevant when we use the two phase variant of push-relabel as A.V. Goldberg does in h prf code, and lemma 3.7 (all labels < n) becomes immediate and does not require lemma 3.5. We will show the correctness of Theorem 3.4 (the terminating flow is maximal). Like the correctness of the algorithm without the level-cut heuristic, when phase I terminates all nodes that can reach t have 0 excess and therefore the flow is maximal. However, when we use the heuristic, the flow is maximal for the terminating graph which has different capacities than the original graph. We will show that this terminating graph has the same maximal flow, by showing 11

12 that each change of capacity did not change the maximum flow possible in the graph. To see this, let s look at the situation just before the capacity change of edge e at time t 1. Let s define the current flow as the current pre-flow deducted by some flow from s to active nodes that turns it into a legal flow (such a deduction always exists according to the flow decomposition theory of Ford and Falkerson, which is explained in [4] p.752). The maximum flow function for G, must be a sum of the current flow f 1 through G and some extra flow f 2 through G f. This is true in fact for any flow (so all the more for f 1 at time t 1 ) and it is the grounds for using the residual network with augmenting paths for the maximum flow problem. Obviously by definition f 1 (e) < f(e). f 2 (e) is bounded anyhow by the cut in G f that produced min cuts[i], so its bounded f 2 (e) < min cuts[i]. We receive that the capacity is reduced to min cuts[i] + f(e) > f 2 (e) + f 1 (e), so f 1 + f 2 is still a possible flow through G. The residual capacity is reduced to min cuts[i] > f 2 (e), so f 2 is still a possible additive flow through G f at time t Maintaining Minimum Cuts To maintain cuts and min cuts we add the following - Push(v, e = (v, u)) cuts[d(v)] = cuts[d(v)] amount push Discharge(v) if min cuts[d(v)] = 0: d(v) = n next min label(v) = add to cut(v) = 0 For each edge e = (v, u) of v starting from current edge(v): if d(v) = d(u) + 1 then Push(v,e) if e(v) = 0 then break (exit loop) if d(v) < d(u) + 1 then: if d(u) < next min label(v) then do: next min label(v) = d(u) add to cut(v) = 0 else if d(u) = next min label(v) then do: add to cut(v)+ = c f (v, u) if e(v) > 0 then: // otherwise next sweep will continue from current edge(v) current edge(v) = f irst edge(v) Relabel(v) using using next min label(v), add to cut(v) Relabel(v) if min cuts[d(v)] = 0: 12

13 cuts[new label]+ = add to cut for each i in range [old label, new label]: min cuts[i] = min {cuts[i], min cuts[i 1]} Obviously the push operation maintains cuts[i] correctly. The Relabel operation can add several edges to the cut in the new level it is moved to. However the total residual capacity of these edges can be pre-calculated when going through all the edges of v in the Discharge method. So cuts[i] is updated here correctly as well. min cuts[i] is only updated whenever a Relabel operation elevates a node to a level higher than i. Since we always work on the highest level active node, we will not access min cuts[i] before some active node elevated above i, an operation which would update min cuts. More so, while the highest level > i, min cuts[i] will remain correct since changes to cuts[j] with j > i do not effect min cuts[i]. A simpler update to cuts and min cuts should be inserted into GlobalRelabel() as well A Maximum Flow Bound For Global Relabeling If we maintain also a lowest level (like in the h prf implementation), then an easy estimate for max flow bound used in the global relabeling heuristic can be - max flow bound = min {min cuts[lowest level] + e(t), {e(v) v is active} + e(t)} (the maximum flow is the excess that t already contains + the maximum flow from all active nodes which is bounded by the minimum cut that contains all of them or their own total excess). Notice the second argument to the minimum remains a constant during the algorithm (in fact it is the sum of s s edge capacities). 3.3 Timestamp Heuristic Overview This heuristic is rather simple. Keep a timestamp during the algorithm - it will be a counter, which will advance by one in every push. Every edge will have the timestamp of its last push (an edge and anti-edge will share the same timestamp). Keep the adjacency list of nodes sorted by the timestamp, from smallest (oldest) to biggest (newest), and so Discharge will go through the edges of a node in that order. Note that to maintain correctness we will change the order of a node s edges only once a full sweep on its edges has been completed Intention When flow pushed towards t is blocked by a saturated edge, it is naturally pushed back to search for other routes. However, this push back process can be ineffective resulting in many back and forth flow pushes on the same edges before the flow reaches another path. For example look at Figure 2-13

14 Figure 2: Timestamp Heuristic Example d is the only active node with e(d) = 4. Let s assume a worst case order of each node s edges in its adjacency list - b s edges are ordered ((b, c), (b, a)) c s edges are ordered ((c, d), (c, b)) d s edges are ordered ((d, t), (d, c)) Now if we follow the Discharge operations and always make sure to go through edges in the above order. Flow will pushed to c, then back to d, then back to c, then back to b, back to c, back to d, back to c, back to b, back to a. We receive a total of 9 push operations before the excess of 4 reaches node a (and it becomes active). If we use a timestamp and always turn first to the edge least recently used, we receive only 3 push operations before the excess reaches node a Correctness Layout The order in which we perform each sweep on a node s edges in the Discharge method is a degree of freedom in the generic push-relabel algorithm. It therefore does not harm its correctness Code We will keep 2 adjacency lists for each node v, which will keep references to the same edges only in a different order. One will be v s current edge list. The other will be v s next edge list. After completion of a sweep, we will swap between the lists. Discharge(v) if e(v) > 0 then: 14

15 swap v s edge lists current edge(v) = first edge(v) in the new list Push(v, e = (v, u)) move (v, u) to end of v s next edge list move (u, v) to end of u s next edge list Since the global timestamp always strictly increases, it is in fact (a little surprisingly) not necessary at all to maintain an actual timestamp. Moving the edge and anti-edge to the end of the list, keeps the edge list in timestamp order without actually knowing the timestamp itself. 4 Implementation Details We will implement the code in C++, using Visual Studio IDE. We will require two general structures/classes - PushRelabel - implementing the push-relabel algorithm with all the methods shown in sections 2 and 3. ResidualGraph - a structure to hold the residual graph and read it from input. 5 Graphs And Work Plan We intend to run on precisely the same graph families as in [3], so that our results will be as comparable as possible. These are - 1. Genrmf-Long graphs, generated by the genrmf.c program. 2. Genrmf-Wide graphs. generated by the genrmf.c program. 3. Washington-RLG-Long graphs generated by the washington.c program. 4. Washington-RLG-Wide graphs, generated by the washington.c program. 5. Washington-Line-Moderate graphs, generated by the washington.c program. 6. Acyclic-Dense graphs generated by the ac.c program. 7. AK graphs, generated by the ak.c program. All programs are described in synthetic.htm and available in The programs take a seed as a parameter, so we will save the seeds with the results to make them traceable. For exact running parameters, see [3]

16 We intend to run on all graphs in 9 modes, measuring running time for each. Each mode will be one of the Cartesian product of {globalrelabeling, globalrelabelingwithvariation} {cut levelheuristic, nocut levelheuristic} {timestampheuristic, notimestampheuristic}. 6 Testing Plan We intend to test our code against the h prf code. We will verify legal flow in the output and also compare the maximal flow value with the h prf output. This way we will ensure correct maximal flow - the flow will be legal due to the first check, and maximal because it will be the same as h prf flow value. We will run this test on all input graphs. 7 Appendix 7.1 Correctness Of Gap Relabeling Lemma 7.1 If a gap exists in the node labels between label L 1 and label L 2 such that L 1 L 2 2 (i.e. any node v has d(v) L 1 or d(v) L 2 ), then there cannot be any edge (u, v) such that d(u) L 2 and d(v) L 1. Proof: Lets assume in contradiction there is such an edge (u, v). Lets look at the time t 2 in which this edge (u, v) exists and crosses the gap. Labels strictly increase, so we will note that (*) d(v) L 1 during all the run of the algorithm until and including t 2. At the point t 1 < t 2 when u was first relabeled to a label L 2, (u, v) could not have existed since otherwise d(u) would have been at most d(v) + 1 L L 2 1 < L 2. So (u, v) did not exist at the point t 1 < t 2. But since at point t 1 (u, v) exists again, it must have been re-entered into G f by adding flow to the anti-edge (v, u). Therefore flow was pushed on (v, u) sometime before t 1 and therefore d(v) = d(u) + 1 since we only push flow one level down. But this concludes that d(v) = d(u) + 1 L > L 1 which is a contradiction to (*). References [1] A. V. Goldberg and R. E. Tarjan. A New Approach to the Maximum Flow Problem. In Proc. 18th Annual ACM Symposium on Theory of Computing, pages , [2] A. V. Goldberg and R. Kennedy, Global Price Updates Help. SIAM Journal of Discrete Mathematics, Vol. 10, pages , [3] B. V. Cherkassky and A. V. Goldberg, On Implementing Push-Relabel Method for the Maximum Flow Problem. Algorithmica, Vol. 19, pages ,

17 [4] R. K. Ahuja; James B. Orlin, A Fast and Simple Algorithm for the Maximum Flow Problem. Operations Research, Vol. 37, No. 5. (Sep. - Oct., 1989), pp

1 Introduction. 2 The Generic Push-Relabel Algorithm. Improvements on the Push-Relabel Method: Excess Scaling. 2.1 Definitions CMSC 29700

1 Introduction. 2 The Generic Push-Relabel Algorithm. Improvements on the Push-Relabel Method: Excess Scaling. 2.1 Definitions CMSC 29700 CMSC 9700 Supervised Reading & Research Week 6: May 17, 013 Improvements on the Push-Relabel Method: Excess Scaling Rahul Mehta 1 Introduction We now know about both the methods based on the idea of Ford

More information

Lecture 4. 1 Overview. 2 Preflows. COMPSCI 532: Design and Analysis of Algorithms September 4, 2015

Lecture 4. 1 Overview. 2 Preflows. COMPSCI 532: Design and Analysis of Algorithms September 4, 2015 COMPSCI 532: Design and Analysis of Algorithms September 4, 2015 Lecture 4 Lecturer: Debmalya Panigrahi Scribe: Allen Xiao 1 Overview In this lecture we will introduce the current fastest strongly polynomial

More information

CS261: Problem Set #1

CS261: Problem Set #1 CS261: Problem Set #1 Due by 11:59 PM on Tuesday, April 21, 2015 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Turn in your solutions by

More information

Today. Maximum flow. Maximum flow. Problem

Today. Maximum flow. Maximum flow. Problem 5 Maximum Flow (slides 1 4) Today Maximum flow Algorithms and Networks 2008 Maximum flow problem Applications Briefly: Ford-Fulkerson; min cut max flow theorem Preflow push algorithm Lift to front algorithm

More information

Solution for Homework set 3

Solution for Homework set 3 TTIC 300 and CMSC 37000 Algorithms Winter 07 Solution for Homework set 3 Question (0 points) We are given a directed graph G = (V, E), with two special vertices s and t, and non-negative integral capacities

More information

Shortest Path Problem

Shortest Path Problem Shortest Path Problem CLRS Chapters 24.1 3, 24.5, 25.2 Shortest path problem Shortest path problem (and variants) Properties of shortest paths Algorithmic framework Bellman-Ford algorithm Shortest paths

More information

LECTURES 3 and 4: Flows and Matchings

LECTURES 3 and 4: Flows and Matchings LECTURES 3 and 4: Flows and Matchings 1 Max Flow MAX FLOW (SP). Instance: Directed graph N = (V,A), two nodes s,t V, and capacities on the arcs c : A R +. A flow is a set of numbers on the arcs such that

More information

Network Design and Optimization course

Network Design and Optimization course Effective maximum flow algorithms Modeling with flows Network Design and Optimization course Lecture 5 Alberto Ceselli alberto.ceselli@unimi.it Dipartimento di Tecnologie dell Informazione Università degli

More information

16.1 Maximum Flow Definitions

16.1 Maximum Flow Definitions 5-499: Parallel Algorithms Lecturer: Guy Blelloch Topic: Graphs IV Date: March 5, 009 Scribe: Bobby Prochnow This lecture describes both sequential and parallel versions of a maximum flow algorithm based

More information

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching

Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching Reducing Directed Max Flow to Undirected Max Flow and Bipartite Matching Henry Lin Division of Computer Science University of California, Berkeley Berkeley, CA 94720 Email: henrylin@eecs.berkeley.edu Abstract

More information

arxiv: v2 [cs.ds] 9 Apr 2009

arxiv: v2 [cs.ds] 9 Apr 2009 Pairing Heaps with Costless Meld arxiv:09034130v2 [csds] 9 Apr 2009 Amr Elmasry Max-Planck Institut für Informatik Saarbrücken, Germany elmasry@mpi-infmpgde Abstract Improving the structure and analysis

More information

instead of waiting till hit sink to augment, augment a s a d v ance augment ( v w ) amount is min of ow r e a c hing v and (v w ) \unaugment" when ret

instead of waiting till hit sink to augment, augment a s a d v ance augment ( v w ) amount is min of ow r e a c hing v and (v w ) \unaugment when ret Makeup 3:30{5 on 10/15 1 Push-Relabel Goldberg Tarjan. (earlier work by Karzanov, Dinic) Two \improvements" on blocking ows: be lazy: update distance labels only when necessary make y our work count: instead

More information

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang

/ Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: Linear Programming Date: 2/24/15 Scribe: Runze Tang 9.1 Linear Programming Suppose we are trying to approximate a minimization

More information

Lecture 3: Graphs and flows

Lecture 3: Graphs and flows Chapter 3 Lecture 3: Graphs and flows Graphs: a useful combinatorial structure. Definitions: graph, directed and undirected graph, edge as ordered pair, path, cycle, connected graph, strongly connected

More information

Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs

Lecture 10,11: General Matching Polytope, Maximum Flow. 1 Perfect Matching and Matching Polytope on General Graphs CMPUT 675: Topics in Algorithms and Combinatorial Optimization (Fall 2009) Lecture 10,11: General Matching Polytope, Maximum Flow Lecturer: Mohammad R Salavatipour Date: Oct 6 and 8, 2009 Scriber: Mohammad

More information

Matching Theory. Figure 1: Is this graph bipartite?

Matching Theory. Figure 1: Is this graph bipartite? Matching Theory 1 Introduction A matching M of a graph is a subset of E such that no two edges in M share a vertex; edges which have this property are called independent edges. A matching M is said to

More information

CSE 417 Network Flows (pt 4) Min Cost Flows

CSE 417 Network Flows (pt 4) Min Cost Flows CSE 417 Network Flows (pt 4) Min Cost Flows Reminders > HW6 is due Monday Review of last three lectures > Defined the maximum flow problem find the feasible flow of maximum value flow is feasible if it

More information

Practical Session No. 12 Graphs, BFS, DFS, Topological sort

Practical Session No. 12 Graphs, BFS, DFS, Topological sort Practical Session No. 12 Graphs, BFS, DFS, Topological sort Graphs and BFS Graph G = (V, E) Graph Representations (V G ) v1 v n V(G) = V - Set of all vertices in G E(G) = E - Set of all edges (u,v) in

More information

An Eternal Domination Problem in Grids

An Eternal Domination Problem in Grids Theory and Applications of Graphs Volume Issue 1 Article 2 2017 An Eternal Domination Problem in Grids William Klostermeyer University of North Florida, klostermeyer@hotmail.com Margaret-Ellen Messinger

More information

Search: Advanced Topics and Conclusion

Search: Advanced Topics and Conclusion Search: Advanced Topics and Conclusion CPSC 322 Lecture 8 January 24, 2007 Textbook 2.6 Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 1 Lecture Overview 1 Recap 2 Branch & Bound 3 A

More information

and 6.855J March 6, Maximum Flows 2

and 6.855J March 6, Maximum Flows 2 5.08 and.855j March, 00 Maximum Flows Network Reliability Communication Network What is the maximum number of arc disjoint paths from s to t? How can we determine this number? Theorem. Let G = (N,A) be

More information

Preflow-Push Algorithm

Preflow-Push Algorithm Preflow-Push Algorithm An s-t preflow obeys the following constraints: Capacity constraints: 0 f(e) c(e) e f (v) = f (u,v) f (v,w) 0 u V w V A labeling h assigns nonnegative integers to vertices. h(t)

More information

CSE 5311 Notes 9: Maximum Flows

CSE 5311 Notes 9: Maximum Flows CSE 5311 Notes 9: Maximum Flows (Last updated 3/1/17 1:8 PM) Goldberg and Tarjan, http://dl.acm.org.ezproxy.uta.edu/citation.cfm?doid=63661.68036 CLRS, Chapter 6 FORD-FULKERSON (review) Network Flow Concepts:

More information

Problem Set 2 Solutions

Problem Set 2 Solutions Problem Set 2 Solutions Graph Theory 2016 EPFL Frank de Zeeuw & Claudiu Valculescu 1. Prove that the following statements about a graph G are equivalent. - G is a tree; - G is minimally connected (it is

More information

These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions.

These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions. CSE 591 HW Sketch Sample Solutions These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions. Problem 1 (a) Any

More information

Lecture and notes by: Sarah Fletcher and Michael Xu November 3rd, Multicommodity Flow

Lecture and notes by: Sarah Fletcher and Michael Xu November 3rd, Multicommodity Flow Multicommodity Flow 1 Introduction Suppose we have a company with a factory s and a warehouse t. The quantity of goods that they can ship from the factory to the warehouse in a given time period is limited

More information

Tutorial for Algorithm s Theory Problem Set 5. January 17, 2013

Tutorial for Algorithm s Theory Problem Set 5. January 17, 2013 Tutorial for Algorithm s Theory Problem Set 5 January 17, 2013 Exercise 1: Maximum Flow Algorithms Consider the following flow network: a) Solve the maximum flow problem on the above network by using the

More information

Minimum Cost Edge Disjoint Paths

Minimum Cost Edge Disjoint Paths Minimum Cost Edge Disjoint Paths Theodor Mader 15.4.2008 1 Introduction Finding paths in networks and graphs constitutes an area of theoretical computer science which has been highly researched during

More information

Matchings. Saad Mneimneh

Matchings. Saad Mneimneh Matchings Saad Mneimneh 1 Stable matching Consider n men and n women. A matching is a one to one correspondence between the men and the women. In finding a matching, however, we would like to respect the

More information

Heap-on-Top Priority Queues. March Abstract. We introduce the heap-on-top (hot) priority queue data structure that combines the

Heap-on-Top Priority Queues. March Abstract. We introduce the heap-on-top (hot) priority queue data structure that combines the Heap-on-Top Priority Queues Boris V. Cherkassky Central Economics and Mathematics Institute Krasikova St. 32 117418, Moscow, Russia cher@cemi.msk.su Andrew V. Goldberg NEC Research Institute 4 Independence

More information

Sources for this lecture 2. Shortest paths and minimum spanning trees

Sources for this lecture 2. Shortest paths and minimum spanning trees S-72.2420 / T-79.5203 Shortest paths and minimum spanning trees 1 S-72.2420 / T-79.5203 Shortest paths and minimum spanning trees 3 Sources for this lecture 2. Shortest paths and minimum spanning trees

More information

Formally-Proven Kosaraju s algorithm

Formally-Proven Kosaraju s algorithm Formally-Proven Kosaraju s algorithm Laurent Théry Laurent.Thery@sophia.inria.fr Abstract This notes explains how the Kosaraju s algorithm that computes the strong-connected components of a directed graph

More information

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel Alexander Shekhovtsov and Václav Hlaváč shekhole@fel.cvut.cz hlavac@fel.cvut.cz Czech Technical University in Prague

More information

Maximum Flow Algorithms

Maximum Flow Algorithms Maximum Flow Algorithms Network Algorithms Georgia Kaouri Contents Applications, special cases Flow networks Ford Fulkerson algorithm Preflow push algorithms Lift to front algorithm Material flows Applications

More information

Analyze the obvious algorithm, 5 points Here is the most obvious algorithm for this problem: (LastLargerElement[A[1..n]:

Analyze the obvious algorithm, 5 points Here is the most obvious algorithm for this problem: (LastLargerElement[A[1..n]: CSE 101 Homework 1 Background (Order and Recurrence Relations), correctness proofs, time analysis, and speeding up algorithms with restructuring, preprocessing and data structures. Due Thursday, April

More information

SEQUENTIAL AND PARALLEL ALGORITHMS FOR MINIMUM FLOWS

SEQUENTIAL AND PARALLEL ALGORITHMS FOR MINIMUM FLOWS J. Appl. Math. & Computing Vol. 15(2004), No. 1-2, pp. 53-75 SEQUENTIAL AND PARALLEL ALGORITHMS FOR MINIMUM FLOWS ELEONOR CIUREA AND LAURA CIUPALĂ Abstract. First, we present two classes of sequential

More information

22 Elementary Graph Algorithms. There are two standard ways to represent a

22 Elementary Graph Algorithms. There are two standard ways to represent a VI Graph Algorithms Elementary Graph Algorithms Minimum Spanning Trees Single-Source Shortest Paths All-Pairs Shortest Paths 22 Elementary Graph Algorithms There are two standard ways to represent a graph

More information

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0).

V1.0: Seth Gilbert, V1.1: Steven Halim August 30, Abstract. d(e), and we assume that the distance function is non-negative (i.e., d(x, y) 0). CS4234: Optimisation Algorithms Lecture 4 TRAVELLING-SALESMAN-PROBLEM (4 variants) V1.0: Seth Gilbert, V1.1: Steven Halim August 30, 2016 Abstract The goal of the TRAVELLING-SALESMAN-PROBLEM is to find

More information

Fundamental Graph Algorithms Part Four

Fundamental Graph Algorithms Part Four Fundamental Graph Algorithms Part Four Announcements Problem Set One due right now. Due Friday at 2:15PM using one late period. Problem Set Two out, due next Friday, July 12 at 2:15PM. Play around with

More information

Search: Advanced Topics and Conclusion

Search: Advanced Topics and Conclusion Search: Advanced Topics and Conclusion CPSC 322 Lecture 8 January 20, 2006 Textbook 2.6 Search: Advanced Topics and Conclusion CPSC 322 Lecture 8, Slide 1 Lecture Overview Recap Branch & Bound A Tricks

More information

Lecture 3: Art Gallery Problems and Polygon Triangulation

Lecture 3: Art Gallery Problems and Polygon Triangulation EECS 396/496: Computational Geometry Fall 2017 Lecture 3: Art Gallery Problems and Polygon Triangulation Lecturer: Huck Bennett In this lecture, we study the problem of guarding an art gallery (specified

More information

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel

A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and Push-Relabel Author s freely distributed eddition. The final publication is available at http://www.springer.com Int J Comput Vis DOI:.7/s63--57- A Distributed Mincut/Maxflow Algorithm Combining Path Augmentation and

More information

g(s, w) g(w, s) (in gross model).

g(s, w) g(w, s) (in gross model). 1 Maximum Flow 1.1 Definitions Tarjan: Data Structures and Network Algorithms Ford and Fulkerson, Flows in Networks, 1962 (paper 1956) Ahuja, Magnanti, Orlin Network Flows. Problem: do min-cost. Problem:

More information

CS261: A Second Course in Algorithms Lecture #3: The Push-Relabel Algorithm for Maximum Flow

CS261: A Second Course in Algorithms Lecture #3: The Push-Relabel Algorithm for Maximum Flow CS26: A Second Course in Algorithms Lecture #3: The Push-Relabel Algorithm for Maximum Flow Tim Roughgarden January 2, 206 Motivation The maximum flow algorithms that we ve studied so far are augmenting

More information

Sublinear-Time Parallel Algorithms. for Matching and Related Problems. Andrew V. Goldberg y. Stanford University. Stanford, CA 94305

Sublinear-Time Parallel Algorithms. for Matching and Related Problems. Andrew V. Goldberg y. Stanford University. Stanford, CA 94305 Sublinear-Time Parallel Algorithms for Matching and Related Problems Andrew V. Goldberg y Department of Computer Science Stanford University Stanford, CA 94305 Serge A. Plotkin z Department of Computer

More information

Scribe from 2014/2015: Jessica Su, Hieu Pham Date: October 6, 2016 Editor: Jimmy Wu

Scribe from 2014/2015: Jessica Su, Hieu Pham Date: October 6, 2016 Editor: Jimmy Wu CS 267 Lecture 3 Shortest paths, graph diameter Scribe from 2014/2015: Jessica Su, Hieu Pham Date: October 6, 2016 Editor: Jimmy Wu Today we will talk about algorithms for finding shortest paths in a graph.

More information

Introduction to Graph Theory

Introduction to Graph Theory Introduction to Graph Theory Tandy Warnow January 20, 2017 Graphs Tandy Warnow Graphs A graph G = (V, E) is an object that contains a vertex set V and an edge set E. We also write V (G) to denote the vertex

More information

Network Flow. The network flow problem is as follows:

Network Flow. The network flow problem is as follows: Network Flow The network flow problem is as follows: Given a connected directed graph G with non-negative integer weights, (where each edge stands for the capacity of that edge), and two distinguished

More information

Heuristic Search and Advanced Methods

Heuristic Search and Advanced Methods Heuristic Search and Advanced Methods Computer Science cpsc322, Lecture 3 (Textbook Chpt 3.6 3.7) May, 15, 2012 CPSC 322, Lecture 3 Slide 1 Course Announcements Posted on WebCT Assignment1 (due on Thurs!)

More information

Lecture 3: Totally Unimodularity and Network Flows

Lecture 3: Totally Unimodularity and Network Flows Lecture 3: Totally Unimodularity and Network Flows (3 units) Outline Properties of Easy Problems Totally Unimodular Matrix Minimum Cost Network Flows Dijkstra Algorithm for Shortest Path Problem Ford-Fulkerson

More information

COMP 182: Algorithmic Thinking Prim and Dijkstra: Efficiency and Correctness

COMP 182: Algorithmic Thinking Prim and Dijkstra: Efficiency and Correctness Prim and Dijkstra: Efficiency and Correctness Luay Nakhleh 1 Prim s Algorithm In class we saw Prim s algorithm for computing a minimum spanning tree (MST) of a weighted, undirected graph g. The pseudo-code

More information

Approximability Results for the p-center Problem

Approximability Results for the p-center Problem Approximability Results for the p-center Problem Stefan Buettcher Course Project Algorithm Design and Analysis Prof. Timothy Chan University of Waterloo, Spring 2004 The p-center

More information

Detecting negative cycles with Tarjan s breadth-first scanning algorithm

Detecting negative cycles with Tarjan s breadth-first scanning algorithm Detecting negative cycles with Tarjan s breadth-first scanning algorithm Tibor Ásványi asvanyi@inf.elte.hu ELTE Eötvös Loránd University Faculty of Informatics Budapest, Hungary Abstract The Bellman-Ford

More information

Two-Level Push-Relabel Algorithm for the Maximum Flow Problem

Two-Level Push-Relabel Algorithm for the Maximum Flow Problem Two-Level Push-Relabel Algorithm for the Maximum Flow Problem Andrew V. Goldberg Microsoft Research Silicon Valley 1065 La Avenida, Mountain View, CA 94062. goldberg@microsoft.com Abstract. We describe

More information

Cuckoo Hashing for Undergraduates

Cuckoo Hashing for Undergraduates Cuckoo Hashing for Undergraduates Rasmus Pagh IT University of Copenhagen March 27, 2006 Abstract This lecture note presents and analyses two simple hashing algorithms: Hashing with Chaining, and Cuckoo

More information

arxiv: v2 [cs.dm] 28 Dec 2010

arxiv: v2 [cs.dm] 28 Dec 2010 Multiple-source multiple-sink maximum flow in planar graphs Yahav Nussbaum arxiv:1012.4767v2 [cs.dm] 28 Dec 2010 Abstract In this paper we show an O(n 3/2 log 2 n) time algorithm for finding a maximum

More information

Sequential and parallel deficit scaling algorithms for minimum flow in bipartite networks

Sequential and parallel deficit scaling algorithms for minimum flow in bipartite networks Sequential and parallel deficit scaling algorithms for minimum flow in bipartite networks LAURA CIUPALĂ Department of Computer Science University Transilvania of Braşov Iuliu Maniu Street 50, Braşov ROMANIA

More information

FOUR EDGE-INDEPENDENT SPANNING TREES 1

FOUR EDGE-INDEPENDENT SPANNING TREES 1 FOUR EDGE-INDEPENDENT SPANNING TREES 1 Alexander Hoyer and Robin Thomas School of Mathematics Georgia Institute of Technology Atlanta, Georgia 30332-0160, USA ABSTRACT We prove an ear-decomposition theorem

More information

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn

Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn Chapter 5 Graph Algorithms Algorithm Theory WS 2012/13 Fabian Kuhn Graphs Extremely important concept in computer science Graph, : node (or vertex) set : edge set Simple graph: no self loops, no multiple

More information

An O(n 2.75 ) algorithm for online topological ordering 1

An O(n 2.75 ) algorithm for online topological ordering 1 Electronic Notes in Discrete Mathematics 25 (2006) 7 12 www.elsevier.com/locate/endm An O(n 2.75 ) algorithm for online topological ordering 1 Deepak Ajwani a,2, Tobias Friedrich a and Ulrich Meyer a a

More information

Algorithms for Minimum Spanning Trees

Algorithms for Minimum Spanning Trees Algorithms & Models of Computation CS/ECE, Fall Algorithms for Minimum Spanning Trees Lecture Thursday, November, Part I Algorithms for Minimum Spanning Tree Sariel Har-Peled (UIUC) CS Fall / 6 Sariel

More information

Network Flows. 1. Flows deal with network models where edges have capacity constraints. 2. Shortest paths deal with edge costs.

Network Flows. 1. Flows deal with network models where edges have capacity constraints. 2. Shortest paths deal with edge costs. Network Flows. Flows deal with network models where edges have capacity constraints. 2. Shortest paths deal with edge costs. 4 u v 2 5 s 6 5 t 4 x 2 y 3 3. Network flow formulation: A network G = (V, E).

More information

ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED NETWORK

ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED NETWORK ON THE IMPLEMENTATION OF GOLDBERG'S MAXIMUM FLOW ALGORITHM IN EXTENDED MIXED NETWORK Nguyen Dinh Lau 1, Tran Quoc Chien 1, Phan Phu Cuong 2 and Le Hong Dung 3 1 University of Danang, Danang, Vietnam 2

More information

Chordal Graphs: Theory and Algorithms

Chordal Graphs: Theory and Algorithms Chordal Graphs: Theory and Algorithms 1 Chordal graphs Chordal graph : Every cycle of four or more vertices has a chord in it, i.e. there is an edge between two non consecutive vertices of the cycle. Also

More information

Practical Session No. 12 Graphs, BFS, DFS Topological Sort

Practical Session No. 12 Graphs, BFS, DFS Topological Sort Practical Session No. 12 Graphs, BFS, DFS Topological Sort Graphs and BFS Graph G = (V, E) Graph Representations (VG ) v1 v n V(G) = V - Set of all vertices in G E(G) = E - Set of all edges (u,v) in G,

More information

Clustering Using Graph Connectivity

Clustering Using Graph Connectivity Clustering Using Graph Connectivity Patrick Williams June 3, 010 1 Introduction It is often desirable to group elements of a set into disjoint subsets, based on the similarity between the elements in the

More information

Acyclic Edge Colorings of Graphs

Acyclic Edge Colorings of Graphs Acyclic Edge Colorings of Graphs Noga Alon Ayal Zaks Abstract A proper coloring of the edges of a graph G is called acyclic if there is no 2-colored cycle in G. The acyclic edge chromatic number of G,

More information

The Join the Club Interpretation of Some. Graph Algorithms

The Join the Club Interpretation of Some. Graph Algorithms The Join the Club Interpretation of Some Graph Algorithms Harold Reiter Isaac Sonin June 8, 2000 Abstract Several important tree construction algorithms of graph theory are described and discussed using

More information

CMPSCI 311: Introduction to Algorithms Practice Final Exam

CMPSCI 311: Introduction to Algorithms Practice Final Exam CMPSCI 311: Introduction to Algorithms Practice Final Exam Name: ID: Instructions: Answer the questions directly on the exam pages. Show all your work for each question. Providing more detail including

More information

Faster Algorithms for Constructing Recovery Trees Enhancing QoP and QoS

Faster Algorithms for Constructing Recovery Trees Enhancing QoP and QoS Faster Algorithms for Constructing Recovery Trees Enhancing QoP and QoS Weiyi Zhang, Guoliang Xue Senior Member, IEEE, Jian Tang and Krishnaiyan Thulasiraman, Fellow, IEEE Abstract Médard, Finn, Barry

More information

CS161 Handout 07 Summer 2013 July 17, 2013 Guide to Reductions. Thanks to Julie Tibshirani for helping with this handout!

CS161 Handout 07 Summer 2013 July 17, 2013 Guide to Reductions. Thanks to Julie Tibshirani for helping with this handout! CS161 Handout 07 Summer 2013 July 17, 2013 Guide to Reductions Thanks to Julie Tibshirani for helping with this handout! We'll design many algorithms over the course of this class. Often, the algorithms

More information

The Encoding Complexity of Network Coding

The Encoding Complexity of Network Coding The Encoding Complexity of Network Coding Michael Langberg Alexander Sprintson Jehoshua Bruck California Institute of Technology Email: mikel,spalex,bruck @caltech.edu Abstract In the multicast network

More information

On the Complexity of the Policy Improvement Algorithm. for Markov Decision Processes

On the Complexity of the Policy Improvement Algorithm. for Markov Decision Processes On the Complexity of the Policy Improvement Algorithm for Markov Decision Processes Mary Melekopoglou Anne Condon Computer Sciences Department University of Wisconsin - Madison 0 West Dayton Street Madison,

More information

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting

CS2 Algorithms and Data Structures Note 10. Depth-First Search and Topological Sorting CS2 Algorithms and Data Structures Note 10 Depth-First Search and Topological Sorting In this lecture, we will analyse the running time of DFS and discuss a few applications. 10.1 A recursive implementation

More information

A Combined BIT and TIMESTAMP Algorithm for. the List Update Problem. Susanne Albers, Bernhard von Stengel, Ralph Werchner

A Combined BIT and TIMESTAMP Algorithm for. the List Update Problem. Susanne Albers, Bernhard von Stengel, Ralph Werchner A Combined BIT and TIMESTAMP Algorithm for the List Update Problem Susanne Albers, Bernhard von Stengel, Ralph Werchner International Computer Science Institute, 1947 Center Street, Berkeley, CA 94704,

More information

Parametric Maximum Flow Problem: Techniques and Algorithms. Deepika Sareen, Dr Deepak Garg. Thapar University, Patiala

Parametric Maximum Flow Problem: Techniques and Algorithms. Deepika Sareen, Dr Deepak Garg. Thapar University, Patiala Parametric Maximum Flow Problem: Techniques and Algorithms Deepika Sareen, Dr Deepak Garg Thapar University, Patiala sareendeepika@yahoo.co.in, dgarg@thapar.edu Abstract We encounter many different types

More information

CS261: Problem Set #2

CS261: Problem Set #2 CS261: Problem Set #2 Due by 11:59 PM on Tuesday, February 9, 2016 Instructions: (1) Form a group of 1-3 students. You should turn in only one write-up for your entire group. (2) Submission instructions:

More information

Jessica Su (some parts copied from CLRS / last quarter s notes)

Jessica Su (some parts copied from CLRS / last quarter s notes) 1 Max flow Consider a directed graph G with positive edge weights c that define the capacity of each edge. We can identify two special nodes in G: the source node s and the sink node t. We want to find

More information

All-to-All Communication

All-to-All Communication Network Algorithms All-to-All Communication Thanks to Thomas Locher from ABB Research for basis of slides! Stefan Schmid @ T-Labs, 2011 Repetition Tree: connected graph without cycles Spanning subgraph:

More information

Name: Lirong TAN 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G.

Name: Lirong TAN 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G. 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G. A shortest s-t path is a path from vertex to vertex, whose sum of edge weights is minimized. (b) Give the pseudocode

More information

Compiler Construction 2010/2011 Loop Optimizations

Compiler Construction 2010/2011 Loop Optimizations Compiler Construction 2010/2011 Loop Optimizations Peter Thiemann January 25, 2011 Outline 1 Loop Optimizations 2 Dominators 3 Loop-Invariant Computations 4 Induction Variables 5 Array-Bounds Checks 6

More information

Module 7. Independent sets, coverings. and matchings. Contents

Module 7. Independent sets, coverings. and matchings. Contents Module 7 Independent sets, coverings Contents and matchings 7.1 Introduction.......................... 152 7.2 Independent sets and coverings: basic equations..... 152 7.3 Matchings in bipartite graphs................

More information

CSE 431/531: Analysis of Algorithms. Greedy Algorithms. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo

CSE 431/531: Analysis of Algorithms. Greedy Algorithms. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo CSE 431/531: Analysis of Algorithms Greedy Algorithms Lecturer: Shi Li Department of Computer Science and Engineering University at Buffalo Main Goal of Algorithm Design Design fast algorithms to solve

More information

Lecture #7. 1 Introduction. 2 Dijkstra s Correctness. COMPSCI 330: Design and Analysis of Algorithms 9/16/2014

Lecture #7. 1 Introduction. 2 Dijkstra s Correctness. COMPSCI 330: Design and Analysis of Algorithms 9/16/2014 COMPSCI 330: Design and Analysis of Algorithms 9/16/2014 Lecturer: Debmalya Panigrahi Lecture #7 Scribe: Nat Kell 1 Introduction In this lecture, we will further examine shortest path algorithms. We will

More information

CSE 331: Introduction to Algorithm Analysis and Design Graphs

CSE 331: Introduction to Algorithm Analysis and Design Graphs CSE 331: Introduction to Algorithm Analysis and Design Graphs 1 Graph Definitions Graph: A graph consists of a set of verticies V and a set of edges E such that: G = (V, E) V = {v 0, v 1,..., v n 1 } E

More information

Symmetric Product Graphs

Symmetric Product Graphs Rochester Institute of Technology RIT Scholar Works Theses Thesis/Dissertation Collections 5-20-2015 Symmetric Product Graphs Evan Witz Follow this and additional works at: http://scholarworks.rit.edu/theses

More information

Graph Search. Adnan Aziz

Graph Search. Adnan Aziz Graph Search Adnan Aziz Based on CLRS, Ch 22. Recall encountered graphs several weeks ago (CLRS B.4) restricted our attention to definitions, terminology, properties Now we ll see how to perform basic

More information

Discrete Motion Planning

Discrete Motion Planning RBE MOTION PLANNING Discrete Motion Planning Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering http://users.wpi.edu/~zli11 Announcement Homework 1 is out Due Date - Feb 1 Updated

More information

Hardware versus software

Hardware versus software Logic 1 Hardware versus software 2 In hardware such as chip design or architecture, designs are usually proven to be correct using proof tools In software, a program is very rarely proved correct Why?

More information

On Galvin s Theorem and Stable Matchings. Adam Blumenthal

On Galvin s Theorem and Stable Matchings. Adam Blumenthal On Galvin s Theorem and Stable Matchings by Adam Blumenthal A thesis submitted to the Graduate Faculty of Auburn University in partial fulfillment of the requirements for the Degree of Master of Science

More information

CSE 421 Applications of DFS(?) Topological sort

CSE 421 Applications of DFS(?) Topological sort CSE 421 Applications of DFS(?) Topological sort Yin Tat Lee 1 Precedence Constraints In a directed graph, an edge (i, j) means task i must occur before task j. Applications Course prerequisite: course

More information

W4231: Analysis of Algorithms

W4231: Analysis of Algorithms W4231: Analysis of Algorithms 10/21/1999 Definitions for graphs Breadth First Search and Depth First Search Topological Sort. Graphs AgraphG is given by a set of vertices V and a set of edges E. Normally

More information

A Lock-free Multi-threaded Algorithm for the Maximum Flow Problem

A Lock-free Multi-threaded Algorithm for the Maximum Flow Problem A Lock-free Multi-threaded Algorithm for the Maximum Flow Problem Bo Hong Drexel University, Philadelphia, PA 19104 bohong@coe.drexel.edu Abstract The maximum flow problem is an important graph problem

More information

Domination Cover Pebbling: Structural Results

Domination Cover Pebbling: Structural Results Domination Cover Pebbling: Structural Results arxiv:math.co/0509564 v 3 Sep 005 Nathaniel G. Watson Department of Mathematics Washington University at St. Louis Carl R. Yerger Department of Mathematics

More information

Lecture 7: Asymmetric K-Center

Lecture 7: Asymmetric K-Center Advanced Approximation Algorithms (CMU 18-854B, Spring 008) Lecture 7: Asymmetric K-Center February 5, 007 Lecturer: Anupam Gupta Scribe: Jeremiah Blocki In this lecture, we will consider the K-center

More information

Lecture 11: Maximum flow and minimum cut

Lecture 11: Maximum flow and minimum cut Optimisation Part IB - Easter 2018 Lecture 11: Maximum flow and minimum cut Lecturer: Quentin Berthet 4.4. The maximum flow problem. We consider in this lecture a particular kind of flow problem, with

More information

Lecture 5: Graph algorithms 1

Lecture 5: Graph algorithms 1 DD2458, Problem Solving and Programming Under Pressure Lecture 5: Graph algorithms 1 Date: 2008-10-01 Scribe(s): Mikael Auno and Magnus Andermo Lecturer: Douglas Wikström This lecture presents some common

More information

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings

On the Relationships between Zero Forcing Numbers and Certain Graph Coverings On the Relationships between Zero Forcing Numbers and Certain Graph Coverings Fatemeh Alinaghipour Taklimi, Shaun Fallat 1,, Karen Meagher 2 Department of Mathematics and Statistics, University of Regina,

More information

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi

CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I. Instructor: Shaddin Dughmi CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 14: Combinatorial Problems as Linear Programs I Instructor: Shaddin Dughmi Announcements Posted solutions to HW1 Today: Combinatorial problems

More information

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

More information