Home | Documentation | Download | Platforms | Projects | Mailing Lists | Version History

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# maxflow_pp Class Reference

Maximum flow algorithm (Malhotra, Kumar, Maheshwari). More...

Inheritance diagram for maxflow_pp:

[legend]
Collaboration diagram for maxflow_pp:

[legend]

List of all members.

## Public Member Functions

| maxflow_pp ()
virtual | ~maxflow_pp ()
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 (Malhotra, Kumar, Maheshwari).

## Constructor & Destructor Documentation

maxflow_pp::maxflow_pp | ( |  | ) |

Default constructor. Enables only the calculation of maximum flow.

See also:
  algorithm::algorithm

virtual maxflow_pp::~maxflow_pp | ( |  | ) | `[virtual]`

Destructor.

See also:
  algorithm::~algorithm

## Member Function Documentation

void maxflow_pp::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_pp::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_pp::check | ( | graph & | G | ) | `[virtual]`

Checks whether following preconditions are satisfied:

- maxflow_pp::set_vars has been executed before.
- only edge_capacities >= 0 are applied.
- `G` is directed.
- `G` is connected.
- `G` has at least one edge and two nodes.
- if not applied, start-nodes and end-nodes exists.
- if applied, start-node is not the same node as end-node.

Parameters:

  | G | graph

Returns:
  `algorithm::GTL_OK` on success `algorithm::GTL_ERROR` otherwise

See also:
  algorithm::check

Implements algorithm.

int maxflow_pp::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_pp::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_pp::get_max_flow | ( |  | ) | const

Returns the maximum flow of the whole graph `G`.

Returns:
  maximum flow value

double maxflow_pp::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_pp::reset | ( |  | ) | `[virtual]`

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

See also:
  algorithm::reset

Implements algorithm.

University of Passau - FMI - Theoretical Computer Science

Design © 2002, 2003 Marcus Raitner, University of Passau