51template<
typename TCap>
73 OGDF_ASSERT(priority < std::numeric_limits<TCap>::max());
74 return priority + TCap(1);
125 const node& target) {
135 this->
m_cap = &originalCapacities;
150 m_visited.
init(*this->
m_G,
false);
151 m_edgeCounter.
init(*this->
m_G, 0);
160 edge lastSaturated =
nullptr;
166 (*this->
m_flow)[lastSaturated] = (*this->
m_cap)[lastSaturated];
208 if (saturatedEdge ==
nullptr) {
214 v = saturatedEdge->
source();
222 edge e = adj->theEdge();
242 while (
m_pred[w] !=
nullptr) {
258 while (e->
source() != w) {
259 formerSource = e->
source();
274 if (v == *this->
m_s) {
345 if (v == e->
target() || w == *this->m_s) {
347 }
else if (
m_pred[v] ==
nullptr ||
m_pred[w] ==
nullptr) {
349 }
else if (
m_pred[w]->source() == *this->
m_s) {
Declaration of CombinatorialEmbedding and face.
Includes declaration of graph class.
Interface for Max Flow Algorithms.
Priority queue interface wrapping various heaps.
Basic declarations, included by all source files.
Class for adjacency list elements.
adjEntry cyclicSucc() const
Returns the cyclic successor in the adjacency list.
edge theEdge() const
Returns the edge associated with this adjacency entry.
Combinatorial embeddings of planar graphs.
void consistencyCheck() const
Asserts that this embedding is consistent.
adjEntry findCommonFace(const node v, const node w, bool left=true) const
Identifies a common face of two nodes and returns the respective adjacency entry.
Class for the representation of edges.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
adjEntry adjTarget() const
Returns the corresponding adjacancy entry at target node.
bool isSelfLoop() const
Returns true iff the edge is a self-loop (source node = target node).
node target() const
Returns the target node of the edge.
node source() const
Returns the source node of the edge.
const node * m_t
Pointer to the sink node.
virtual void init(const Graph &graph, EdgeArray< TCap > *flow=nullptr)
Initialize the problem with a graph and optional flow array. If no flow array is given,...
EdgeArray< TCap > * m_flow
Pointer to (extern) flow array.
void useEpsilonTest(const double &eps)
Change the used EpsilonTest from StandardEpsilonTest to a user given EpsilonTest.
bool isFeasibleInstance() const
Return whether the instance is feasible, i.e. the capacities are non-negative.
const Graph * m_G
Pointer to the given graph.
const node * m_s
Pointer to the source node.
const EdgeArray< TCap > * m_cap
Pointer to the given capacity array.
MaxFlowModule()
Empty Constructor.
TCap computeFlow(EdgeArray< TCap > &cap, node &s, node &t, EdgeArray< TCap > &flow)
Only a shortcut for computeValue and computeFlowAfterValue.
Computes a max flow in s-t-planar network via uppermost paths.
void dropEdge(const edge e)
Removes a single edge from the current path.
TCap unshiftedPriority(edge e)
To work with unsigned, we need a priority shifting of the elements in the priority queue.
NodeType
Each node has a certain type depending on its participation in any path.
TCap computeValue(const EdgeArray< TCap > &originalCapacities, const node &source, const node &target)
Computes the maximal flow from source to sink.
EdgeArray< bool > m_visited
Whether each edge has was visited.
~MaxFlowSTPlanarItaiShiloach()
Free allocated ressources.
TCap m_partialFlow
The flow reached thus far (monotonically increasing).
void computeFlowAfterValue()
Computes the actual flow on each edge.
EdgePathType getPathType(const edge e) const
Performs an alternating backtracking from source and target to determine whether the new node is part...
NodeArray< edge > m_pred
The predecessor of each node in the currently uppermost path.
TCap unshiftedTopPriority()
see unshiftedPriority
PrioritizedMapQueue< edge, TCap > * m_prioritizedEdges
A priority queue for storing all edges currently in a path.
EdgePathType
Each edge may be part of the source or target path.
NodeArray< int > m_edgeCounter
The number of edges visited from each node.
NodeArray< NodeType > m_status
The status of each node.
bool findUppermostPath(const edge saturatedEdge)
Establishes the next uppermost path.
void appendEdge(const edge e)
Appends an edge to the current path.
TCap shiftPriority(TCap priority)
see unshiftedPriority
Class for the representation of nodes.
int degree() const
Returns the degree of the node (indegree + outdegree).
Prioritized queue interface wrapper for heaps.
void init(const Base *base=nullptr)
Reinitializes the array. Associates the array with the matching registry of base.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
bool isSTPlanar(const Graph &graph, const node s, const node t)
Returns whether G is s-t-planar (i.e.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.