49template<
typename TCap>
71 OGDF_ASSERT(priority < std::numeric_limits<TCap>::max());
72 return priority +
TCap(1);
123 const node& target) {
140 embedding.consistencyCheck();
148 m_visited.
init(*this->
m_G,
false);
149 m_edgeCounter.
init(*this->
m_G, 0);
220 edge e = adj->theEdge();
240 while (
m_pred[w] !=
nullptr) {
256 while (e->
source() != w) {
272 if (v == *this->
m_s) {
345 }
else if (
m_pred[v] ==
nullptr ||
m_pred[w] ==
nullptr) {
347 }
else if (
m_pred[w]->source() == *this->
m_s) {
Declaration of CombinatorialEmbedding and face.
Interface for Max Flow Algorithms.
Priority queue interface wrapping various heaps.
Class for adjacency list elements.
edge theEdge() const
Returns the edge associated with this adjacency entry.
Combinatorial embeddings of planar graphs.
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.
Dynamic arrays indexed with edges.
void init()
Reinitializes the array. Associates the array with no graph.
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.
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
Dynamic arrays indexed with nodes.
void init()
Reinitializes the array. Associates the array with no graph.
Class for the representation of nodes.
int degree() const
Returns the degree of the node (indegree + outdegree).
Prioritized queue interface wrapper for heaps.
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.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.