template<typename GR, typename CM, typename TR>
class lemon::NagamochiIbaraki< GR, CM, TR >
Calculates the minimum cut in an undirected graph with the Nagamochi-Ibaraki algorithm. The algorithm separates the graph's nodes into two partitions with the minimum sum of edge capacities between the two partitions. The algorithm can be used to test the network reliability, especially to test how many links have to be destroyed in the network to split it to at least two distinict subnetworks.
The complexity of the algorithm is but with Fibonacci heap it can be decreased to . When the edges have unit capacities, BucketHeap can be used which yields time complexity.
Warning
The value type of the capacity map should be able to hold any cut value of the graph, otherwise the result can overflow.
Note
This capacity is supposed to be integer type.
#include <lemon/nagamochi_ibaraki.h>
Inheritance diagram for NagamochiIbaraki< GR, CM, TR >:
Sets the heap and the cross reference used by algorithm.
Execution control
The simplest way to execute the algorithm is to use one of the member functions called run().
If you need more control on the execution, first you must call init() and then call the start() or proper times the processNextPhase() member functions.
The result of the NagamochiIbaraki algorithm can be obtained using these functions.
Before the use of these functions, either run() or start() must be called.
This constructor can be used only when the Traits class defines how can the local capacity map be instantiated. If the SetUnitCapacity used the algorithm automatically constructs the capacity map.
Sets the heap and the cross reference used by algorithm. If you don't use this function before calling run(), it will allocate one. The destuctor deallocates this automatically allocated heap and cross reference, of course.