Network Flow Hiren patel hkp 4027 Ujjval patel

  • Slides: 9
Download presentation
Network Flow Hiren patel (hkp 4027) Ujjval patel (ujp 4126)

Network Flow Hiren patel (hkp 4027) Ujjval patel (ujp 4126)

Problem Defination: Implement the Ford-Fulkerson algorithm for computing network flow in bipartite graphs.

Problem Defination: Implement the Ford-Fulkerson algorithm for computing network flow in bipartite graphs.

Ford Fulkerson Algorithm Initialize flow f to 0 While there exists an augment path

Ford Fulkerson Algorithm Initialize flow f to 0 While there exists an augment path p do augmant flow f along path p Return f

Maximum Bipartite Matching Given two sets of vertices Group 1 and Group 2 ,

Maximum Bipartite Matching Given two sets of vertices Group 1 and Group 2 , And edges between the nodes of Group 1 to nodes of Group 2, find the matching with maximum cardinality. How ford fulkerson algorithm can be used in matching problem?

Implementation n PLATFORM : Microsoft windows 9 x, NT, 2000 n PROGAMMAING LANGUAGE :

Implementation n PLATFORM : Microsoft windows 9 x, NT, 2000 n PROGAMMAING LANGUAGE : Visual C++. NET n PROGRAMMING TOOL : Microsoft Visual Studio. NET 2003 n Code implemented woks in two modes: Ford Fulkerson mode Bipartite mode

n DFS Algorithm is used for finding a source to sink path. n Data

n DFS Algorithm is used for finding a source to sink path. n Data structures used: Adjacency matrix representation for the graph. b. Input : N by N Boolean array to store graph. i. Capacity = N by N int 32 array to store capacities of edges. i. Flow = N by N int 32 array to store flow from the edges. All data structures used are instantiated dynamically.

Analysis n n Running Time Analysis: O (E * |f*|) , where f* is

Analysis n n Running Time Analysis: O (E * |f*|) , where f* is the maximum flow and E is no of edges in network. Space Complexity: O (N * N), where N is the number of nodes in the graph.

Performance of the Ford Fulkerson over different inputs. s 4 8 20 Node Edge

Performance of the Ford Fulkerson over different inputs. s 4 8 20 Node Edge s 5 11 24 Flo w Augmente d paths 15 20 4 30 3 Ideal Complexity O( E * f*) 3 75 220 49 Actual Space complexit Complex y ity O(N*N) 21 16 55 64 750 400

Performance of the Max. Bipartite matching over different inputs. s Node Edge s Flo

Performance of the Max. Bipartite matching over different inputs. s Node Edge s Flo w Augmente d paths Ideal Complexity O( E * f*) Actual Space complexit Complex y ity O(N*N) 10 17 5 5 50 49 100 16 28 8 8 128 78 256 20 34 10 10 200 90 400 26 52 12 12 288 128 676