Minimum cost spanning tree
|
|
- Eleanor Palmer
- 6 years ago
- Views:
Transcription
1 Minimum cost spanning tree Doctoral course Optimization on graphs - Lecture 2.2 Giovanni Righini January 15 th, 2013
2 Definitions - 1 A graph G = (V,E) is a tree if and only if it is connected and acyclic. Connectivity: for each cut, at least one edge belongs to the tree. Acyclicity: for each cycle, at least one edge does not belong to the tree. Given a G = (V,E) a subset F E is: a forest if it does not contain cycles; a connector if (V,F) is connected; a spanning tree if (V,F) is a tree; a maximal forest if there is no forest containing it.
3 Definitions - 2 A graph G = (V,E) has a spanning tree if and only if it is connected. Given a connected graph G = (V,E), F is a spanning tree if and only if: F is a maximal forest; F is a minimal connector; F is a forest with F = V 1 edges; F is a connector with F = V 1 edges.
4 Definitions - 3 Given a graph G = (V,E) with k connected components, every maximal forest in it has V k edges. It forms a spanning tree in each connected component of G. Every maximal forest is also a maximum cardinality forest. Analogously every connector contains a connector of minimum cardinality.
5 The Minimum Spanning Tree Problem Let G = (V,E) be a connected graph. Let c : E R a cost function. We define F E: c(f) := e F c e Problem (Minimum Spanning Tree Problem). Find a spanning tree of minimum cost in G.
6 Properties Definition. F is a good forest if it belongs to a minimum cost spanning tree. Theorem. Given a good forest F and given an edge e F, F {e} is a good forest if and only if there is a cut C disjoint from F such that e is the edge with minimum cost in C.
7 Proof - 1 Necessity. Let T be a minimum cost spanning tree containing F {e}. Let C be the (unique) cut disjoint from T \{e}. Consider any edge f C. The edge set T = T \{e} {f} is a spanning tree. Since T is optimal, c(t ) c(t ) and then c e c f. Therefore e is an edge of minimum cost in C. C e f F e T*
8 Proof - 2 Sufficiency. Let T be a minimum cost spanning tree containing F. Let P the (unique) path in T between the two endpoints of edge e. P must contain at least one edge f C, where C is a cut disjoint from F. Hence T = T \{f} {e} is also a spanning tree. Since c e c f we have c(t ) c(t ). Then T is also a minimum cost spanning tree. Since F {e} is contained in T, it is a good forest. P e C f F T*
9 A mathematical programming model (A) min z = e E c e x e s.t. e δ(s) x e {0, 1} x e 1 S V (1) e E A cut δ(s) is the subset of edges with one endpoint in S. Constraints 1 impose connectivity. Acyclicity comes for free from cost minimization. Integrality conditions are redundant.
10 The dual model (A) min z = e E c e x e s.t. x e 1 e δ(s) x e 0 S V e E This linear program has a dual. max w = S V y S s.t. y S c e S V:e δ(s) y S 0 e E S V
11 Complementary slackness conditions (A) Primal C.S.C.: x e (c e S V:e δ(s) y S) = 0 e E Dual C.S.C.: y S ( e δ(s) x e 1) = 0 S V The initial primal solution x e = 0 e E is primal infeasible (and super-optimal): all connectivity constraints are violated. The corresponding dual solution y S = 0 S V is dual feasible (and sub-optimal).
12 Another mathematical programming model (B) min z = e E c e x e s.t. e E x e = n 1 (2) e E(S) x e {0, 1} x e S 1 S V (3) e E E(S) is the edge subset of the subgraph induced by S. Constraints 3 impose acyclicity instead of connectivity. Hence we also need constraint 2 to impose connectivity. Integrality conditions are redundant.
13 The dual model (B) min z = e E c e x e s.t. e E x e = n 1 x e ( S 1) e E(S) x e 0 This linear program has a dual: S V e E max w = S V( S 1)y S +(n 1)y V s.t. y S + y V c e S V:e E(S) y S 0 y V free e E S V
14 Complementary slackness conditions (B) Primal C.S.C.: x e (c e + y S y V ) = 0 e E. S V:e E(S) Dual C.S.C.: y V ( e E x e (n 1)) = 0. y S ( S 1 e E(S) x e ) = 0 S V. The initial primal solution x e = 0 e E is primal infeasible (and super-optimal): the cardinality constraint is violated. The initial dual solution y S = y V = 0 S V is dual feasible (and sub-optimal).
15 Algorithms All MSTP algorithms exploit the previous theorem. The idea is to start with an empty (good) forest F and to extend it iteratively with an edge satisfying the theorem requirement, i.e. an edge of minimum cost in a cut C disjoint from F. Different algorithms are obtained by different choices of C. The two most common algorithms are Jarnik (1930), Kruskal (1956), Prim (1957), Dijkstra (1959): C is the cut that separates the connected component including a predefined vertex; Kruskal (1956), Loberman e Weinberger (1957), Prim (1957): C is the cut that separates the two connected components including the endpoints of the minimum cost edge e in a sorted list. Both algorithms can be seen as dual ascent algorithms.
16 Prim algorithm (1957) begin T := ; z:=0; for v:=1 to n do flag[v]:=0; flag[r]:=1; for v:=1 to n do cost[v]:=c[r, v]; pred[v]:=r; for k:=1 to n 1 do mincost:= ; for v:=1 to n do if (flag[v] = 0) and (cost[v] < mincost) then v:=v; mincost:=cost[v]; T :=T {[pred[v], v]}; z:=z + mincost; flag[v] := 1; for v:=1 to n do if (flag[v] = 0) and (c[v, v] < cost[v]) then pred[v] := v; cost[v]:=c[v, v]; end The complexity is O(n 2 ). With 2-heaps it is possible to obtain O(m + log n). With Fibonacci heaps it is possible to obtain O(m+n log n).
17 Kruskal algorithm (1956) begin T := ; z:=0; E:=E; Sort E by non-decreasing edge costs; for v:=1 to n do List[v]:={v}; head[v]:=v; card[v]:=1; while T < n 1 do [u, v]:=argmin e E {c e }; E:=E\{[u, v]}; if (head[u] head[v]) then T :=T {[u, v]}; z:=z + c[u, v]; if (card[v] > card[u]) then Swap (u, v); L[u] := L[u] L[v]; card[u] := card[u]+card[v]; for i L[v] do head[i] := head[u]; end
18 Kruskal algorithm (1956) Sorting the edges requires O(m log n). After sorting the complexity is O(m + n log n) and it can be obtained with linked lists. A list L is associated with each component of the current forest. For each vertex v V, let head(v) be the head of the list L v which v belongs to. Initially head(v):=v and L v :={v} for all vertices. At each iteration: it is necessary to test whether the next edge e = [u, v] in the list would close a cycle or not; if not, the data-structure must be updated.
19 Kruskal algorithm complexity The test is: head(u) = head(v)? It is executed in constant time at most m times. Hence it requires O(m) overall. When extending the current forest with e = [u, v], the shortest list among L u and L v (detectable in O(1) with an items counter associated with each list) is appended to the longest one (in O(1)). The head of the list is updated: head(u ) := head(v) for every u L u in O(n). No vertex can belong to the shortest list more than log n times, because the size of the shortest list at least doubles every time. Therefore the update operation requires at most O(log n) for each node, i.e. O(n log n) overall.
20 Boruvka algorithm (1926) It requires that all edge costs are different from each other and it allows for a parallel implementation. F:= ; while ( F < n 1) do For each component K of F Select e := argmin f δ(k) {c f }; F := F {e}; F remains a good forest after each iteration. Let e 1, e 2,...,e k the edges inserted into F with c e1 < c e2 <... < c ek. For each i = 1,...,k, e i is the minimum cost edge leaving F {e 1, e 2,...,e i 1 }, because none of {e 1, e 2,...,e i 1 } leaves component K i. Then F remains a good forest as if the edges would have been inserted sequentially.
21 Dual greedy algorithm It deletes edges from a connector instead of inserting them into a forest. Definition. A connector is good if it contains at least one minimum cost spanning tree. Theorem. Given a good connector K and an edge e K, K\{e} is a good connector if and only if K contains a cycle C such that e is the maximum cost edge in C. Kruskal (1956): sort the edges and starting from the connector K = E, iteratively delete the maximum cost edge which is not a bridge (i.e. without disconnecting the graph).
22 More algorithms Dijkstra algorithm (1960): Arbitrarily sort the edges and iteratively insert them into a forest (initially empty). When an edge which forms a cycle C is inserted, delete the maximum cost edge in C. Kalaba algorithm (1960): The same, but starting from an arbitrary spanning tree.
23 Dual ascent A dual ascent algorithm starts from a pair (x, y) of primal infeasible and dual feasible solutions and it iteratively does the following: Dual iteration: a violated primal constraint is selected; the corresponding dual variable y S is increased as much as possible, until a dual constraint becomes active; it corresponds to a primal variable x e ; Primal iteration: the corresponding primal variable x e enters the basis (is set to 1), repairing the infeasibility of the selected primal constraint. These two steps are repeated until primal feasibility is achieved. A primal solution and a dual solution are kept during the algorithm and they correspond to one another through complementary slackness conditions.
24 Model A: dual ascent A dual ascent algorithm based on model A iteratively does the following: Dual iteration: a cut (S, S) for which e δ(s) x e = 0, is selected; the corresponding dual variable y S is increased as much as possible, to activate a dual constraint corresponding to a primal variable x e, i.e. to an edge; Primal iteration: the corresponding primal variable x e is set to 1, repairing the infeasibility of the selected connectivity constraint. Dual feasibility requires S V:e δ(s) y S c e e E. Therefore for each node subset S, the maximum value that the corresponding dual variable y S can take is equal to the minimum cost c e among all the edges in the cut δ(s). If the dual iteration selects y S where S has maximum cardinality, Prim algorithm is obtained.
25 Model B: dual ascent A dual ascent algorithm based on model B iteratively does the following: Dual iteration: the only violated primal constraint is e E x e = n 1; acyclicity constraints are already satisfied, when we start from x = 0, and they always remain satisfied; the corresponding dual variable y V is increased, until a dual constraint becomes active; it corresponds to a primal variable x e ; Primal iteration: the primal variable x e enters the basis in order to decrease the infeasibility of the cardinality constraint; the maximum value x e can take is 1, because of the acyclicity constraint with S = 2; this makes some acyclicity constraints active, hence allowing for some dual variables to enter the basis; this in turn allows to increase y V further on. The primal and the dual solutions always correspond to each other through C.S.C., with the exception of y V ( e E x e (n 1)) = 0, which corresponds to a violated equality constraint in the primal problem. This is equivalent to Kruskal s algorithm.
26 Model B (Kruskal algorithm): an example k = 0. x = 0. z = y V = 0. w = 0. Dual C.S.C.: y V (k (n 1)) = 0(0 5) = 0.
27 An example: dual iteration 1 29(19) 13(3) (21) 25(15) 17(7) 22(12) 20(10) 35(25) 10(0) k = 0. x = 0. z = y V = 10. w = 10 5 = 50. Dual C.S.C.: y V (k (n 1)) = 10(0 5) = 50.
28 An example: primal iteration 1 29(19) 13(3) (21) 25(15) 17(7) 22(12) 20(10) 35(25) 10(0) y 56 = 0 5, k = 1. x 56 = 1. z = y V = 10. w = = 50. Dual C.S.C.: y V (k (n 1)) = 10(1 5) = 40.
29 An example: dual iteration 2 29(16) 13(0) (18) 25(12) 17(4) 22(9) 20(7) 35(22) 10(0) y 56 = 3 5, k = 1. x 56 = 1. z = y V = 13. w = = 62. Dual C.S.C.: y V (k (n 1)) = 13(1 5) = 52.
30 An example: primal iteration 2 29(16) 13(0) (18) 25(12) 17(4) 22(9) 20(7) 35(22) 10(0) y 23 = 0 2,3 y 56 = 3 5, k = 2. x 56 = x 23 = 1. z = y V = 13. w = = 62. Dual C.S.C.: y V (k (n 1)) = 13(2 5) = 39.
31 An example: dual iteration 3 29(12) 13(0) (8) 31(14) 17(0) 22(5) 20(3) 35(18) 10(0) y 23 = 4 2,3 y 56 = 7 5, k = 2. x 56 = x 23 = 1. z = y V = 17. w = = 74. Dual C.S.C.: y V (k (n 1)) = 17(2 5) = 51.
32 An observation 29(12) 13(0) (8) 31(14) 17(0) 22(5) 35(18) 10(0) k = 3. x 56 = x 23 = x 25 = 1. z = (3) Several primal constraints are now active: several dual variables can enter the basis: {2, 5} : x 25 = 1 {2, 3, 5} : x 23 + x 25 = 2 {2, 5, 6} : x 25 + x 56 = 2 {2, 3, 5, 6} : x 23 + x 25 + x 56 = 3 Which dual variable should we choose to enter the basis?
33 An observation Active dual constraints: [2, 5] : y 25 + y y y c 25 = y V [2, 3] : y 23 + y y c 23 = y V [5, 6] : y 56 + y y c 56 = y V For each unit increase of y V (providing value 5 in the dual objective), we can keep the dual constraints active with a unit increase of: y 56 and y 23 and y 25 : the cost is 1+1+1=3; y 56 and y 235 : the cost is 1+2=3; y 23 and y 256 : the cost is 1+2=3; y 2356 : the cost is 3. From the viewpoint of the dual active constraints and the dual objective function, all these possibilities are equivalent.
34 An observation But from the viewpoint of non-active dual constraints, they are not: if we choose y 2356 to enter the basis, no dual constraint corresponding to any other edge in {2, 3, 5, 6} will become active. Edges reduced costs are: c e = c e + S V:e E(S) y S y V. Reduced costs of all edges covered by basic dual variables do not decrease anymore. The dual variable y 2356 dominates the others; its corresponding primal constraint e E({2,3,5,6}) x e 3 dominates those corresponding to the others: i.e., if we do not select more edges in S = {2, 3, 5, 6}, we cannot select more edges in any subset of S.
35 An example: primal iteration 3 29(12) 13(0) (8) 31(14) 17(0) 22(5) 35(18) 10(0) (3) y 2356 = ,3,5,6 17 y 23 = 4 2,3 y 56 = 7 5, k = 3. x 56 = x 23 = x 25 = 1. z = y V = 17. w = = 74. Dual C.S.C.: y V (k (n 1)) = 17(3 5) = 34.
36 An example: dual iteration 4 29(4) 13(0) (0) 31(6) 17(0) 22(5) 35(10) 10(0) (3) y 2356 = ,3,5,6 17 y 23 = 4 2,3 y 56 = 7 5, k = 3. x 56 = x 23 = x 25 = 1. z = y V = 25. w = = 90. Dual C.S.C.: y V (k (n 1)) = 25(3 5) = 50.
37 An example: primal iteration 4 29(4) 13(0) (0) 31(6) 17(0) 22(5) 35(10) 10(0) (3) y 2356 = ,3,5,6 17 y 23 = 4 2,3 y 56 = 7 5,6 y 14 = 0 1, k = 4. x 56 = x 23 = x 25 = x 14 = 1. z = y V = 25. w = = 90. Dual C.S.C.: y V (k (n 1)) = 25(4 5) = 25.
38 An example: dual iteration 5 29(0) 13(0) (0) 31(2) 17(0) 22(5) 35(6) 10(0) (3) y 2356 = ,3,5,6 17 y 23 = 4 2,3 y 56 = 7 5,6 y 14 = 4 1, k = 4. x 56 = x 23 = x 25 = x 14 = 1. z = y V = 29. w = = 94. Dual C.S.C.: y V (k (n 1)) = 29(4 5) = 29.
39 An example: primal iteration 5 y V = 29 1,2,3,4,5,6 29(0) 13(0) (0) 31(2) 17(0) 22(5) 35(6) 10(0) (3) y 2356 = ,3,5,6 17 y 23 = 4 2,3 y 56 = 7 5,6 29 y 14 = 4 1, k = 5(feasible!). x 23 = x 56 = x 25 = x 14 = x 12 = 1. z = y V = 29. w = = 94. Dual C.S.C.: y V (k (n 1)) = 29(5 5) = 0.
40 Dual feasibility requires S V:e E(S) y S + c e y V e E. For each node subset S, the value that the corresponding dual variable y S takes is equal to the difference between the minimum edge cost in the cut δ(s) and the maximum edge cost in the minimum spanning tree of the induced subgraph E(S). Dual optimal solution y 2356 = 12 y V = ,3,5, y 23 = 4 2,3 y 56 = 7 5, ,2,3,4,5,6 29 y 14 = 4 1, y V = 29. w = = 94. Dual C.S.C.: y V (k (n 1)) = 29(5 5) = 0.
41 29(0) 13(0) (0) 31(2) 17(0) 35(6) 10(0) Primal optimal solution 22(5) 20(3) The reduced cost of each edge is the difference between its cost and the largest cost along the (unique) path between its endpoints in the spanning tree. Edges with positive reduced cost do not belong to the minimum cost spanning tree, because there is a cycle in which they have the largest cost. k = 5. x 23 = x 56 = x 25 = x 14 = x 12 = 1. z = 94. Owing to the dual ascent procedure (monotonic increase of y V ), edges are chosen in non-decreasing order according to their costs.
The minimum cost spanning tree problem
The minimum cost spanning tree problem Combinatorial optimization Giovanni Righini Definitions - 1 A graph G = (V,E) is a tree if and only if it is connected and acyclic. Connectivity: for each cut, at
More informationMinimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem
Minimum Spanning Trees (Forests) Given an undirected graph G=(V,E) with each edge e having a weight w(e) : Find a subgraph T of G of minimum total weight s.t. every pair of vertices connected in G are
More informationAdvanced algorithms. topological ordering, minimum spanning tree, Union-Find problem. Jiří Vyskočil, Radek Mařík 2012
topological ordering, minimum spanning tree, Union-Find problem Jiří Vyskočil, Radek Mařík 2012 Subgraph subgraph A graph H is a subgraph of a graph G, if the following two inclusions are satisfied: 2
More informationMinimum Spanning Trees My T. UF
Introduction to Algorithms Minimum Spanning Trees @ UF Problem Find a low cost network connecting a set of locations Any pair of locations are connected There is no cycle Some applications: Communication
More informationIII Optimal Trees and Branchings
Efficient Graph Algorithms III Optimal Trees and Branchings III Optimal Trees and Branchings 4 1 3 2 2 8 7 3 8 Efficient Graph Algorithms Wolfgang Stille WS 2011/2012 Chapter III - Optimal Trees and Branchings
More informationDecreasing a key FIB-HEAP-DECREASE-KEY(,, ) 3.. NIL. 2. error new key is greater than current key 6. CASCADING-CUT(, )
Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 1. if >. 2. error new key is greater than current key 3.. 4.. 5. if NIL and.
More information1 Minimum Spanning Trees (MST) b 2 3 a. 10 e h. j m
Minimum Spanning Trees (MST) 8 0 e 7 b 3 a 5 d 9 h i g c 8 7 6 3 f j 9 6 k l 5 m A graph H(U,F) is a subgraph of G(V,E) if U V and F E. A subgraph H(U,F) is called spanning if U = V. Let G be a graph with
More informationCS261: 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 informationChapter 23. Minimum Spanning Trees
Chapter 23. Minimum Spanning Trees We are given a connected, weighted, undirected graph G = (V,E;w), where each edge (u,v) E has a non-negative weight (often called length) w(u,v). The Minimum Spanning
More informationMinimum spanning trees
Minimum spanning trees [We re following the book very closely.] One of the most famous greedy algorithms (actually rather family of greedy algorithms). Given undirected graph G = (V, E), connected Weight
More informationDijkstra s algorithm for shortest paths when no edges have negative weight.
Lecture 14 Graph Algorithms II 14.1 Overview In this lecture we begin with one more algorithm for the shortest path problem, Dijkstra s algorithm. We then will see how the basic approach of this algorithm
More informationAlgorithms 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 information2.2 Optimal cost spanning trees
. Optimal cost spanning trees Spanning trees have a number of applications: network design (communication, electrical,...) IP network protocols compact memory storage (DNA)... E. Amaldi Foundations of
More informationCSC 8301 Design & Analysis of Algorithms: Kruskal s and Dijkstra s Algorithms
CSC 8301 Design & Analysis of Algorithms: Kruskal s and Dijkstra s Algorithms Professor Henry Carter Fall 2016 Recap Greedy algorithms iterate locally optimal choices to construct a globally optimal solution
More informationWeek 12: Minimum Spanning trees and Shortest Paths
Agenda: Week 12: Minimum Spanning trees and Shortest Paths Kruskal s Algorithm Single-source shortest paths Dijkstra s algorithm for non-negatively weighted case Reading: Textbook : 61-7, 80-87, 9-601
More information23.2 Minimum Spanning Trees
23.2 Minimum Spanning Trees Kruskal s algorithm: Kruskal s algorithm solves the Minimum Spanning Tree problem in O( E log V ) time. It employs the disjoint-set data structure that is similarly used for
More informationMinimum Spanning Trees
Minimum Spanning Trees Overview Problem A town has a set of houses and a set of roads. A road connects and only houses. A road connecting houses u and v has a repair cost w(u, v). Goal: Repair enough (and
More informationGraphs and Network Flows IE411. Lecture 21. Dr. Ted Ralphs
Graphs and Network Flows IE411 Lecture 21 Dr. Ted Ralphs IE411 Lecture 21 1 Combinatorial Optimization and Network Flows In general, most combinatorial optimization and integer programming problems are
More informationMinimum Spanning Trees
Minimum Spanning Trees Minimum Spanning Trees Representation of Weighted Graphs Properties of Minimum Spanning Trees Prim's Algorithm Kruskal's Algorithm Philip Bille Minimum Spanning Trees Minimum Spanning
More informationWe ve done. Introduction to the greedy method Activity selection problem How to prove that a greedy algorithm works Fractional Knapsack Huffman coding
We ve done Introduction to the greedy method Activity selection problem How to prove that a greedy algorithm works Fractional Knapsack Huffman coding Matroid Theory Now Matroids and weighted matroids Generic
More information5 MST and Greedy Algorithms
5 MST and Greedy Algorithms One of the traditional and practically motivated problems of discrete optimization asks for a minimal interconnection of a given set of terminals (meaning that every pair will
More information5 MST and Greedy Algorithms
5 MST and Greedy Algorithms One of the traditional and practically motivated problems of discrete optimization asks for a minimal interconnection of a given set of terminals (meaning that every pair will
More informationGreedy Algorithms. At each step in the algorithm, one of several choices can be made.
Greedy Algorithms At each step in the algorithm, one of several choices can be made. Greedy Strategy: make the choice that is the best at the moment. After making a choice, we are left with one subproblem
More informationPolynomial time approximation algorithms
Polynomial time approximation algorithms Doctoral course Optimization on graphs - Lecture 5.2 Giovanni Righini January 18 th, 2013 Approximation algorithms There are several reasons for using approximation
More information22 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 informationCIS 121 Data Structures and Algorithms Minimum Spanning Trees
CIS 121 Data Structures and Algorithms Minimum Spanning Trees March 19, 2019 Introduction and Background Consider a very natural problem: we are given a set of locations V = {v 1, v 2,..., v n }. We want
More informationCS 6783 (Applied Algorithms) Lecture 5
CS 6783 (Applied Algorithms) Lecture 5 Antonina Kolokolova January 19, 2012 1 Minimum Spanning Trees An undirected graph G is a pair (V, E); V is a set (of vertices or nodes); E is a set of (undirected)
More informationRecitation 13. Minimum Spanning Trees Announcements. SegmentLab has been released, and is due Friday, November 17. It s worth 135 points.
Recitation 13 Minimum Spanning Trees 13.1 Announcements SegmentLab has been released, and is due Friday, November 17. It s worth 135 points. 73 74 RECITATION 13. MINIMUM SPANNING TREES 13.2 Prim s Algorithm
More informationThese 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 informationCSC 1700 Analysis of Algorithms: Minimum Spanning Tree
CSC 1700 Analysis of Algorithms: Minimum Spanning Tree Professor Henry Carter Fall 2016 Recap Space-time tradeoffs allow for faster algorithms at the cost of space complexity overhead Dynamic programming
More informationWhat is a minimal spanning tree (MST) and how to find one
What is a minimal spanning tree (MST) and how to find one A tree contains a root, the top node. Each node has: One parent Any number of children A spanning tree of a graph is a subgraph that contains all
More informationAlgorithms and Theory of Computation. Lecture 5: Minimum Spanning Tree
Algorithms and Theory of Computation Lecture 5: Minimum Spanning Tree Xiaohui Bei MAS 714 August 31, 2017 Nanyang Technological University MAS 714 August 31, 2017 1 / 30 Minimum Spanning Trees (MST) A
More informationAlgorithms and Theory of Computation. Lecture 5: Minimum Spanning Tree
Algorithms and Theory of Computation Lecture 5: Minimum Spanning Tree Xiaohui Bei MAS 714 August 31, 2017 Nanyang Technological University MAS 714 August 31, 2017 1 / 30 Minimum Spanning Trees (MST) A
More informationAnnouncements Problem Set 5 is out (today)!
CSC263 Week 10 Announcements Problem Set is out (today)! Due Tuesday (Dec 1) Minimum Spanning Trees The Graph of interest today A connected undirected weighted graph G = (V, E) with weights w(e) for each
More informationCSE331 Introduction to Algorithms Lecture 15 Minimum Spanning Trees
CSE1 Introduction to Algorithms Lecture 1 Minimum Spanning Trees Antoine Vigneron antoine@unist.ac.kr Ulsan National Institute of Science and Technology July 11, 201 Antoine Vigneron (UNIST) CSE1 Lecture
More information22 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 informationProblem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.
CS261, Winter 2017. Instructor: Ashish Goel. Problem set 2 Electronic submission to Gradescope due 11:59pm Thursday 2/16. Form a group of 2-3 students that is, submit one homework with all of your names.
More informationLinear programming and duality theory
Linear programming and duality theory Complements of Operations Research Giovanni Righini Linear Programming (LP) A linear program is defined by linear constraints, a linear objective function. Its variables
More informationCOMP 355 Advanced Algorithms
COMP 355 Advanced Algorithms Algorithms for MSTs Sections 4.5 (KT) 1 Minimum Spanning Tree Minimum spanning tree. Given a connected graph G = (V, E) with realvalued edge weights c e, an MST is a subset
More informationMinimum Spanning Trees. Minimum Spanning Trees. Minimum Spanning Trees. Minimum Spanning Trees
Properties of Properties of Philip Bille 0 0 Graph G Not connected 0 0 Connected and cyclic Connected and acyclic = spanning tree Total weight = + + + + + + = Applications Network design. Computer, road,
More informationWeek 11: Minimum Spanning trees
Week 11: Minimum Spanning trees Agenda: Minimum Spanning Trees Prim s Algorithm Reading: Textbook : 61-7 1 Week 11: Minimum Spanning trees Minimum spanning tree (MST) problem: Input: edge-weighted (simple,
More informationSteiner Trees and Forests
Massachusetts Institute of Technology Lecturer: Adriana Lopez 18.434: Seminar in Theoretical Computer Science March 7, 2006 Steiner Trees and Forests 1 Steiner Tree Problem Given an undirected graph G
More informationAdvanced 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 informationAlgorithms and Data Structures: Minimum Spanning Trees (Kruskal) ADS: lecture 16 slide 1
Algorithms and Data Structures: Minimum Spanning Trees (Kruskal) ADS: lecture 16 slide 1 Minimum Spanning Tree Problem Given: Undirected connected weighted graph (G, W ) Output: An MST of G We have already
More informationUC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 8 Lecturer: David Wagner February 20, Notes 8 for CS 170
UC Berkeley CS 170: Efficient Algorithms and Intractable Problems Handout 8 Lecturer: David Wagner February 20, 2003 Notes 8 for CS 170 1 Minimum Spanning Trees A tree is an undirected graph that is connected
More informationChapter 9. Greedy Technique. Copyright 2007 Pearson Addison-Wesley. All rights reserved.
Chapter 9 Greedy Technique Copyright 2007 Pearson Addison-Wesley. All rights reserved. Greedy Technique Constructs a solution to an optimization problem piece by piece through a sequence of choices that
More informationMinimum-Cost Spanning Tree. Example
Minimum-Cost Spanning Tree weighted connected undirected graph spanning tree cost of spanning tree is sum of edge costs find spanning tree that has minimum cost Example 2 4 12 6 3 Network has 10 edges.
More informationmanaging an evolving set of connected components implementing a Union-Find data structure implementing Kruskal s algorithm
Spanning Trees 1 Spanning Trees the minimum spanning tree problem three greedy algorithms analysis of the algorithms 2 The Union-Find Data Structure managing an evolving set of connected components implementing
More informationExample. Minimum-Cost Spanning Tree. Edge Selection Greedy Strategies. Edge Selection Greedy Strategies
Minimum-Cost Spanning Tree weighted connected undirected graph spanning tree cost of spanning tree is sum of edge costs find spanning tree that has minimum cost Example 2 4 12 6 3 Network has 10 edges.
More informationGreedy Algorithms Part Three
Greedy Algorithms Part Three Announcements Problem Set Four due right now. Due on Wednesday with a late day. Problem Set Five out, due Monday, August 5. Explore greedy algorithms, exchange arguments, greedy
More informationAlgorithm Design (8) Graph Algorithms 1/2
Graph Algorithm Design (8) Graph Algorithms / Graph:, : A finite set of vertices (or nodes) : A finite set of edges (or arcs or branches) each of which connect two vertices Takashi Chikayama School of
More informationTheory of Computing. Lecture 10 MAS 714 Hartmut Klauck
Theory of Computing Lecture 10 MAS 714 Hartmut Klauck Seven Bridges of Königsberg Can one take a walk that crosses each bridge exactly once? Seven Bridges of Königsberg Model as a graph Is there a path
More informationCSE 521: Design and Analysis of Algorithms I
CSE 521: Design and Analysis of Algorithms I Greedy Algorithms Paul Beame 1 Greedy Algorithms Hard to define exactly but can give general properties Solution is built in small steps Decisions on how to
More informationDefinition: A graph G = (V, E) is called a tree if G is connected and acyclic. The following theorem captures many important facts about trees.
Tree 1. Trees and their Properties. Spanning trees 3. Minimum Spanning Trees 4. Applications of Minimum Spanning Trees 5. Minimum Spanning Tree Algorithms 1.1 Properties of Trees: Definition: A graph G
More informationNetwork optimization: An overview
Network optimization: An overview Mathias Johanson Alkit Communications 1 Introduction Various kinds of network optimization problems appear in many fields of work, including telecommunication systems,
More informationCSE 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 informationElementary Graph Algorithms: Summary. Algorithms. CmSc250 Intro to Algorithms
Elementary Graph Algorithms: Summary CmSc250 Intro to Algorithms Definition: A graph is a collection (nonempty set) of vertices and edges A path from vertex x to vertex y : a list of vertices in which
More informationUndirected Graphs. DSA - lecture 6 - T.U.Cluj-Napoca - M. Joldos 1
Undirected Graphs Terminology. Free Trees. Representations. Minimum Spanning Trees (algorithms: Prim, Kruskal). Graph Traversals (dfs, bfs). Articulation points & Biconnected Components. Graph Matching
More informationConstructive and destructive algorithms
Constructive and destructive algorithms Heuristic algorithms Giovanni Righini University of Milan Department of Computer Science (Crema) Constructive algorithms In combinatorial optimization problems every
More informationCSE 21 Mathematics for Algorithm and System Analysis
CSE 21 Mathematics for Algorithm and System Analysis Unit 4: Basic Concepts in Graph Theory Section 3: Trees 1 Review : Decision Tree (DT-Section 1) Root of the decision tree on the left: 1 Leaves of the
More informationDesign and Analysis of Algorithms
CSE 101, Winter 2018 Design and Analysis of Algorithms Lecture 9: Minimum Spanning Trees Class URL: http://vlsicad.ucsd.edu/courses/cse101-w18/ Goal: MST cut and cycle properties Prim, Kruskal greedy algorithms
More informationApproximation Algorithms: The Primal-Dual Method. My T. Thai
Approximation Algorithms: The Primal-Dual Method My T. Thai 1 Overview of the Primal-Dual Method Consider the following primal program, called P: min st n c j x j j=1 n a ij x j b i j=1 x j 0 Then the
More informationMinimum Spanning Tree (5A) Young Won Lim 5/11/18
Minimum Spanning Tree (5A) Copyright (c) 2015 2018 Young W. Lim. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2
More informationChapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.5 Minimum Spanning Tree Minimum Spanning Tree Minimum spanning tree. Given a connected
More informationCS 341: Algorithms. Douglas R. Stinson. David R. Cheriton School of Computer Science University of Waterloo. February 26, 2019
CS 341: Algorithms Douglas R. Stinson David R. Cheriton School of Computer Science University of Waterloo February 26, 2019 D.R. Stinson (SCS) CS 341 February 26, 2019 1 / 296 1 Course Information 2 Introduction
More informationComputer Science & Engineering 423/823 Design and Analysis of Algorithms
Computer Science & Engineering 423/823 Design and Analysis of Algorithms Lecture 05 Minimum-Weight Spanning Trees (Chapter 23) Stephen Scott (Adapted from Vinodchandran N. Variyam) sscott@cse.unl.edu Introduction
More information2 A Template for Minimum Spanning Tree Algorithms
CS, Lecture 5 Minimum Spanning Trees Scribe: Logan Short (05), William Chen (0), Mary Wootters (0) Date: May, 0 Introduction Today we will continue our discussion of greedy algorithms, specifically in
More informationUndirected Graphs. Hwansoo Han
Undirected Graphs Hwansoo Han Definitions Undirected graph (simply graph) G = (V, E) V : set of vertexes (vertices, nodes, points) E : set of edges (lines) An edge is an unordered pair Edge (v, w) = (w,
More informationThe minimum spanning tree problem
The minimum spanning tree problem MST is a minimum cost connection problem on graphs The graph can model the connection in a (hydraulic, electric, telecommunication) network: the nodes are the points that
More informationGraph Algorithms (part 3 of CSC 282),
Graph Algorithms (part of CSC 8), http://www.cs.rochester.edu/~stefanko/teaching/10cs8 1 Schedule Homework is due Thursday, Oct 1. The QUIZ will be on Tuesday, Oct. 6. List of algorithms covered in the
More informationCSE 431/531: Algorithm Analysis and Design (Spring 2018) Greedy Algorithms. Lecturer: Shi Li
CSE 431/531: Algorithm Analysis and Design (Spring 2018) Greedy Algorithms Lecturer: Shi Li Department of Computer Science and Engineering University at Buffalo Main Goal of Algorithm Design Design fast
More information6.1 Minimum Spanning Trees
CS124 Lecture 6 Fall 2018 6.1 Minimum Spanning Trees A tree is an undirected graph which is connected and acyclic. It is easy to show that if graph G(V,E) that satisfies any two of the following properties
More informationMinimum Spanning Trees
CSMPS 2200 Fall Minimum Spanning Trees Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk 11/6/ CMPS 2200 Intro. to Algorithms 1 Minimum spanning trees Input: A
More informationMinimum Spanning Tree
Minimum Spanning Tree 1 Minimum Spanning Tree G=(V,E) is an undirected graph, where V is a set of nodes and E is a set of possible interconnections between pairs of nodes. For each edge (u,v) in E, we
More informationNotes on Minimum Spanning Trees. Red Rule: Given a cycle containing no red edges, select a maximum uncolored edge on the cycle, and color it red.
COS 521 Fall 2009 Notes on Minimum Spanning Trees 1. The Generic Greedy Algorithm The generic greedy algorithm finds a minimum spanning tree (MST) by an edge-coloring process. Initially all edges are uncolored.
More informationK 4 C 5. Figure 4.5: Some well known family of graphs
08 CHAPTER. TOPICS IN CLASSICAL GRAPH THEORY K, K K K, K K, K K, K C C C C 6 6 P P P P P. Graph Operations Figure.: Some well known family of graphs A graph Y = (V,E ) is said to be a subgraph of a graph
More informationUNIT 3. Greedy Method. Design and Analysis of Algorithms GENERAL METHOD
UNIT 3 Greedy Method GENERAL METHOD Greedy is the most straight forward design technique. Most of the problems have n inputs and require us to obtain a subset that satisfies some constraints. Any subset
More informationSpanning Trees. Lecture 20 CS2110 Spring 2015
1 Spanning Trees Lecture 0 CS110 Spring 01 1 Undirected trees An undirected graph is a tree if there is exactly one simple path between any pair of vertices Root of tree? It doesn t matter choose any vertex
More informationCS 5321: Advanced Algorithms Minimum Spanning Trees. Acknowledgement. Minimum Spanning Trees
CS : Advanced Algorithms Minimum Spanning Trees Ali Ebnenasir Department of Computer Science Michigan Technological University Acknowledgement Eric Torng Moon Jung Chung Charles Ofria Minimum Spanning
More informationGraphs and Network Flows ISE 411. Lecture 7. Dr. Ted Ralphs
Graphs and Network Flows ISE 411 Lecture 7 Dr. Ted Ralphs ISE 411 Lecture 7 1 References for Today s Lecture Required reading Chapter 20 References AMO Chapter 13 CLRS Chapter 23 ISE 411 Lecture 7 2 Minimum
More informationRepresentations of Weighted Graphs (as Matrices) Algorithms and Data Structures: Minimum Spanning Trees. Weighted Graphs
Representations of Weighted Graphs (as Matrices) A B Algorithms and Data Structures: Minimum Spanning Trees 9.0 F 1.0 6.0 5.0 6.0 G 5.0 I H 3.0 1.0 C 5.0 E 1.0 D 28th Oct, 1st & 4th Nov, 2011 ADS: lects
More informationGreedy Algorithms. Textbook reading. Chapter 4 Chapter 5. CSci 3110 Greedy Algorithms 1/63
CSci 3110 Greedy Algorithms 1/63 Greedy Algorithms Textbook reading Chapter 4 Chapter 5 CSci 3110 Greedy Algorithms 2/63 Overview Design principle: Make progress towards a solution based on local criteria
More informationLecture 7. s.t. e = (u,v) E x u + x v 1 (2) v V x v 0 (3)
COMPSCI 632: Approximation Algorithms September 18, 2017 Lecturer: Debmalya Panigrahi Lecture 7 Scribe: Xiang Wang 1 Overview In this lecture, we will use Primal-Dual method to design approximation algorithms
More informationKruskal s MST Algorithm
Kruskal s MST Algorithm CLRS Chapter 23, DPV Chapter 5 Version of November 5, 2014 Main Topics of This Lecture Kruskal s algorithm Another, but different, greedy MST algorithm Introduction to UNION-FIND
More informationMinimum Spanning Trees
CS124 Lecture 5 Spring 2011 Minimum Spanning Trees A tree is an undirected graph which is connected and acyclic. It is easy to show that if graph G(V,E) that satisfies any two of the following properties
More informationLecture 4: Graph Algorithms
Lecture 4: Graph Algorithms Definitions Undirected graph: G =(V, E) V finite set of vertices, E finite set of edges any edge e = (u,v) is an unordered pair Directed graph: edges are ordered pairs If e
More informationSources 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 informationIntroduction to Optimization
Introduction to Optimization Greedy Algorithms October 5, 2015 École Centrale Paris, Châtenay-Malabry, France Dimo Brockhoff INRIA Lille Nord Europe Course Overview 2 Date Topic Mon, 21.9.2015 Introduction
More informationCS 561, Lecture 9. Jared Saia University of New Mexico
CS 561, Lecture 9 Jared Saia University of New Mexico Today s Outline Minimum Spanning Trees Safe Edge Theorem Kruskal and Prim s algorithms Graph Representation 1 Graph Definition A graph is a pair of
More informationRepetition: Primal Dual for Set Cover
Repetition: Primal Dual for Set Cover Primal Relaxation: k min i=1 w ix i s.t. u U i:u S i x i 1 i {1,..., k} x i 0 Dual Formulation: max u U y u s.t. i {1,..., k} u:u S i y u w i y u 0 Harald Räcke 428
More informationCOP 4531 Complexity & Analysis of Data Structures & Algorithms
COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 9 Minimum Spanning Trees Thanks to the text authors who contributed to these slides Why Minimum Spanning Trees (MST)? Example 1 A
More informationLecture 19. Broadcast routing
Lecture 9 Broadcast routing Slide Broadcast Routing Route a packet from a source to all nodes in the network Possible solutions: Flooding: Each node sends packet on all outgoing links Discard packets received
More informationCS599: 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 informationRandomized Graph Algorithms
Randomized Graph Algorithms Vasileios-Orestis Papadigenopoulos School of Electrical and Computer Engineering - NTUA papadigenopoulos orestis@yahoocom July 22, 2014 Vasileios-Orestis Papadigenopoulos (NTUA)
More informationChapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.5 Minimum Spanning Tree Minimum Spanning Tree Minimum spanning tree. Given a connected
More informationMinimum Spanning Trees
Chapter 23 Minimum Spanning Trees Let G(V, E, ω) be a weighted connected graph. Find out another weighted connected graph T(V, E, ω), E E, such that T has the minimum weight among all such T s. An important
More information7.3 Spanning trees Spanning trees [ ] 61
7.3. Spanning trees [161211-1348 ] 61 7.3 Spanning trees We know that trees are connected graphs with the minimal number of edges. Hence trees become very useful in applications where our goal is to connect
More informationMinimum Spanning Trees
Minimum Spanning Trees 1 Minimum- Spanning Trees 1. Concrete example: computer connection. Definition of a Minimum- Spanning Tree Concrete example Imagine: You wish to connect all the computers in an office
More informationIndex. stack-based, 400 A* algorithm, 325
Index Abstract transitive closure, 174-175, 217-221 Active vertex, 411 Acyclic graph. See Digraph; Directed acyclic graph (DAG) Acyclic network, 313-321, 334-335 maxflow, 427-429 Adjacency-lists representation,
More informationAssignment # 4 Selected Solutions
Assignment # 4 Selected Solutions Problem 2.3.3 Let G be a connected graph which is not a tree (did you notice this is redundant?) and let C be a cycle in G. Prove that the complement of any spanning tree
More information