1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014.

Slides:



Advertisements
Similar presentations
Greedy Algorithms Greed is good. (Some of the time)
Advertisements

1 Discrete Structures & Algorithms Graphs and Trees: III EECE 320.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
IKI 10100: Data Structures & Algorithms Ruli Manurung (acknowledgments to Denny & Ade Azurat) 1 Fasilkom UI Ruli Manurung (Fasilkom UI)IKI10100: Lecture10.
Minimum Spanning Trees
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Lectures on Network Flows
Data Structures, Spring 2004 © L. Joskowicz 1 Data Structures – LECTURE 13 Minumum spanning trees Motivation Properties of minimum spanning trees Kruskal’s.
Graph Algorithms: Minimum Spanning Tree We are given a weighted, undirected graph G = (V, E), with weight function w:
CS138A Network Flows Peter Schröder. CS138A Flow Networks Definitions a flow network G=(V,E) is a directed graph in which each edge (u,v)
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
1 -1 Chapter 1 Introduction Why Do We Need to Study Algorithms? To learn strategies to design efficient algorithms. To understand the difficulty.
Spanning Trees.
Spanning Trees. 2 Spanning trees Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges.
1 Augmenting Path Algorithm s t G: Flow value = 0 0 flow capacity.
Greedy Algorithms Reading Material: Chapter 8 (Except Section 8.5)
Maximum Flows Lecture 4: Jan 19. Network transmission Given a directed graph G A source node s A sink node t Goal: To send as much information from s.
T,  e  T c(e) = 50 G = (V, E), c(e) Minimum Spanning Tree.
Greedy Algorithms Like dynamic programming algorithms, greedy algorithms are usually designed to solve optimization problems Unlike dynamic programming.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 11 Instructor: Paul Beame.
CSE 373, Copyright S. Tanimoto, 2002 Up-trees - 1 Up-Trees Review of the UNION-FIND ADT Straight implementation with Up-Trees Path compression Worst-case.
Spanning Trees. Spanning trees Suppose you have a connected undirected graph –Connected: every node is reachable from every other node –Undirected: edges.
Minimum Spanning Trees
Minimum Spanning Trees. Subgraph A graph G is a subgraph of graph H if –The vertices of G are a subset of the vertices of H, and –The edges of G are a.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
1 CPSC 320: Intermediate Algorithm Design and Analysis July 25, 2014.
0 Course Outline n Introduction and Algorithm Analysis (Ch. 2) n Hash Tables: dictionary data structure (Ch. 5) n Heaps: priority queue data structures.
MST and Max Flow CS3233. Overview Two Graph Problems Minimum Spanning Tree Maximum Flow/Minimum Cut Problem One Data Structure Disjoint Sets.
Maximization of Network Survivability against Intelligent and Malicious Attacks (Cont’d) Presented by Erion Lin.
Network Flow How to solve maximal flow and minimal cut problems.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 11, 2014.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 28, 2014.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 21, 2014.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 9, 2014.
Minimum Spanning Trees Easy. Terms Node Node Edge Edge Cut Cut Cut respects a set of edges Cut respects a set of edges Light Edge Light Edge Minimum Spanning.
Network Flow. Network flow formulation A network G = (V, E). Capacity c(u, v)  0 for edge (u, v). Assume c(u, v) = 0 if (u, v)  E. Source s and sink.
Union-find Algorithm Presented by Michael Cassarino.
CS223 Advanced Data Structures and Algorithms 1 Review for Final Neil Tang 04/27/2010.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 16, 2014.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Union-Find  Application in Kruskal’s Algorithm  Optimizing Union and Find Methods.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
Outline Standard 2-way minimum graph cut problem. Applications to problems in computer vision Classical algorithms from the theory literature A new algorithm.
© The McGraw-Hill Companies, Inc., Chapter 1 Introduction.
Lecture 19 Minimal Spanning Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 20: Graphs. Objectives In this chapter, you will: – Learn about graphs – Become familiar with the basic terminology of graph theory – Discover.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 30, 2014.
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Network Flow.
Minimum Spanning Tree Chapter 13.6.
Minimum Spanning Trees
Lectures on Network Flows
Network Flow.
Topological Sort (topological order)
CMSC 341 Lecture 24 Max Flow Prof. Neary
Hannah Tang and Brian Tjaden Summer Quarter 2002
Augmenting Path Algorithm
CSE 373: Data Structures and Algorithms
EE5900 Advanced Embedded System For Smart Infrastructure
Network Flow.
Lecture 21 Network Flow, Part 1
Augmenting Path Algorithm
Minimum spanning trees
Maximum Flow Neil Tang 4/8/2008
Network Flow.
Spanning Tree.
Review for Final Neil Tang 05/01/2008
Presentation transcript:

1 CPSC 320: Intermediate Algorithm Design and Analysis July 14, 2014

2 Course Outline Introduction and basic concepts Asymptotic notation Greedy algorithms Graph theory Amortized analysis Recursion Divide-and-conquer algorithms Randomized algorithms Dynamic programming algorithms NP-completeness

3 Maximum Flow Problem

4 Maximum Flow Assume a directed graph where each edge has a capacity Assume two nodes (source and sink) Problem: find a flow from source to sink that uses maximum possible value In any node (except source and sink) incoming flow equals outgoing flow Application: Flow of materials from a system to a client (e.g., water pipes) Flow of electrical current through a network Transportation of goods

5 Maximum Flow – Formal Definitions

6 Ford-Fulkerson Method

7 Residual Network

8 Flow augmentation

9 Augmenting path

10 Ford-Fulkerson Algorithm

11 Minimum Cut Cut: partition of the nodes of a graph such that two nodes are in different subsets Capacity of the cut: sum of the capacities of all cut edges in one direction Minimum cut: cut with minimum capacity Applications: Network reliability evaluation

12 Minimum Cut – Formal Definitions

13 Relationship between flow and cut

14 Minimum Spanning Tree

15 Spanning Tree

16 Example

17 Strategies Prim’s method: Start with a randomly selected node Pick smallest cost edge connecting visited node to a new node Add it to the tree Repeat until tree is complete Kruskal’s method: Start with all nodes isolated and no edges Pick smallest cost edge left that doesn’t create a cycle Add it to the tree Repeat until tree is complete

18 Kruskal’s Algorithm

19 Time Complexity

20 Union-Find Data Structure

21 Union-Find Data Structure

22 Array implementation

23 Tree implementation

24 Tree implementation (cont.) Path compression: When find is performed, every node in the path is updated to point to root What is the bound for find now?

25 Cost claims

26 Amortized Analysis

27 Amortized cost

28 Array Implementation of Union-Find

29 Push/Multipop Stack

30 Push/Multipop Stack

31 Potential Method (aka Accounting Method)

32 Example

33 Binary Counter

34 Union-Find with Path Compression