Edmonds-Karp

template<class G>
class EdmondsKarp

Public Functions

inline EdmondsKarp(const G &graph, const int source, const int sink)
inline int source() const
inline int sink() const
inline G::Weight maxFlow() const
inline G::Weight flowOnEdge(const int edge) const
inline G::Weight residualCapacity(const int edge) const
inline G::Weight flowBetween(const int a, const int b) const

Returns the total flow directly going from a to b (can be negative if the flow is going from b to a)

Private Members

int m_source
int m_sink
G::Weight m_flow
std::vector<std::vector<Edge>> m_residualGraph
std::vector<typename G::Weight> m_residualCapacities
struct Edge

Public Members

int neighbour
int id