CITS2200
Interface Flow


public interface Flow

Flow.java This interface is used to implement Max Flow and matching algorithms algorithms over Graphs.


Method Summary
 int getMaxFlow(Graph g, int s, int t)
          Finds the maximum flow in a flow network
 int getMaximumMatching(Graph g)
          Finds the maximum matching in a Bipartite graph.
 

Method Detail

getMaxFlow

int getMaxFlow(Graph g,
               int s,
               int t)
Finds the maximum flow in a flow network

Parameters:
g - the Flow network as a graph. Each edge weight indicates the capacity on that edge.
s - the source vertex
t - the sink vertex
Returns:
the maximum flow, as an int

getMaximumMatching

int getMaximumMatching(Graph g)
Finds the maximum matching in a Bipartite graph.

Parameters:
g - an unwieghted, undirected bipartite graph, where the graph is partitioned into odd and even vertices.
Returns:
the maximum number of pairs that may be uniquely matched.