Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths
|
|
- Alan Carter
- 5 years ago
- Views:
Transcription
1 Matroids Shortest Paths Discrete Optimization 2010 Lecture 2 Matroids & Shortest Paths Marc Uetz University of Twente m.uetz@utwente.nl Lecture 2: sheet 1 / 25 Marc Uetz Discrete Optimization
2 Matroids Shortest Paths Prim s Algoritm (1957) Algorithm 1: Prim input : G = (V, E, c) output: T E, minimum spanning tree of G let W = v 0 arbitrary start vertex; T = ; for (i = 1,..., n 1) do e i = {v, u} := argmin{c e e δ(w )}; // e i is cheapest edge leaving W ; v W and u W T = T e i ; W = W u Correctness follows directly from Cut Condition Computation time can be shown in O( n 2 ) Lecture 2: sheet 2 / 25 Marc Uetz Discrete Optimization
3 Matroids Shortest Paths More remarks about MST Read literature With a little more care (data structure & analysis), Kruskal s algorithm can be implemented to run in O( m log m ) Krukal s algorithm: Grows a forest (collection of several trees) on V Prim s algorithm: Grows one (minimal) spanning tree only, on subset W of nodes of V Take away message A good bound on computation time may depend on clever data structures (& tricks); just some (polynomial) bound is often easy Lecture 2: sheet 3 / 25 Marc Uetz Discrete Optimization
4 Outline Matroids Shortest Paths 1 Matroids 2 Shortest Paths General Graphs Nonnegative Arc Lengths Lecture 2: sheet 4 / 25 Marc Uetz Discrete Optimization
5 Matroids Shortest Paths Independence Systems and Matroids Definition (Matroid) Let S = {1,..., n} be a finite set and I 2 S be a family of subsets of S (the independent sets). Then M = (S, I) is an independence system if: 1 I ( is independent) 2 If J I and I J then I I (I is closed for ) Moreover, M = (S, I) is a matroid if in addition: 3 For all A S, all maximal independent subsets of A have the same cardinality if elements s of S have weights w s, call it weighted matroid maximal independent subsets of A S are called bases of A rank r(a) = size of any basis of A (well-defined for matroids) Lecture 2: sheet 5 / 25 Marc Uetz Discrete Optimization
6 Matroids Shortest Paths The Greedy Algorithm Algorithm 2: Greedy input : weighted matroid M = (S, I, w), any A S output: minimum [maximum] weight basis F of A let F = ; // note I while ( s A such that F {s} I) do choose such s A with minimal [maximal] weight w s ; F F {s}; // greedily add s to F Note: For any particular matroid, need an oracle (an algorithm) that tells us if F {s} I (i.e., if F {s} is independent) Lecture 2: sheet 6 / 25 Marc Uetz Discrete Optimization
7 Matroids Shortest Paths Kruskal s Algorithm Revisited Kruskal s Algorithm Let T = (T is a forest) while ( edge e E \ T, s.t. T {e} is forest) pick such e with minimal cost c e T T {e} Observations The set of forests of a graph are a matroid, and the bases are the spanning trees (Exercise) Kruskal s algorithm is just the greedy algorithm applied to some particular matroid Lecture 2: sheet 7 / 25 Marc Uetz Discrete Optimization
8 Matroids Shortest Paths The Greedy Algorithm Theorem Greedy algorithm computes a min [max] weight basis of any A S. Proof F = output of Greedy, T = minimal weight base, note F = T. Let F = {f 1,..., f l }, T = {t 1,..., t l } both sorted by weights Let k be minimal with w fk > w tk Iteration k, why didn t Greedy pick any t i of t 1,..., t k? t i {f 1,..., f k 1 } {f 1,..., f k 1, t i } I In any case, we have that {f 1,..., f k 1 } is basis of {f 1,..., f k 1, t 1,..., t k } but {t 1,..., t k } I, contradiction Lecture 2: sheet 8 / 25 Marc Uetz Discrete Optimization
9 Matroids Shortest Paths Greedy Works only for Matroids Theorem Given an independence system M = (S, I), the greedy algorithm computes min [max] weight bases for all possible weights functions w s if and only if M is a matroid. Proof ( only if ) Assume two bases F, T of different cardinality, say F T + 1 Define weights 2 for all s S \ (F T ) 1 ε for all s F for some ε < 1/ S 1 for all s T \ F ( ) and Greedy must fail to compute optimum, which has weight T Lecture 2: sheet 9 / 25 Marc Uetz Discrete Optimization
10 Matroids Shortest Paths Greedy or Not Greedy Matroids forests of undirected graphs (your Exercise) linear matroids: linearly independent vectors of a vector field (Steinitz exchange lemma all bases have same length) Independence systems, but no matroids matchings in undirected graphs (but there exists a polytime algorithm - Edmonds 1965) independent sets in graph G = (V, E) (no polytime algorithm, unless P=NP) Lecture 2: sheet 10 / 25 Marc Uetz Discrete Optimization
11 Matroids Shortest Paths Side Remark: Polymatroids Let M = (S, I) be a matroid with rank function r Consider Linear Program maximize subject to w s x s s S x s r(a), s A x 0 A S For A S, let x A be the characteristic vector of A If T I, x T is feasible solution (obvious) If Greedy computes T as maximum weight base, x T is an optimal solution (Edmonds 70) Lecture 2: sheet 11 / 25 Marc Uetz Discrete Optimization
12 Outline 1 Matroids 2 Shortest Paths General Graphs Nonnegative Arc Lengths Lecture 2: sheet 12 / 25 Marc Uetz Discrete Optimization
13 Shortest Path Problem!!"#$%&'()*+,%+('-*.#/' '.*,'7+"-%/8',&'5!"4'84%#3 Given! 9$%#$%& digraph! :/;*%+8%'#.%/'< G = (V, A), 84% =*;>'8'%;'%? integer arc lengths c : A Z, s, t V want:! :/;*%+8%'#.%/8'< shortest path 84@ &."('()8%.",+8'(2@6'=*;>'8'%;'.77';%/+*'@ length from s to t (to all nodes v V ) (&)!! $! " ) $ ) $ # # " # %&' (&)! " $ # %&' In undirected graphs: 2 = 2 2 Lecture 2: sheet 13 / 25 Marc Uetz Discrete Optimization
14 Three main cases Arbitrary digraphs includes negative cycle detection Label correcting (Bellman-Ford) algorithm & Floyd-Warshall O( nm ), respectively O( n 3 ) time Arbitrary digraphs, nonnegative arc lengths Label setting (Dijkstra) O( n 2 ) time Acyclic digraphs Dynamic programming O( n + m ) time Lecture 2: sheet 14 / 25 Marc Uetz Discrete Optimization
15 Shortest Path Optimality!"#$%&'%()*%"'(+,%-.*/-%0(1#23-%-#2 Let d(v), v V be arbitrary node labels such that d(v) shortest path length from s to v, v V!!"#$%&'(!"#$%&'%(%$)(*+,#-'. )*(&!"%(+#$! /+-(0123(12#43(5+(.67+(%$5"-$%$8(,60+(*%5+*..9)'(-'%-(0123(".(%,(9&&+$( 9&&+$( Theorem 569,0 :6$(-'+(.'6$-+.-(&%-'(:$67(.(-6(2(12#4;.3< Labels d(v) are shortest path lengths if and only if the! ='+(,60+(*%5+*.(0123(%$+(.'6$-+.-(&%-'(*+,#-'.(":(%,0(6,*8(": -inequality holds 01>3(! for all 01,3?) arcs (v, w) A,%- :6$(%**(12@>3#A d(w) d(v) + c vw * (&)!!! $ "! " ) $ ) $! # # " " # + 2 %&' ) 2> > Lecture 2: sheet 15 / 25 Marc Uetz Discrete Optimization
16 Proof Necessity trivial, for otherwise there is a shortcut to w via v Sufficiency Let l(w) be the (true) shortest path length to w, l(w) d(w). pick shortest (s, w)-path P = (s,... u, v, w), length l(w) use -inequality along this path d(w) d(v) + c vw d(u) + c uv + c vw. d(s) + length(p) = l(w) Lecture 2: sheet 16 / 25 Marc Uetz Discrete Optimization
17 Shortest Path Algorithms, Ideas Use previous theorem Start with distance labels d(v) shortest path lengths, then correct violated -inequalities (in a clever way) start with d(s) = 0 and d(v) = then, check (and correct) -inequality along arcs [that is, if (d(w) > d(v) + c vw ) then d(w) = d(v) + c vw and pred(w) = v] say, in rounds where we always check -inequality of arcs in order e 1, e 2,..., e m question: this stops? after how many rounds? Claim: (n 1) rounds suffice, if shortest path lengths exist Lecture 2: sheet 17 / 25 Marc Uetz Discrete Optimization
18 Proof of Claim note that shortest paths lengths exist G has no negative length cycle consider any shortest path (s, u, v,..., w) to any node w, consisting of k ( n 1) arcs after first round, d(u) correct after second round, d(v) correct... after kth ( n 1) round, d(w) is correct Lecture 2: sheet 18 / 25 Marc Uetz Discrete Optimization
19 Bellman-Ford Algorithm Algorithm one round: label correcting all arcs a A in some order if -inequality violated in nth round, return negative cycle Time complexity trivially, O( nm ) [n rounds of O( m )] Correctness If negative length cycle, see previous slide If (and only if) negative length cycle, some -inequality will still be violated in nth round (actually, in any round) Lecture 2: sheet 19 / 25 Marc Uetz Discrete Optimization
20 All-Pairs Shortest Paths Use n Bellman-Ford, all-pairs shortest paths in O( n 2 m ) O( n 4 ) Definition For all v, w V, define d u (v, w) as the length of a shortest (v, w)-path that may only pass through nodes 1, 2,..., u (Assume nodes are 1, 2,..., n, some order) have d 0 (v, w) = c v,w if (v, w) A, otherwise by definition, d n (v, w) is the shortest (v, w)-path length have the recurrence relation d u (v, w) = min{d u 1 (v, w), d u 1 (v, u) + d u 1 (u, w)} So, given d u 1, computation of d u takes n 2 O( 1 ) time Lecture 2: sheet 20 / 25 Marc Uetz Discrete Optimization
21 Floyd-Warshall Algorithm Algorithm 3: Floyd-Warshall input : G = (V, A, c) output: d(v, w), pred(v, w) for all v, w V or negative cycle d(v, w) = c vw and pred(v, w) = v (v, w) A; d(v, w) = and pred(v, w) = (v, w) A; d(v, v) = 0 v V ; for (u = 1,..., n) do for (all v, w V ) do if (d(v, w) > d(v, u) + d(u, w)) then d(v, w) = d(v, u) + d(u, w), pred(v, w) = pred(u, w); if ((v == w) and d(v, w) < 0) return negative cycle ; pred(v, w) = last node before w on (v, w)-path correctness follows by correctness of recurrence relation computation time, trivially n n 2 O( 1 ) = O( n 3 ) Lecture 2: sheet 21 / 25 Marc Uetz Discrete Optimization
22 Dijkstra s Algorithm (1959) Shortest (s, v) paths for digraphs G = (V, A, c) with c 0 idea: only one correcting of each -inequality Algorithm 4: Dijkstra input : G = (V, A, c) with c 0, start node s V output: d(v), pred(v) for all v V d(s) = 0 and d(v) = v V \ s; S = ; while (S V ) do pick v V \ S with smallest label d(v); S = S v; // d(v) permanent for (all w with (v, w) A) do if (d(w) > d(v) + c vw ) then d(w) = d(v) + c vw and pred(w) = v; Lecture 2: sheet 22 / 25 Marc Uetz Discrete Optimization
23 Example: Dijkstra note: set S already has the correct distance labels at any iteration! Lecture 2: sheet 23 / 25 Marc Uetz Discrete Optimization
24 Correctness We prove by induction on # iterations (ind. start is trivial) Claim 1: d(u) d(w) for u S, w S Iteration S S v: d(u) d(v) u S by hypothesis Next, d(v) d(w) w S by choice of v with min. d(v) Finally, d(u) d(v) d(v) + c vw = d new (w) for relabeled w S (last because c vw 0) Claim 2: labels within S are correct (check -inequality) Iteration S S v: By hypothesis, need only check arcs with v: By claim 1, d(u) d(v) d(v) + c vu for all u S so any u S needs no relabeling via v Also, d(v) d(u) + c uv at iteration u, and u wasn t relabeled since Upon termination S = V, so Dijkstra is correct Lecture 2: sheet 24 / 25 Marc Uetz Discrete Optimization
25 Computation Time Simple Initialization O( n ) n iterations of while-loop, in each need to find smallest label in V \ S, which is doable in O( n ) O( n 2 ) in total m relabeling steps of O( 1 ) O( m ) Which gives O( n ) + O( n 2 ) + O( m ) O( n 2 ) time Less simple An O( m log n ) implementation, which uses priority queue (also called heap) to manage finding minimal d(v) in O( 1 ) time. (log n comes from overhead in organization of the heap) Lecture 2: sheet 25 / 25 Marc Uetz Discrete Optimization
Discrete Wiskunde II. Lecture 5: Shortest Paths & Spanning Trees
, 2009 Lecture 5: Shortest Paths & Spanning Trees University of Twente m.uetz@utwente.nl wwwhome.math.utwente.nl/~uetzm/dw/ Shortest Path Problem "#$%&'%()*%"()$#+,&- Given directed "#$%&'()*+,%+('-*.#/'01234564'.*,'7+"-%/8',&'5"4'84%#3
More informationDiscrete Optimization 2010 Lecture 3 Maximum Flows
Remainder: Shortest Paths Maximum Flows Discrete Optimization 2010 Lecture 3 Maximum Flows Marc Uetz University of Twente m.uetz@utwente.nl Lecture 3: sheet 1 / 29 Marc Uetz Discrete Optimization Outline
More informationCMPS 6610 Fall 2018 Shortest Paths Carola Wenk
CMPS 6610 Fall 018 Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight function w
More informationCMPSCI611: The Matroid Theorem Lecture 5
CMPSCI611: The Matroid Theorem Lecture 5 We first review our definitions: A subset system is a set E together with a set of subsets of E, called I, such that I is closed under inclusion. This means that
More informationCS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs. Instructor: Shaddin Dughmi
CS675: Convex and Combinatorial Optimization Fall 2014 Combinatorial Problems as Linear Programs Instructor: Shaddin Dughmi Outline 1 Introduction 2 Shortest Path 3 Algorithms for Single-Source Shortest
More information/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Matroids and Greedy Algorithms Date: 10/31/16
60.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Matroids and Greedy Algorithms Date: 0/3/6 6. Introduction We talked a lot the last lecture about greedy algorithms. While both Prim
More informationSingle Source Shortest Paths
CMPS 00 Fall 017 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk Paths in graphs Consider a digraph G = (V, E) with an edge-weight
More informationCS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs. Instructor: Shaddin Dughmi
CS675: Convex and Combinatorial Optimization Fall 2016 Combinatorial Problems as Linear and Convex Programs Instructor: Shaddin Dughmi Outline 1 Introduction 2 Shortest Path 3 Algorithms for Single-Source
More informationShortest Path Algorithms
Shortest Path Algorithms Andreas Klappenecker [based on slides by Prof. Welch] 1 Single Source Shortest Path 2 Single Source Shortest Path Given: a directed or undirected graph G = (V,E) a source node
More informationDesign and Analysis of Algorithms
Design and Analysis of Algorithms CSE 5311 Lecture 21 Single-Source Shortest Paths Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 Single-Source
More informationAlgorithm Design and Analysis
Algorithm Design and Analysis LECTURE 7 Greedy Graph Algorithms Shortest paths Minimum Spanning Tree Sofya Raskhodnikova 9/14/016 S. Raskhodnikova; based on slides by E. Demaine, C. Leiserson, A. Smith,
More informationCS 4407 Algorithms Lecture: Shortest Path Algorithms
CS 440 Algorithms Lecture: Shortest Path Algorithms Prof. Gregory Provan Department of Computer Science University College Cork 1 Outline Shortest Path Problem General Lemmas and Theorems. Algorithms Bellman-Ford
More informationSingle Source Shortest Paths
CMPS 00 Fall 015 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk 1 Paths in graphs Consider a digraph G = (V, E) with an edge-weight
More informationCS599: Convex and Combinatorial Optimization Fall 2013 Lecture 17: Combinatorial Problems as Linear Programs III. Instructor: Shaddin Dughmi
CS599: Convex and Combinatorial Optimization Fall 2013 Lecture 17: Combinatorial Problems as Linear Programs III Instructor: Shaddin Dughmi Announcements Today: Spanning Trees and Flows Flexibility awarded
More informationDynamic Programming: Shortest Paths and DFA to Reg Exps
CS 374: Algorithms & Models of Computation, Spring 207 Dynamic Programming: Shortest Paths and DFA to Reg Exps Lecture 8 March 28, 207 Chandra Chekuri (UIUC) CS374 Spring 207 / 56 Part I Shortest Paths
More informationMathematics for Decision Making: An Introduction. Lecture 13
Mathematics for Decision Making: An Introduction Lecture 13 Matthias Köppe UC Davis, Mathematics February 17, 2009 13 1 Reminder: Flows in networks General structure: Flows in networks In general, consider
More informationAlgorithms: Lecture 12. Chalmers University of Technology
Algorithms: Lecture 1 Chalmers University of Technology Today s Topics Shortest Paths Network Flow Algorithms Shortest Path in a Graph Shortest Path Problem Shortest path network. Directed graph G = (V,
More informationDynamic Programming: Shortest Paths and DFA to Reg Exps
CS 374: Algorithms & Models of Computation, Fall 205 Dynamic Programming: Shortest Paths and DFA to Reg Exps Lecture 7 October 22, 205 Chandra & Manoj (UIUC) CS374 Fall 205 / 54 Part I Shortest Paths with
More information1 Some loose ends from last time
Cornell University, Fall 2010 CS 6820: Algorithms Lecture notes: Kruskal s and Borůvka s MST algorithms September 20, 2010 1 Some loose ends from last time 1.1 A lemma concerning greedy algorithms and
More informationBreadth-First Search of Graphs
Breadth-First Search of Graphs Analysis of Algorithms Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Applications of Breadth-First Search of Graphs a) Single Source
More informationCS 410/584, Algorithm Design & Analysis, Lecture Notes 4
CS 0/58,, Biconnectivity Let G = (N,E) be a connected A node a N is an articulation point if there are v and w different from a such that every path from 0 9 8 3 5 7 6 David Maier Biconnected Component
More informationIntroduction to Algorithms
Introduction to Algorithms, Lecture 5 // Introduction to Algorithms 6.46J/.4J LECTURE Shortest Paths I Properties o shortest paths Dijkstra s Correctness Analysis Breadth-irst Pro. Manolis Kellis March,
More informationCMPS 2200 Fall Carola Wenk Slides courtesy of Charles Leiserson with small changes by Carola Wenk. 10/8/12 CMPS 2200 Intro.
CMPS 00 Fall 01 Single Source Shortest Paths Carola Wenk Slides courtesy of Charles Leiserson with small changes by Carola Wenk 1 Paths in graphs Consider a digraph G = (V, E) with edge-weight function
More informationContents Lecture 4. Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression
Contents Lecture 4 Greedy graph algorithms Dijkstra s algorithm Prim s algorithm Kruskal s algorithm Union-find data structure with path compression Jonas Skeppstedt (jonasskeppstedt.net) Lecture 4 2018
More informationFINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)
FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) The final exam will be on Thursday, May 12, from 8:00 10:00 am, at our regular class location (CSI 2117). It will be closed-book and closed-notes, except
More informationCS781 Lecture 3 January 27, 2011
CS781 Lecture 3 January 7, 011 Greedy Algorithms Topics: Interval Scheduling and Partitioning Dijkstra s Shortest Path Algorithm Minimum Spanning Trees Single-Link k-clustering Interval Scheduling Interval
More informationUndirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11
Undirected Graphs Undirected graph. G = (V, E) V = nodes. E = edges between pairs of nodes. Captures pairwise relationship between objects. Graph size parameters: n = V, m = E. V = {, 2, 3,,,, 7, 8 } E
More informationDiscrete Optimization 2010 Lecture 1 Introduction / Algorithms & Spanning Trees
Discrete Optimization 2010 Lecture 1 Introduction / Algorithms & Spanning Trees Marc Uetz University of Twente m.uetz@utwente.nl Lecture 1: sheet 1 / 43 Marc Uetz Discrete Optimization Outline 1 Introduction
More informationDiscrete Optimization 2010 Lecture 8 Lagrangian Relaxation / P, N P and co-n P
Discrete Optimization 2010 Lecture 8 Lagrangian Relaxation / P, N P and co-n P Marc Uetz University of Twente m.uetz@utwente.nl Lecture 8: sheet 1 / 32 Marc Uetz Discrete Optimization Outline 1 Lagrangian
More informationAnalysis of Algorithms. Outline. Single Source Shortest Path. Andres Mendez-Vazquez. November 9, Notes. Notes
Analysis of Algorithms Single Source Shortest Path Andres Mendez-Vazquez November 9, 01 1 / 108 Outline 1 Introduction Introduction and Similar Problems General Results Optimal Substructure Properties
More informationIntroduction to Algorithms
Introduction to Algorithms 6.046J/8.40J/SMA550 Lecture 7 Prof. Erik Demaine Paths in graphs Consider a digraph G = (V, E) with edge-weight function w : E R. The weight of path p = v v L v k is defined
More informationIntroduction to Algorithms
Introduction to Algorithms 6.046J/18.401J LECTURE 14 Shortest Paths I Properties of shortest paths Dijkstra s algorithm Correctness Analysis Breadth-first search Prof. Charles E. Leiserson Paths in graphs
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 Pearson-Addison Wesley. All rights reserved. 4 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and finishes
More informationThe min cost flow problem Course notes for Optimization Spring 2007
The min cost flow problem Course notes for Optimization Spring 2007 Peter Bro Miltersen February 7, 2007 Version 3.0 1 Definition of the min cost flow problem We shall consider a generalization of the
More informationPreliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}
Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)
More informationProof methods and greedy algorithms
Proof methods and greedy algorithms Magnus Lie Hetland Lecture notes, May 5th 2008 1 Introduction This lecture in some ways covers two separate topics: (1) how to prove algorithms correct, in general,
More informationK-center Hardness and Max-Coverage (Greedy)
IOE 691: Approximation Algorithms Date: 01/11/2017 Lecture Notes: -center Hardness and Max-Coverage (Greedy) Instructor: Viswanath Nagarajan Scribe: Sentao Miao 1 Overview In this lecture, we will talk
More informationIntroduction to Algorithms
Introduction to Algorithms 6.046J/18.401J LECTURE 17 Shortest Paths I Properties of shortest paths Dijkstra s algorithm Correctness Analysis Breadth-first search Prof. Erik Demaine November 14, 005 Copyright
More informationCS 6301 PROGRAMMING AND DATA STRUCTURE II Dept of CSE/IT UNIT V GRAPHS
UNIT V GRAPHS Representation of Graphs Breadth-first search Depth-first search Topological sort Minimum Spanning Trees Kruskal and Prim algorithm Shortest path algorithm Dijkstra s algorithm Bellman-Ford
More informationDiscrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness
Discrete Optimization 2010 Lecture 10 P, N P, and N PCompleteness Marc Uetz University of Twente m.uetz@utwente.nl Lecture 9: sheet 1 / 31 Marc Uetz Discrete Optimization Outline 1 N P and co-n P 2 N P-completeness
More informationDiscrete Optimization 2010 Lecture 7 Introduction to Integer Programming
Discrete Optimization 2010 Lecture 7 Introduction to Integer Programming Marc Uetz University of Twente m.uetz@utwente.nl Lecture 8: sheet 1 / 32 Marc Uetz Discrete Optimization Outline 1 Intro: The Matching
More informationGreedy Algorithms. CSE 101: Design and Analysis of Algorithms Lecture 10
Greedy Algorithms CSE 101: Design and Analysis of Algorithms Lecture 10 CSE 101: Design and analysis of algorithms Greedy algorithms Reading: Kleinberg and Tardos, sections 4.1, 4.2, and 4.3 Homework 4
More information10.3 Matroids and approximation
10.3 Matroids and approximation 137 10.3 Matroids and approximation Given a family F of subsets of some finite set X, called the ground-set, and a weight function assigning each element x X a non-negative
More informationUniversity of Toronto Department of Electrical and Computer Engineering. Final Examination. ECE 345 Algorithms and Data Structures Fall 2016
University of Toronto Department of Electrical and Computer Engineering Final Examination ECE 345 Algorithms and Data Structures Fall 2016 Print your first name, last name, UTORid, and student number neatly
More informationThe min cost flow problem Course notes for Search and Optimization Spring 2004
The min cost flow problem Course notes for Search and Optimization Spring 2004 Peter Bro Miltersen February 20, 2004 Version 1.3 1 Definition of the min cost flow problem We shall consider a generalization
More informationMore Approximation Algorithms
CS 473: Algorithms, Spring 2018 More Approximation Algorithms Lecture 25 April 26, 2018 Most slides are courtesy Prof. Chekuri Ruta (UIUC) CS473 1 Spring 2018 1 / 28 Formal definition of approximation
More informationDijkstra s Single Source Shortest Path Algorithm. Andreas Klappenecker
Dijkstra s Single Source Shortest Path Algorithm Andreas Klappenecker Single Source Shortest Path Given: a directed or undirected graph G = (V,E) a source node s in V a weight function w: E -> R. Goal:
More informationSolutions to Exercises
1/13 Solutions to Exercises The exercises referred to as WS 1.1(a), and so forth, are from the course book: Williamson and Shmoys, The Design of Approximation Algorithms, Cambridge University Press, 2011,
More informationCSE101: Design and Analysis of Algorithms. Ragesh Jaiswal, CSE, UCSD
Greedy s Greedy s Shortest path Claim 2: Let S be a subset of vertices containing s such that we know the shortest path length l(s, u) from s to any vertex in u S. Let e = (u, v) be an edge such that 1
More informationAlgorithm Design and Analysis
Algorithm Design and Analysis LECTURE 8 Greedy Algorithms V Huffman Codes Adam Smith Review Questions Let G be a connected undirected graph with distinct edge weights. Answer true or false: Let e be the
More informationChapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved. 1 Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should
More information6. DYNAMIC PROGRAMMING II
6. DYNAMIC PROGRAMMING II sequence alignment Hirschberg's algorithm Bellman-Ford algorithm distance vector protocols negative cycles in a digraph Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison
More informationCS60020: Foundations of Algorithm Design and Machine Learning. Sourangshu Bhattacharya
CS6000: Foundations of Algorithm Design and Machine Learning Sourangshu Bhattacharya Paths in graphs Consider a digraph G = (V, E) with edge-weight function w : E R. The weight of path p = v 1 v L v k
More informationNetwork Design and Game Theory Spring 2008 Lecture 2
Network Design and Game Theory Spring 2008 Lecture 2 Instructor: Mohammad T. Hajiaghayi Scribe: Imdadullah Khan February 04, 2008 MAXIMUM COVERAGE In this lecture we review Maximum Coverage and Unique
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.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and
More informationPartha Sarathi Mandal
MA 252: Data Structures and Algorithms Lecture 32 http://www.iitg.ernet.in/psm/indexing_ma252/y12/index.html Partha Sarathi Mandal Dept. of Mathematics, IIT Guwahati The All-Pairs Shortest Paths Problem
More informationdirected weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time
Network Flow 1 The Maximum-Flow Problem directed weighted graphs as flow networks the Ford-Fulkerson algorithm termination and running time 2 Maximum Flows and Minimum Cuts flows and cuts max flow equals
More informationIS 709/809: Computational Methods in IS Research Fall Exam Review
IS 709/809: Computational Methods in IS Research Fall 2017 Exam Review Nirmalya Roy Department of Information Systems University of Maryland Baltimore County www.umbc.edu Exam When: Tuesday (11/28) 7:10pm
More informationDiscrete Optimization 2010 Lecture 12 TSP, SAT & Outlook
Discrete Optimization 2010 Lecture 12 TSP, SAT & Outlook Marc Uetz University of Twente m.uetz@utwente.nl Lecture 12: sheet 1 / 29 Marc Uetz Discrete Optimization Outline TSP Randomization Outlook 1 Approximation
More informationACO Comprehensive Exam 19 March Graph Theory
1. Graph Theory Let G be a connected simple graph that is not a cycle and is not complete. Prove that there exist distinct non-adjacent vertices u, v V (G) such that the graph obtained from G by deleting
More information6. DYNAMIC PROGRAMMING II. sequence alignment Hirschberg's algorithm Bellman-Ford distance vector protocols negative cycles in a digraph
6. DYNAMIC PROGRAMMING II sequence alignment Hirschberg's algorithm Bellman-Ford distance vector protocols negative cycles in a digraph Shortest paths Shortest path problem. Given a digraph G = (V, E),
More informationTrees. A tree is a graph which is. (a) Connected and. (b) has no cycles (acyclic).
Trees A tree is a graph which is (a) Connected and (b) has no cycles (acyclic). 1 Lemma 1 Let the components of G be C 1, C 2,..., C r, Suppose e = (u, v) / E, u C i, v C j. (a) i = j ω(g + e) = ω(g).
More informationMore on NP and Reductions
Indian Institute of Information Technology Design and Manufacturing, Kancheepuram Chennai 600 127, India An Autonomous Institute under MHRD, Govt of India http://www.iiitdm.ac.in COM 501 Advanced Data
More information1 Matroid intersection
CS 369P: Polyhedral techniques in combinatorial optimization Instructor: Jan Vondrák Lecture date: October 21st, 2010 Scribe: Bernd Bandemer 1 Matroid intersection Given two matroids M 1 = (E, I 1 ) and
More informationRunning Time. Assumption. All capacities are integers between 1 and C.
Running Time Assumption. All capacities are integers between and. Invariant. Every flow value f(e) and every residual capacities c f (e) remains an integer throughout the algorithm. Theorem. The algorithm
More informationCSE 431/531: Analysis of Algorithms. Dynamic Programming. Lecturer: Shi Li. Department of Computer Science and Engineering University at Buffalo
CSE 431/531: Analysis of Algorithms Dynamic Programming Lecturer: Shi Li Department of Computer Science and Engineering University at Buffalo Paradigms for Designing Algorithms Greedy algorithm Make a
More informationAPPROXIMATION ALGORITHMS RESOLUTION OF SELECTED PROBLEMS 1
UNIVERSIDAD DE LA REPUBLICA ORIENTAL DEL URUGUAY IMERL, FACULTAD DE INGENIERIA LABORATORIO DE PROBABILIDAD Y ESTADISTICA APPROXIMATION ALGORITHMS RESOLUTION OF SELECTED PROBLEMS 1 STUDENT: PABLO ROMERO
More informationCMPSCI 611: Advanced Algorithms
CMPSCI 611: Advanced Algorithms Lecture 12: Network Flow Part II Andrew McGregor Last Compiled: December 14, 2017 1/26 Definitions Input: Directed Graph G = (V, E) Capacities C(u, v) > 0 for (u, v) E and
More informationMA015: Graph Algorithms
MA015 3. Minimum cuts 1 MA015: Graph Algorithms 3. Minimum cuts (in undirected graphs) Jan Obdržálek obdrzalek@fi.muni.cz Faculty of Informatics, Masaryk University, Brno All pairs flows/cuts MA015 3.
More information16.1 Min-Cut as an LP
600.469 / 600.669 Approximation Algorithms Lecturer: Michael Dinitz Topic: LPs as Metrics: Min Cut and Multiway Cut Date: 4//5 Scribe: Gabriel Kaptchuk 6. Min-Cut as an LP We recall the basic definition
More informationA combinatorial algorithm minimizing submodular functions in strongly polynomial time
A combinatorial algorithm minimizing submodular functions in strongly polynomial time Alexander Schrijver 1 Abstract We give a strongly polynomial-time algorithm minimizing a submodular function f given
More informationIntroduction to Algorithms
Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 18 Prof. Erik Demaine Negative-weight cycles Recall: If a graph G = (V, E) contains a negativeweight cycle, then some shortest paths may not exist.
More informationDiscrete Optimization Lecture 5. M. Pawan Kumar
Discrete Optimization Lecture 5 M. Pawan Kumar pawan.kumar@ecp.fr Exam Question Type 1 v 1 s v 0 4 2 1 v 4 Q. Find the distance of the shortest path from s=v 0 to all vertices in the graph using Dijkstra
More informationLecture 7: Shortest Paths in Graphs with Negative Arc Lengths. Reading: AM&O Chapter 5
Lecture 7: Shortest Paths in Graphs with Negative Arc Lengths Reading: AM&O Chapter Label Correcting Methods Assume the network G is allowed to have negative arc lengths but no directed negativelyweighted
More informationICS 252 Introduction to Computer Design
ICS 252 fall 2006 Eli Bozorgzadeh Computer Science Department-UCI References and Copyright Textbooks referred [Mic94] G. De Micheli Synthesis and Optimization of Digital Circuits McGraw-Hill, 1994. [CLR90]
More informationMathematics for Decision Making: An Introduction. Lecture 8
Mathematics for Decision Making: An Introduction Lecture 8 Matthias Köppe UC Davis, Mathematics January 29, 2009 8 1 Shortest Paths and Feasible Potentials Feasible Potentials Suppose for all v V, there
More informationChapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.
Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved. 1 P and NP P: The family of problems that can be solved quickly in polynomial time.
More informationDiscrete Optimization 2010 Lecture 12 TSP, SAT & Outlook
TSP Randomization Outlook Discrete Optimization 2010 Lecture 12 TSP, SAT & Outlook Marc Uetz University of Twente m.uetz@utwente.nl Lecture 12: sheet 1 / 29 Marc Uetz Discrete Optimization Outline TSP
More information1 Perfect Matching and Matching Polytopes
CS 598CSC: Combinatorial Optimization Lecture date: /16/009 Instructor: Chandra Chekuri Scribe: Vivek Srikumar 1 Perfect Matching and Matching Polytopes Let G = (V, E be a graph. For a set E E, let χ E
More informationCSE 417. Chapter 4: Greedy Algorithms. Many Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
CSE 417 Chapter 4: Greedy Algorithms Many Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Greed is good. Greed is right. Greed works. Greed clarifies, cuts through,
More informationUNIVERSITY OF YORK. MSc Examinations 2004 MATHEMATICS Networks. Time Allowed: 3 hours.
UNIVERSITY OF YORK MSc Examinations 2004 MATHEMATICS Networks Time Allowed: 3 hours. Answer 4 questions. Standard calculators will be provided but should be unnecessary. 1 Turn over 2 continued on next
More informationMaximum Flow Problem (Ford and Fulkerson, 1956)
Maximum Flow Problem (Ford and Fulkerson, 196) In this problem we find the maximum flow possible in a directed connected network with arc capacities. There is unlimited quantity available in the given
More informationBreadth First Search, Dijkstra s Algorithm for Shortest Paths
CS 374: Algorithms & Models of Computation, Spring 2017 Breadth First Search, Dijkstra s Algorithm for Shortest Paths Lecture 17 March 1, 2017 Chandra Chekuri (UIUC) CS374 1 Spring 2017 1 / 42 Part I Breadth
More informationBranch-and-Bound for the Travelling Salesman Problem
Branch-and-Bound for the Travelling Salesman Problem Leo Liberti LIX, École Polytechnique, F-91128 Palaiseau, France Email:liberti@lix.polytechnique.fr March 15, 2011 Contents 1 The setting 1 1.1 Graphs...............................................
More informationAPTAS for Bin Packing
APTAS for Bin Packing Bin Packing has an asymptotic PTAS (APTAS) [de la Vega and Leuker, 1980] For every fixed ε > 0 algorithm outputs a solution of size (1+ε)OPT + 1 in time polynomial in n APTAS for
More informationDynamic Programming. Data Structures and Algorithms Andrei Bulatov
Dynamic Programming Data Structures and Algorithms Andrei Bulatov Algorithms Dynamic Programming 18-2 Weighted Interval Scheduling Weighted interval scheduling problem. Instance A set of n jobs. Job j
More informationNATIONAL UNIVERSITY OF SINGAPORE CS3230 DESIGN AND ANALYSIS OF ALGORITHMS SEMESTER II: Time Allowed 2 Hours
NATIONAL UNIVERSITY OF SINGAPORE CS3230 DESIGN AND ANALYSIS OF ALGORITHMS SEMESTER II: 2017 2018 Time Allowed 2 Hours INSTRUCTIONS TO STUDENTS 1. This assessment consists of Eight (8) questions and comprises
More informationShortest paths with negative lengths
Chapter 8 Shortest paths with negative lengths In this chapter we give a linear-space, nearly linear-time algorithm that, given a directed planar graph G with real positive and negative lengths, but no
More informationDuality of LPs and Applications
Lecture 6 Duality of LPs and Applications Last lecture we introduced duality of linear programs. We saw how to form duals, and proved both the weak and strong duality theorems. In this lecture we will
More informationLecture 4: An FPTAS for Knapsack, and K-Center
Comp 260: Advanced Algorithms Tufts University, Spring 2016 Prof. Lenore Cowen Scribe: Eric Bailey Lecture 4: An FPTAS for Knapsack, and K-Center 1 Introduction Definition 1.0.1. The Knapsack problem (restated)
More informationGreedy Algorithms. Kleinberg and Tardos, Chapter 4
Greedy Algorithms Kleinberg and Tardos, Chapter 4 1 Selecting breakpoints Road trip from Fort Collins to Durango on a given route. Fuel capacity = C. Goal: makes as few refueling stops as possible. Greedy
More informationFlows. Chapter Circulations
Chapter 4 Flows For a directed graph D = (V,A), we define δ + (U) := {(u,v) A : u U,v / U} as the arcs leaving U and δ (U) := {(u,v) A u / U,v U} as the arcs entering U. 4. Circulations In a directed graph
More informationACO Comprehensive Exam March 20 and 21, Computability, Complexity and Algorithms
1. Computability, Complexity and Algorithms Part a: You are given a graph G = (V,E) with edge weights w(e) > 0 for e E. You are also given a minimum cost spanning tree (MST) T. For one particular edge
More informationProblem set 1. (c) Is the Ford-Fulkerson algorithm guaranteed to produce an acyclic maximum flow?
CS261, Winter 2017. Instructor: Ashish Goel. Problem set 1 Electronic submission to Gradescope due 11:59pm Thursday 2/2. Form a group of 2-3 students that is, submit one homework with all of your names.
More informationLecture notes on the ellipsoid algorithm
Massachusetts Institute of Technology Handout 1 18.433: Combinatorial Optimization May 14th, 007 Michel X. Goemans Lecture notes on the ellipsoid algorithm The simplex algorithm was the first algorithm
More information1 Submodular functions
CS 369P: Polyhedral techniques in combinatorial optimization Instructor: Jan Vondrák Lecture date: November 16, 2010 1 Submodular functions We have already encountered submodular functions. Let s recall
More informationLecture 11. Single-Source Shortest Paths All-Pairs Shortest Paths
Lecture. Single-Source Shortest Paths All-Pairs Shortest Paths T. H. Cormen, C. E. Leiserson and R. L. Rivest Introduction to, rd Edition, MIT Press, 009 Sungkyunkwan University Hyunseung Choo choo@skku.edu
More informationCS 374: Algorithms & Models of Computation, Spring 2017 Greedy Algorithms Lecture 19 April 4, 2017 Chandra Chekuri (UIUC) CS374 1 Spring / 1
CS 374: Algorithms & Models of Computation, Spring 2017 Greedy Algorithms Lecture 19 April 4, 2017 Chandra Chekuri (UIUC) CS374 1 Spring 2017 1 / 1 Part I Greedy Algorithms: Tools and Techniques Chandra
More information7.4 DO (uniqueness of minimum-cost spanning tree) Prove: if all edge weights are distinct then the minimum-cost spanning tree is unique.
Algorithms CMSC-700 http://alg1.cs.uchicago.edu Homework set #7. Posted -19. Due Wednesday, February, 01 The following problems were updated on -0: 7.1(a), 7.1(b), 7.9(b) Read the homework instructions
More informationDiscrete Optimization
Prof. Friedrich Eisenbrand Martin Niemeier Due Date: April 15, 2010 Discussions: March 25, April 01 Discrete Optimization Spring 2010 s 3 You can hand in written solutions for up to two of the exercises
More information