All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Member Functions
GomoryHu< GR, CAP >::MinCutNodeIt Class Reference

Detailed Description

template<typename GR, typename CAP>
class lemon::GomoryHu< GR, CAP >::MinCutNodeIt

This iterator class lists the nodes of a minimum cut found by GomoryHu. Before using it, you must allocate a GomoryHu class and call its run() method.

This example counts the nodes in the minimum cut separating s from t.

GomoryHu<Graph> gom(g, capacities);
gom.run();
int cnt=0;
for(GomoryHu<Graph>::MinCutNodeIt n(gom,s,t); n!=INVALID; ++n) ++cnt;

#include <lemon/gomory_hu.h>

Public Member Functions

 MinCutNodeIt (GomoryHu const &gomory, const Node &s, const Node &t, bool side=true)
 
 operator typename Graph::Node () const
 
MinCutNodeItoperator++ ()
 
Graph::Node operator++ (int)
 Postfix incrementation.
 

Constructor & Destructor Documentation

MinCutNodeIt ( GomoryHu const &  gomory,
const Node &  s,
const Node &  t,
bool  side = true 
)
inline

Constructor.

Parameters
gomoryThe GomoryHu class. You must call its run() method before initializing this iterator.
sThe base node.
tThe node you want to separate from node s.
sideIf it is true (default) then the iterator lists the nodes of the component containing s, otherwise it lists the other component.
Note
As the minimum cut is not always unique,
MinCutNodeIt(gomory, s, t, true);
and
MinCutNodeIt(gomory, t, s, false);
does not necessarily give the same set of nodes. However, it is ensured that
MinCutNodeIt(gomory, s, t, true);
and
MinCutNodeIt(gomory, s, t, false);
together list each node exactly once.

Member Function Documentation

operator typename Graph::Node ( ) const
inline

Conversion to Node.

MinCutNodeIt& operator++ ( )
inline

Next node.

Graph::Node operator++ ( int  )
inline

Postfix incrementation.

Warning
This incrementation returns a Node, not a MinCutNodeIt, as one may expect.