34#define OGDF_MINCUTNI_MAXLISTSIZE 100
35#define OGDF_MINCUTNI_PRTHR 100
36#define OGDF_MINCUTNI_CLUSTERSIZE 10
49#include <unordered_map>
50#include <unordered_set>
90 virtual inline int call(
const Graph& G)
override {
return minCutUnweighted(G); }
95 for (
edge e : G.edges) {
96 edgeCapacity[m_GC.copy(e)->index()] =
weights[e];
98 const int& value {minCutWeighted()};
104 int value()
const override {
return barLambda; };
174 const std::vector<clusterstruct>& clusters);
195 const unsigned int&
vIndex) {
207 std::vector<clusterstruct>& clusters,
int& level);
246 opposite = e->opposite(s);
266 unsigned int NIRounds = 0;
267 unsigned int prRounds = 0;
Declaration and implementation of Array class and Array algorithms.
Pure declaration header, find template implementation in Graph.h.
Declaration of graph copy classes.
Declaration of doubly linked lists and iterators.
Contains logging functionality.
Declaration of ogdf::MinimumCutModule.
Declaration of singly linked lists and iterators.
Class for adjacency list elements.
edge theEdge() const
Returns the edge associated with this adjacency entry.
An array that keeps track of the number of inserted elements; also usable as an efficient stack.
Dynamic arrays indexed with edges.
Class for the representation of edges.
Functionality for temporarily hiding edges in constant time.
Copies of graphs supporting edge splitting.
Data type for general directed graphs (adjacency list representation).
Encapsulates a pointer to a list element.
Centralized global and local logging facility working on streams like std::cout.
Level
supported log-levels from lowest to highest importance
Serves as an interface for various methods to compute minimum cuts with or without edge weights.
Calculate minimum cut value for a given Graph.
virtual int call(const Graph &G, const EdgeArray< int > &weights) override
Computes a minimum cut on graph G with non-negative weights on edges.
std::unordered_set< node > allNodes
ArrayBuffer< node > m_partition
std::vector< int > degree
bool PRTest1(const unsigned int &eIndex)
Test for rule 1 of Padberg-Rinaldi.
void updateClusters(const node &head, const node ¤tNode, std::vector< clusterstruct > &clusters, int &level)
Add new node to an existing cluster of head or create new cluster with head as head.
void contract(const node &s, const ListPure< node > &toContract, const int &clusterlevel, const std::vector< clusterstruct > &clusters)
Contracts one clusters.
node getFirstNode(BoundedList &L)
Return first node of L and adjust values of L.
Graph::HiddenEdgeSet * hiddenEdges
static edge getAdjEdge(const adjEntry &adj, const node &s, node &opposite)
Returns edge corresponding to adj.
void minCut()
Underlying function for minCut computation.
void updateLambda(const int nodeDegree)
Checks for new upper bound.
virtual const ArrayBuffer< edge > & edges() override
Returns the edges defining the computed mincut.
const unsigned int & getPrRounds() const
Output the number of Padberg-Rinaldi rounds.
virtual int call(const Graph &G) override
Computes a minimum cut on graph G.
virtual const ArrayBuffer< node > & nodes() override
Returns a list of nodes belonging to one side of the bipartition.
std::vector< int > edgeCapacity
void fillL(const int &maxAdj, ListPure< node > &unviewed, BoundedList &L, std::vector< adjInfo > &adjToViewed)
Refills L, if it's empty but nodes with the same adjacency exists.
virtual ~MinimumCutNagamochiIbaraki() override
Standard destructor of the class.
void deleteFromL(BoundedList &L, ListIterator< node > &placeInL)
Deletes the node given through placeInL from L.
node MAOComputation(const node &s)
Compute a MAO and contract clusters in it.
const unsigned int & getNIRounds() const
Output the number of Nagamochi-Ibaraki rounds (equals to MAO-Computations)
const int & minCutUnweighted(const Graph &G)
Compute a minimum cut value for the given unweighted graph.
const int & minCutWeighted(const Graph &G, const std::vector< int > &capacity)
Compute a minimum cut value for the given weighted graph.
void PRPass1_2(const node &lastContracted)
Tests rule 1 and 2 of Padberg-Rinaldi of all incident edges of lastContracted and contracts on succes...
const int & minCutWeighted()
Compute a minimum cut value for the given weighted graph, assuming that m_GC and edgeCapacity have al...
ArrayBuffer< edge > m_cutEdges
void init(const Graph &G)
Initializes member variables.
void contractClusters(const std::vector< clusterstruct > &clusters)
Contracts all Clusters trough contraction of each cluster using contractClusters.
MinimumCutNagamochiIbaraki(bool p=true, bool preprocessing=false, Logger::Level logLevel=Logger::Level::Default)
Standard constructor of the class.
bool PRTest2(const unsigned int &eIndex, const unsigned int &uIndex, const unsigned int &vIndex)
Test for rule 2 of Padberg-Rinaldi.
int value() const override
Output value of last minimum cut computation.
Class for the representation of nodes.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
Declaration of simple graph algorithms.
BoundedList(ListPure< node > l_init=ListPure< node >(), int nodesInList_init=0, int size_init=0)
ListPure< node > clusterNodes