abLEMON 1.9.0-101-gccb8629
A maintained fork of LEMON
Loading...
Searching...
No Matches
GomoryHu< GR , CAP >::MinCutEdgeIt Class Reference

Iterate on the edges of a minimum cut. More...

#include <lemon/gomory_hu.h>

Public Member Functions

 MinCutEdgeIt (GomoryHu const &gomory, const Node &s, const Node &t, bool side=true)
 Constructor.
 operator typename Graph::Arc () const
 Conversion to Arc.
 operator typename Graph::Edge () const
 Conversion to Edge.
MinCutEdgeIt & operator++ ()
 Next edge.
Graph::Arc operator++ (int)
 Postfix incrementation.

Detailed Description

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

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

This example computes the value of the minimum cut separating s from t.

GomoryHu< Graph > gom( g , capacities );
gom.run();
int value = 0;
for( GomoryHu< Graph >::MinCutEdgeIt e( gom , s , t ) ; e != INVALID ;
++e )
value += capacities[ e ];
Iterate on the edges of a minimum cut.
Definition gomory_hu.h:492
GomoryHu( const Graph & graph , const Capacity & capacity )
Constructor.
Definition gomory_hu.h:121
const Invalid INVALID
Invalid iterators.
Definition base.cc:33

The result will be the same as the value returned by gom.minCutValue(s,t).

Constructor & Destructor Documentation

◆ MinCutEdgeIt()

template< typename GR , typename CAP >
MinCutEdgeIt ( 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 listed arcs will be oriented from the nodes of the component containing s, otherwise they will be oriented in the opposite direction.

Member Function Documentation

◆ operator typename Graph::Arc()

template< typename GR , typename CAP >
operator typename Graph::Arc ( ) const
inline

Conversion to Arc.

◆ operator typename Graph::Edge()

template< typename GR , typename CAP >
operator typename Graph::Edge ( ) const
inline

Conversion to Edge.

◆ operator++() [1/2]

template< typename GR , typename CAP >
MinCutEdgeIt & operator++ ( )
inline

Next edge.

◆ operator++() [2/2]

template< typename GR , typename CAP >
Graph::Arc operator++ ( int )
inline

Postfix incrementation.

Warning
This incrementation returns an Arc, not a MinCutEdgeIt, as one may expect.