49template<
typename T =
double>
59 m_minCut = std::numeric_limits<T>::max();
158 m_contractedNodes[
t].conc(m_contractedNodes(s));
162 edge e = adj->theEdge();
163 if (e->source() == t || e->target() == t) {
165 }
else if (e->source() == s) {
166 m_GC.moveSource(e, t);
168 m_GC.moveTarget(e, t);
178 node v {adj->twinNode()};
180 edge e {adj->theEdge()};
181 edge&
f {incident[v]};
206 for (
node v : m_GC.nodes) {
212 node v {adj->twinNode()};
214 if (
pq.contains(v)) {
231 while (!
pq.empty()) {
247 edge e {adj->theEdge()};
248 if (!e->isSelfLoop()) {
257 for (
node v : m_contractedNodes[
t]) {
Declaration of graph copy classes.
Declaration of ogdf::MinimumCutModule.
Priority queue interface wrapping various heaps.
Class for adjacency list elements.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
void clear()
Clears the buffer.
void push(E e)
Puts a new element in the buffer.
bool empty() const
Returns true if the buffer is empty, false otherwise.
Dynamic arrays indexed with edges.
Class for the representation of edges.
Copies of graphs supporting edge splitting.
void init(const Graph &G)
Re-initializes the copy using the graph G.
const Graph & original() const
Returns a reference to the original graph.
Data type for general directed graphs (adjacency list representation).
int numberOfNodes() const
Returns the number of nodes in the graph.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
Serves as an interface for various methods to compute minimum cuts with or without edge weights.
Dynamic arrays indexed with nodes.
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Prioritized queue interface wrapper for heaps.
AdjElement * adjEntry
The type of adjacency entries.
EdgeElement * edge
The type of edges.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
void updateMin(T &min, const T &newValue)
Stores the minimum of min and newValue in min.
The namespace for all OGDF objects.
void safeForEach(CONTAINER &container, std::function< void(typename CONTAINER::value_type)> func)
Calls (possibly destructive) func for each element of container.
Computes a minimum cut in a graph.
void contraction(node t, node s)
Contracts the nodes s and t, i.e., s is collapsed to t. The edge (if existing) between s and t is del...
ArrayBuffer< node > m_partition
Store one side of the computed bipartition.
virtual T call(const Graph &G, const EdgeArray< T > &weights) override
Computes a minimum cut on graph G with non-negative weights on edges.
GraphCopy m_GC
The modifiable version of the input graph (used for contractions)
EdgeArray< T > m_w
An EdgeArray containing the corresponding edge weights.
ArrayBuffer< edge > m_cutEdges
Store cut edges if computed.
NodeArray< List< node > > m_contractedNodes
Each node has a list containing the nodes with which it has been contracted. Because the GraphCopy m_...
void mainLoop()
Computes minimum cut by invoking minimumCutPhase() O(|V|) times.
virtual const ArrayBuffer< node > & nodes() override
Returns a const-reference to the list of nodes belonging to one side of the bipartition.
T m_minCut
Stores the value of the minimum cut.
T minimumCutPhase()
Computes and returns the value of the minimum cut of the current phase (iteration).
virtual const ArrayBuffer< edge > & edges() override
Computes the edges defining the computed mincut and returns them.
virtual T value() const override
Returns the value of the last minimum cut computation.
virtual T call(const Graph &G) override
Computes a minimum cut on graph G.