Special Graphs: Modeling and Algorithms

Slides:



Advertisements
Similar presentations
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 8 Network models.
Advertisements

Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Midterm <  70 3.
Introduction To Algorithms CS 445 Discussion Session 8 Instructor: Dr Alon Efrat TA : Pooja Vaswani 04/04/2005.
Network Optimization Models: Maximum Flow Problems
The Maximum Network Flow Problem. CSE Network Flows.
Chapter 10: Iterative Improvement The Maximum Flow Problem The Design and Analysis of Algorithms.
Lectures on Network Flows
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Minimum Cost Flow Lecture 5: Jan 25. Problems Recap Bipartite matchings General matchings Maximum flows Stable matchings Shortest paths Minimum spanning.
Lecture 11. Matching A set of edges which do not share a vertex is a matching. Application: Wireless Networks may consist of nodes with single radios,
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 5 Wednesday, 10/6/04 Graph Algorithms: Part 2.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
MAX FLOW CS302, Spring 2013 David Kauchak. Admin.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
Computer Science 112 Fundamentals of Programming II Introduction to Graphs.
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
MST and Max Flow CS3233. Overview Two Graph Problems Minimum Spanning Tree Maximum Flow/Minimum Cut Problem One Data Structure Disjoint Sets.
Network Flow How to solve maximal flow and minimal cut problems.
CS 473Lecture ?1 CS473-Algorithms I Lecture ? Network Flows Finding Max Flow.
Data Structures & Algorithms Graphs
CS 4407, Algorithms University College Cork, Gregory M. Provan Network Optimization Models: Maximum Flow Problems In this handout: The problem statement.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
CS 361 – Chapter 16 Final thoughts on minimum spanning trees and similar problems Flow networks Commitment: –Decide on presentation order.
Honors Track: Competitive Programming & Problem Solving Fun with Graphs II Kevin Verbeek.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Homework #5 Due: October 31, 2000 Christine Kang Graph Concepts and Algorithms.
and 6.855J March 6, 2003 Maximum Flows 2. 2 Network Reliability u Communication Network u What is the maximum number of arc disjoint paths from.
Graph Algorithms Maximum Flow - Best algorithms [Adapted from R.Solis-Oba]
Graph Concepts Elif Tosun 252a-aa (All graphics created by using demo/graphwin/gw*)
Prof. Swarat Chaudhuri COMP 382: Reasoning about Algorithms Fall 2015.
Iterative Improvement for Domain-Specific Problems Lecturer: Jing Liu Homepage:
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.
Maximum Flow - Anil Kishore Graph Theory Basics. Prerequisites What is a Graph Directed, Weighted graphs How to traverse a graph using – Depth First Search.
5.6 Prefix codes and optimal tree Definition 31: Codes with this property which the bit string for a letter never occurs as the first part of the bit string.
The Maximum Network Flow Problem
Network Flow.
School of Computing Clemson University Fall, 2012
BIPARTITE GRAPHS AND ITS APPLICATIONS
CS4234 Optimiz(s)ation Algorithms
Graph theory Definitions Trees, cycles, directed graphs.
Algorithms and Networks
Maximum Flow - Best algorithms
Algorithm Design and Analysis
Lectures on Network Flows
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.
Network Flow.
Greedy Algorithms / Minimum Spanning Tree Yin Tat Lee
Topological Sort (topological order)
Bipartite Matching and Other Graph Algorithms
The Taxi Scheduling Problem
Graph Algorithm.
Introduction Basic formulations Applications
Lecture 19-Problem Solving 4 Incremental Method
R. Johnsonbaugh Discrete Mathematics 5th edition, 2001
Vertex Covers, Matchings, and Independent Sets
Problem Solving 4.
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Flow Networks and Bipartite Matching
Piyush Kumar (Lecture 6: MaxFlow MinCut Applications)
Algorithms (2IL15) – Lecture 7
離散數學 DISCRETE and COMBINATORIAL MATHEMATICS
Text Book: Introduction to algorithms By C L R S
Network Flow.
Special Graphs: Modeling and Algorithms
Network Flow.
Maximum Bipartite Matching
Vertex Covers and Matchings
Presentation transcript:

Special Graphs: Modeling and Algorithms

Flow graph modeling Often, recognizing a task as network flow is biggest challenge. Example: Some number of users brings a set of applications (label ‘A’ to ‘Z’) to be run. There are 10 computers that can run applications (1 per day). Applications can only run on certain computers Create nodes for each application, each computer Create single source and single sink Create edge from source to each application node Set weight as the number of that application submitted by users Create edge from application node to computer nodes that can run it Weight can be 1, since only 1 program can run per computer Create edge from computer nodes to the sink Weight is 1, since each can run one program.

Another example (UVA problem 11380) – Titanic sinking Grid of values: water (impassible) – ice with a person on it (will disappear once they leave), ice a person can move to (but will sink once they leave), iceberg (can hold people but not permanently), large wood (can hold people for safety, but only limited number) Create graph connecting adjacent nodes, high edge capacity Set node capacity for ice to 1 Create a source to all nodes with starting people (high edge weight) Create a sink from all wood nodes with weight equal to max. wood capacity.

Bipartite graph and Bipartite matching Divide into two groups, A and B All edges are from something in group A to something in group B Bipartite matching Want to uniquely match one item from group A with one item in group B Called Maximum Cardinality Bipartite Matching (MCBM) Notice: Bipartite matching must have bipartite graph where |A| = |B| Given a bipartite graph, can do analysis to find a MCBM

Maximum Cardinality Bipartite Matching Assign a source with an edge to every vertex in set 1 Assign a sink with an edge from every vertex in set 2 Run Max Flow If it can find flow of amount equal to |A| (and therefore |B|), we have a match If sets are unequal size, will find the best possible match (all of one should match to something from other, if possible)

Max Independent Set and Min Vertex Cover Independent Set: no two vertices in set have edge between them Vertex Cover: every vertex is adjacent to some vertex in the set Number of vertices in min vertex cover is number in MCBM Number of vertices in max independent set is total number minus number in MCBM Note that finding these is a little different (but can use the MCBM matching for this)

MCBM with Augmenting Paths Start at a free vertex (on “left”) Find a free edge to a vertex on “right”. Assume it is already matched. Follow the matched edge back to the “left” Repeat until reaching a free vertex on the right Then, reverse the order of all edges visited (from “free” <-> “matched” Easy to implement (relatively) and fast enough on most cases.

Edge-disjoint paths Paths in graphs – how many paths do not share an edge Convert each edge to a unit-weight edge If the graph is undirected, form two edges for each (one per direction) Max flow in the graph is the number of edge-disjoint paths

Circulation Each node has either supply or demand, edges have capacity Create a new source with edges to the nodes with supply Edge weights are the amount of supply (negated) Create a new sink with edges from the nodes with demand Edge weights are the amount of demand Then, just run max flow! Several problems can be modeled as circulation problems

Other Graph Types DAG (Directed Acyclic Graph): Tree Eulerian Graph Graph with an Eulerian path or tour: visits each edge exactly once Several algorithms can be simplified if the graph is of one of these types See book for examples