55template<
typename TCap>
61 for (
edge e = gr.
lastEdge(); e !=
nullptr; e = e->pred()) {
62 edge e_new_dg = gr.
newEdge(e->target(), e->source());
63 new_costs[e_new_dg] = 0;
99 for (
edge e : (*this->
m_G).edges) {
103 costs[dg.
dualEdge(ts_edge)] = std::numeric_limits<TCap>::max();
108 dij.
call(dg, costs, dg.
dualNode(f_infty), preds, dists,
true);
110 for (
edge e : (*this->
m_G).edges) {
118 edge e = adj->theEdge();
120 flowValue += (*this->
m_flow)[e];
122 flowValue -= (*this->
m_flow)[e];
Declaration of CombinatorialEmbedding and face.
Includes declaration of dual graph class.
Includes declaration of graph class.
Declaration of graph copy classes.
Decralation of GraphElement and GraphList classes.
Interface for Max Flow Algorithms.
Basic declarations, included by all source files.
Class for adjacency list elements.
Combinatorial embeddings of planar graphs with modification functionality.
edge splitFace(adjEntry adjSrc, adjEntry adjTgt, bool sourceAfter=false)
Splits a face by inserting a new edge.
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
void setExternalFace(face f)
Sets the external face to f.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
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.
Dijkstra's single source shortest path algorithm.
void call(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false, bool arcsReversed=false, node target=nullptr, T maxLength=std::numeric_limits< T >::max())
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
A dual graph including its combinatorial embedding of an embedded graph.
const node & dualNode(face f) const
Returns the node in the dual graph corresponding to f.
const edge & dualEdge(edge e) const
Returns the edge in the dual graph corresponding to e.
Class for the representation of edges.
adjEntry adjSource() const
Returns the corresponding adjacancy entry at source node.
node source() const
Returns the source node of the edge.
Faces in a combinatorial embedding.
Copies of graphs supporting edge splitting.
edge copy(edge e) const override
Returns the first edge in the list of edges corresponding to edge e.
Data type for general directed graphs (adjacency list representation).
edge lastEdge() const
Returns the last edge in the list of all edges.
edge newEdge(node v, node w, int index=-1)
Creates a new edge (v,w) and returns it.
const node * m_t
Pointer to the sink node.
virtual void init(const Graph &graph, EdgeArray< T > *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 dual shortest paths.
void createBackArcs(Graph &gr, EdgeArray< TCap > &new_costs)
Create back arcs for all edges and set the backedges' new_costs to zero.
TCap computeValue(const EdgeArray< TCap > &cap, const node &s, const node &t) override
Compute only the value of the flow.
void computeFlowAfterValue() override
Implementation of computeFlowAfterValue from the super class. This does nothing, because the algorith...
void init(const Graph &graph, EdgeArray< TCap > *flow=nullptr) override
Initialize the problem with a graph and optional flow array. If no flow array is given,...
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
Declaration of extended graph algorithms.
Implementation of Dijkstra's single source shortest path algorithm.
bool isConnected(const Graph &G)
Returns true iff G is connected.
bool isSTPlanar(const Graph &graph, const node s, const node t)
Returns whether G is s-t-planar (i.e.
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.
Declaration of simple graph algorithms.