NETWORK FLOWS Shruti Aggrawal Preeti Palkar. Requirements 1.Implement the Ford-Fulkerson algorithm for computing network flow in bipartite graphs. 2.For.

Slides:



Advertisements
Similar presentations
Maximum flow Main goals of the lecture:
Advertisements

CS203 Lecture 15.
Lecture 5: Network Flow Algorithms Max-Flow Min-Cut Single-Source Shortest-Path (SSSP) Job Sequencing.
Graphs COP Graphs  Train Lines Gainesville OcalaDeltona Daytona Melbourne Lakeland Tampa Orlando.
Depth-First Search1 Part-H2 Depth-First Search DB A C E.
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 27 Graphs and Applications.
Graphs Chapter 12. Chapter Objectives  To become familiar with graph terminology and the different types of graphs  To study a Graph ADT and different.
Liang, Introduction to Java Programming, Seventh Edition, (c) 2009 Pearson Education, Inc. All rights reserved Chapter 27 Graph Applications.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 excerpts Graphs (breadth-first-search)
Jeffrey D. Ullman Stanford University Flow Graph Theory.
1 Maximum Flow w s v u t z 3/33/3 1/91/9 1/11/1 3/33/3 4/74/7 4/64/6 3/53/5 1/11/1 3/53/5 2/22/2 
ITEC200 – Week 12 Graphs. 2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
Spring 2010CS 2251 Graphs Chapter 10. Spring 2010CS 2252 Chapter Objectives To become familiar with graph terminology and the different types of graphs.
©Brooks/Cole, 2003 Chapter 12 Abstract Data Type.
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.
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,
Lecture 6: Point Location Computational Geometry Prof. Dr. Th. Ottmann 1 Point Location 1.Trapezoidal decomposition. 2.A search structure. 3.Randomized,
Graphs & Graph Algorithms Nelson Padua-Perez Bill Pugh Department of Computer Science University of Maryland, College Park.
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,
Maximum Flow Maximum Flow Problem The Ford-Fulkerson method
C o n f i d e n t i a l HOME NEXT Subject Name: Data Structure Using C Unit Title: Graphs.
Tree.
UNC Chapel Hill M. C. Lin Point Location Reading: Chapter 6 of the Textbook Driving Applications –Knowing Where You Are in GIS Related Applications –Triangulation.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Lecture 5: Network Flow Algorithms Single-Source Shortest-Path (SSSP) (Dijkstra's Algorithm) Max Flow - Min Cut (Ford-Fulkerson) Job Sequencing.
Representing and Using Graphs
Network Flow How to solve maximal flow and minimal cut problems.
Graphs. Made up of vertices and arcs Digraph (directed graph) –All arcs have arrows that give direction –You can only traverse the graph in the direction.
Liang, Introduction to Java Programming, Ninth Edition, (c) 2013 Pearson Education, Inc. All rights reserved. 1 Chapter 30 Graphs and Applications.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
Graphs Chapter 12. Chapter 12: Graphs2 Chapter Objectives To become familiar with graph terminology and the different types of graphs To study a Graph.
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.
Announcements Finish up Network Flow today Then Review for Final on Monday ◦ HW#5 is due on Monday, let me or the TA’s know if you have trouble starting.
Chapter 7 May 3 Ford-Fulkerson algorithm Step-by-step walk through of an example Worst-case number of augmentations Edmunds-Karp modification Time complexity.
90-723: Data Structures and Algorithms for Information Processing Copyright © 1999, Carnegie Mellon. All Rights Reserved. 1 Lecture 7: Graphs Data Structures.
Theory of Computing Lecture 12 MAS 714 Hartmut Klauck.
Graph Theory Def: A graph is a set of vertices and edges G={V,E} Ex. V = {a,b,c,d,e} E = {ab,bd,ad,ed,ce,cd} Note: above is a purely mathematical definition.
1 A Case Study: Percolation Percolation. Pour liquid on top of some porous material. Will liquid reach the bottom? Applications. [ chemistry, materials.
© Copyright 2012 by Pearson Education, Inc. All Rights Reserved. 1 Chapter 22 Graphs and Applications.
CSC 252 Pallavi Moorthy Homework 5. 1.) Vertices, edges From cd../../handout/demo/graph_alg/gw_shortest_path.
TU/e Algorithms (2IL15) – Lecture 8 1 MAXIMUM FLOW (part II)
Randomized Min-Cut Algorithm
Max-flow, Min-cut Network flow.
Depth First Seach: Output Fix
Lecture 11 Graph Algorithms
BIPARTITE GRAPHS AND ITS APPLICATIONS
The Steepest Ascent Hill Climbing Algorithm
Finding a Path With Largest Smallest Edge
CS4234 Optimiz(s)ation Algorithms
Lectures on Network Flows
Special Graphs: Modeling and Algorithms
CSE 5311-Class Project Bipartite Matching using Network Flow
Bipartite Matching and Other Graph Algorithms
The Taxi Scheduling Problem
Max-flow, Min-cut Network flow.
Instructor: Shengyu Zhang
Edmonds-Karp Algorithm
Flow Networks Topics Flow Networks Residual networks
Graphs Part 2 Adjacency Matrix
Max Flow Min Cut, Bipartite Matching Yin Tat Lee
Flow Networks and Bipartite Matching
Algorithms (2IL15) – Lecture 7
and 6.855J March 6, 2003 Maximum Flows 2
EMIS 8374 Search Algorithms Updated 9 February 2004
Special Graphs: Modeling and Algorithms
Lecture 10 Graph Algorithms
Maximum Bipartite Matching
EMIS 8374 Search Algorithms Updated 12 February 2008
Presentation transcript:

NETWORK FLOWS Shruti Aggrawal Preeti Palkar

Requirements 1.Implement the Ford-Fulkerson algorithm for computing network flow in bipartite graphs. 2.For demo purposes design a GUI in which any bipartite graph of up to 20 nodes can be specified. 3.Animation, which shows each major iteration of the algorithm. 4.Run experiments that measure the performance of the algorithm over large inputs.

Computing Network Flow in Bipartite Graphs Algorithm: Ford Fulkerson Language : JAVA Bipartite Graphs: –Directed Edges –Flow on each edge = 1. Input: –Number of nodes on left side –Number of nodes on right side Algorithm adds source and sink

Path Finding Find a path from source to sink Depth First Search Algorithm After finding a path –Increment flow by 1 –Reverse the direction of the edges Continue till no path more paths can be found –Algorithm terminates

WORKING In GUI, enter Left nodes and Right nodes and click “Run Algo” On click of button, a function is called to add nodes and edges of the graph. Edges between left nodes and right nodes are created randomly. –Create an edge if the probability is > 50% –Call function Math.random(), if result is more than 50% we add edge else not. –Change probability to less than 50% to increase the probability to add number of edges between nodes –Change it to more than 50% to decrease the probability of adding an edge.

Algorithm A function called traverse() implements the algorithm of path finding and determining the max flow which can be sent from source to sink. –Implements depth first search –Starts from source and loops through the nodes –For each node it checks if that node is not visited and also not present in the path vector, –If above condition is true it adds it to path and marks the node as visited –It loops through all the outEdges of a node –Continues till it reaches sink –After finding path, it reverses the edges of this path –Continue till no more path can be found

Design a GUI and show Animation Enter number of left nodes and right nodes. Graph is generated for –Left nodes + Right_nodes + Source + Sink Nodes and Edges that we still need to visit are shown in black Found path between source and sink is shown in red Reversed path and visited nodes are shown in green Once the algorithm terminates it will display the max flow in the top left corner

GUI 13 nodes: 4 left & 7 right nodes

Measure performance of the algorithm over large inputs Array: Store set of left and right nodes Read each pair of input and run algorithm Observation: –As the number of nodes increases, the time taken to run the algorithm is increases X-axis represents total number of nodes Y- axis represents time {{50,23},{100,48},{200,98},{300,98},{40 0,98},{200,398},{500,198},{150,648,}}

Analysis Output Number of nodes Vs time

Analysis w.r.t Number of Edges X-axis we have vertices plus edges Y -axis we have time 400 vertices & 1000 edges 500 vertices & 900 edges –the time to run algorithm is less for second graph.

Analysis Output : Vertices+Edges Vs time

Vertices+Edges Vs time

Conclusions Algorithm can be used to find max flow and matching of nodes GUI and Animation for ease of understanding Analysis: –As the number of nodes increases, the time taken to run the algorithm is increases –Running time particularly depends on number of edges.