|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
49 template<
typename TCap>
59 while (!queue.empty()) {
61 if (v == *this->
m_t) {
63 TCap augmentVal = std::numeric_limits<TCap>::max();
64 for (
node w = v; pred[w]; w = pred[w]->theNode()) {
68 if ((*this->
m_cap)[e] - (*this->
m_flow)[e] < augmentVal) {
69 augmentVal = (*this->
m_cap)[e] - (*this->
m_flow)[e];
72 if ((*this->
m_flow)[e] < augmentVal) {
73 augmentVal = (*this->
m_flow)[e];
78 for (
node w = v; pred[w]; w = pred[w]->theNode()) {
82 (*this->
m_flow)[e] += augmentVal;
84 (*this->
m_flow)[e] -= augmentVal;
91 if (w != (*this->
m_s) && !pred[w])
101 if ((*this->
m_et).greater((*this->
m_flow)[e], (TCap)0)) {
127 this->
m_flow->fill((TCap)0);
134 if (*this->
m_s == *this->
m_t) {
145 flowValue += (*this->
m_flow)[e];
147 flowValue -= (*this->
m_flow)[e];
The namespace for all OGDF objects.
Includes declaration of graph class.
bool isFeasibleInstance() const
Return whether the instance is feasible, i.e. the capacities are non-negative.
bool augmentShortestSourceSinkPath()
If there is an augumenting path: do an interation step. Otherwise return false so that the algorithm ...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
Interface for Max Flow Algorithms.
const node * m_t
Pointer to the sink node.
E popFrontRet()
Removes the first element from the list and returns it.
Computes a max flow via Edmonds-Karp.
Class for adjacency list elements.
EpsilonTest * m_et
Pointer to the used EpsilonTest.
edge theEdge() const
Returns the edge associated with this adjacency entry.
const node * m_s
Pointer to the source node.
TCap computeValue(const EdgeArray< TCap > &cap, const node &s, const node &t)
Implementation of computeValue from the super class. The flow array is cleared, cap,...
const Graph * m_G
Pointer to the given graph.
Decralation of GraphElement and GraphList classes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
node source() const
Returns the source node of the edge.
Doubly linked lists (maintaining the length of the list).
RegisteredArray for nodes, edges and adjEntries of a graph.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Basic declarations, included by all source files.
Class for the representation of edges.
Declaration of doubly linked lists and iterators.
const EdgeArray< TCap > * m_cap
Pointer to the given capacity array.
node target() const
Returns the target node of the edge.
Class for the representation of nodes.
EdgeArray< TCap > * m_flow
Pointer to (extern) flow array.
iterator pushBack(const E &x)
Adds element x at the end of the list.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
void computeFlowAfterValue()
Implementation of computeFlowAfterValue from the super class. This does nothing, because the algorith...