maxflow_ff Class Reference

Maximum flow algorithm (Edmonds-Karp). More...

Inheritance diagram for maxflow_ff:

Inheritance graph
[legend]
Collaboration diagram for maxflow_ff:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 maxflow_ff ()
virtual ~maxflow_ff ()
void set_vars (const edge_map< double > &edge_capacity)
void set_vars (const edge_map< double > &edge_capacity, const node &net_source, const node &net_target)
virtual int check (graph &G)
int run (graph &G)
double get_max_flow (const edge &e) const
double get_max_flow () const
double get_rem_cap (const edge &e) const
virtual void reset ()


Detailed Description

Maximum flow algorithm (Edmonds-Karp).

Constructor & Destructor Documentation

maxflow_ff::maxflow_ff (  ) 

Default constructor. Enables only the calculation of maximum flow.

See also:
algorithm::algorithm

virtual maxflow_ff::~maxflow_ff (  )  [virtual]

Destructor.

See also:
algorithm::~algorithm


Member Function Documentation

void maxflow_ff::set_vars ( const edge_map< double > &  edge_capacity  ) 

Sets capacity of every edge for maximum flow calculation where artificial start-node and end_node will be computed automatically.

Parameters:
edge_capacity capacity of every edge

void maxflow_ff::set_vars ( const edge_map< double > &  edge_capacity,
const node net_source,
const node net_target 
)

Sets capacity of every edge for maximum flow calculation

Parameters:
edge_capacity capacity of every edge
net_source start-node
net_target end-node

virtual int maxflow_ff::check ( graph G  )  [virtual]

Checks whether following preconditions are satisfied:

Parameters:
G graph
Returns:
algorithm::GTL_OK on success algorithm::GTL_ERROR otherwise
See also:
algorithm::check

Implements algorithm.

int maxflow_ff::run ( graph G  )  [virtual]

Computes maximum flow of graph G.

Parameters:
G graph
Returns:
algorithm::GTL_OK on success algorithm::GTL_ERROR otherwise
See also:
algorithm::run

Implements algorithm.

double maxflow_ff::get_max_flow ( const edge e  )  const

Returns the maximum flow of an edge.

Parameters:
e edge of a graph G
Returns:
maximum flow value

double maxflow_ff::get_max_flow (  )  const

Returns the maximum flow of the whole graph G.

Returns:
maximum flow value

double maxflow_ff::get_rem_cap ( const edge e  )  const

Returns the remaining free capacity of an edge.

Parameters:
e edge of a graph G
Returns:
remaining capacity

virtual void maxflow_ff::reset (  )  [virtual]

Resets maximum flow algorithm, i.e. prepares the algorithm to be applied to another graph.

See also:
algorithm::reset

Implements algorithm.