CSE 421 Algorithms Richard Anderson Lecture 26 Network Flow Applications.

Slides:



Advertisements
Similar presentations
Minimum Spanning Tree Sarah Brubaker Tuesday 4/22/8.
Advertisements

1 Maximum flow sender receiver Capacity constraint Lecture 6: Jan 25.
Network Flow CS494/594 – Graph Theory Alexander Sayers.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
Five Problems CSE 421 Richard Anderson Winter 2009, Lecture 3.
Verifying Segment Relations
CSE 421 Algorithms Richard Anderson Lecture 23 Network Flow Applications.
Foreground/Background Image Segmentation. What is our goal? To label each pixel in an image as belonging to either the foreground of the scene or the.
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Introduction to Graph Theory Lecture 19: Digraphs and Networks.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
7.7 Extensions to Max Flow. 2 Circulation with Demands Circulation with demands. n Directed graph G = (V, E). n Edge capacities c(e), e  E. n Node supply.
Maximum Flow Applications
Applications of Network Flow Problem. 7.5 Bipartite Matching.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CS/ENGRD 2110 Object-Oriented Programming and Data Structures Fall 2014 Doug James Lecture 17: Graphs.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
CSEP 521 Applied Algorithms
Advanced Algorithms Piyush Kumar (Lecture 4: MaxFlow MinCut Applications) Welcome to COT5405.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 26.
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
Chapter 4 sections 1 and 2.  Fig. 1  Not connected  All vertices are even.  Fig. 2  Connected  All vertices are even.
Do Now 3/13/12 Take out HW from last night. Take out HW from last night.  Text p. 307, #2-32 evens Copy HW in your planner. Copy HW in your planner. 
Geometry: Plane Figures Chapter. point A point marks a location. A A B B line segment the part of the line between 2 points endpoints.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 23.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
CSE 421 Algorithms Richard Anderson Lecture 22 Network Flow.
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
1 Chapter 7 Network Flow Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
CS 312: Algorithm Design & Analysis Lecture #29: Network Flow and Cuts This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported.
The graph is neither Eulerian or Semi – Eulerian as it has 4 ODD vertices.
Algorithms Classroom Activities Richard Anderson University of Washington July 3, 20081IUCEE: Algorithm Activities.
Graphs Lecture 19 CS2110 – Spring 2013.
Basic Concepts Graphs For more notes and topics visit:
6.2 Properties of Parallelograms
Richard Anderson Lecture 29 NP-Completeness and course wrap-up
Spanning Trees.
Richard Anderson Lecture 23 Network Flow
Maximum Flow 9/13/2018 6:12 PM Presentation for use with the textbook, Algorithm Design and Applications, by M. T. Goodrich and R. Tamassia, Wiley, 2015.
Combinations COURSE 3 LESSON 11-3
Set up ratios: = = Fill in ratios: Solve the proportion: =
The Taxi Scheduling Problem
CSCE350 Algorithms and Data Structure
Richard Anderson Lecture 23 Network Flow Applications
CSE373: Data Structures & Algorithms Lecture 12: Minimum Spanning Trees Catie Baker Spring 2015.
Richard Anderson Lecture 27 Network Flow Applications
CSE373: Data Structures & Algorithms Lecture 20: Minimum Spanning Trees Linda Shapiro Spring 2016.
Richard Anderson Lecture 24 Network Flow Applications
Chapter 9: Graphs Basic Concepts
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 23 Network Flow
Richard Anderson Lecture 21 Network Flow
Richard Anderson Lecture 30 NP-Completeness
Richard Anderson Lecture 25 Network Flow Applications
AB AC AD AE AF 5 ways If you used AB, then, there would be 4 remaining ODD vertices (C, D, E and F) CD CE CF 3 ways If you used CD, then, there.
3-5 Slopes of Lines Warm Up Lesson Presentation Lesson Quiz
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Algorithms (2IL15) – Lecture 7
Lecture 21 Network Flow, Part 1
Richard Anderson Lecture 22 Network Flow
Lecture 21 Network Flow, Part 1
Kruskal’s Algorithm AQR.
Richard Anderson Lecture 23 Network Flow Applications
Richard Anderson Lecture 24 Network Flow Applications
Chapter 9: Graphs Basic Concepts
Richard Anderson Lecture 22 Network Flow
Lecture 23: Minimum Spanning Trees
Homework Solutions.
Presentation transcript:

CSE 421 Algorithms Richard Anderson Lecture 26 Network Flow Applications

Today’s topics More network flow reductions –Airplane scheduling –Image segmentation –Baseball elimination

Airplane Scheduling Given an airline schedule, and starting locations for the planes, is it possible to use a fixed set of planes to satisfy the schedule. Schedule –[segments] Departure, arrival pairs (cities and times) Approach –Construct a circulation problem where paths of flow give segments flown by each plane

Example Seattle->San Francisco, 9:00 – 11:00 Seattle->Denver, 8:00 – 11:00 San Francisco -> Los Angeles, 13:00 – 14:00 Salt Lake City -> Los Angeles, 15:00-17:00 San Diego -> Seattle, 17:30-> 20:00 Los Angeles -> Seattle, 18:00->20:00 Flight times: –Denver->Salt Lake City, 2 hours –Los Angeles->San Diego, 1 hour Can this schedule be full filled with two planes, starting from Seattle?

Compatible segments Segments S 1 and S 2 are compatible if the same plane can be used on S 1 and S 2 –End of S 1 equals start of S 2, and enough time for turn around between arrival and departure times –End of S 1 is different from S 2, but there is enough time to fly between cities

Each segment, S i, is represented as a pair of vertices (d i, a i, for departure and arrival), with an edge between them. Add an edge between a i and d j if S i is compatible with S j. Graph representation didi aiai aiai djdj

Setting up a flow problem didi aiai aiai djdj PiPi P’ i 1,1 0,1 1

Result The planes can satisfy the schedule iff there is a feasible circulation

Image Segmentation Separate foreground from background

Image analysis a i : value of assigning pixel i to the foreground b i : value of assigning pixel i to the background p ij : penalty for assigning i to the foreground, j to the background or vice versa A: foreground, B: background Q(A,B) =  {i in A} a i +  {j in B} b j -  {(i,j) in E, i in A, j in B} p ij

Pixel graph to flow graph s t

Mincut Construction uv s t bvbv avav p uv p vu

Baseball elimination Can the Dinosaurs win the league? Remaining games: –AB, AC, AD, AD, AD, BC, BC, BC, BD, CD WL Ants42 Bees42 Cockroaches33 Dinosaurs15 A team wins the league if it has strictly more wins than any other team at the end of the season A team ties for first place if no team has more wins, and there is some other team with the same number of wins

Baseball elimination Can the Fruit Flies win the league? Remaining games: –AC, AD, AD, AD, AF, BC, BC, BC, BC, BC, BD, BE, BE, BE, BE, BF, CE, CE, CE, CF, CF, DE, DF, EF, EF WL Ants1712 Bees167 Cockroaches167 Dinosaurs1413 Earthworms1410 Fruit Flies1215

Assume Fruit Flies win remaining games Fruit Flies are tied for first place if no team wins more than 19 games Allowable wins –Ants (2) –Bees (3) –Cockroaches (3) –Dinosaurs (5) –Earthworms (5) 18 games to play –AC, AD, AD, AD, BC, BC, BC, BC, BC, BD, BE, BE, BE, BE, CE, CE, CE, DE WL Ants1713 Bees168 Cockroaches169 Dinosaurs14 Earthworms1412 Fruit Flies1915

Remaining games AC, AD, AD, AD, BC, BC, BC, BC, BC, BD, BE, BE, BE, BE, CE, CE, CE, DE s ACADBCBDBE CE ABCD E T DE

Network flow applications summary Bipartite Matching Disjoint Paths Airline Scheduling Survey Design Baseball Elimination Project Selection Image Segmentation