48 template <
typename TCap>
56 edge e_new_dg = gr.
newEdge(e->target(), e->source());
57 new_costs[e_new_dg] = 0;
93 for (
edge e : (*this->
m_G).edges) {
97 costs[dg.
dualEdge(ts_edge)] = std::numeric_limits<TCap>::max();
102 dij.
call(dg, costs, dg.
dualNode(f_infty), preds, dists,
true);
104 for (
edge e : (*this->
m_G).edges) {
115 flowValue += (*this->
m_flow)[e];
117 flowValue -= (*this->
m_flow)[e];
void computeFlowAfterValue() override
Implementation of computeFlowAfterValue from the super class. This does nothing, because the algorith...
edge theEdge() const
Returns the edge associated with this adjacency entry.
void setExternalFace(face f)
Sets the external face to f.
node copy(node v) const
Returns the node in the graph copy corresponding to v.
Includes declaration of dual graph class.
Dijkstra's single source shortest path algorithm.
Data type for general directed graphs (adjacency list representation).
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, a new ("internal") array will be created. If a flow array is given, the algorithm uses this "external" array.
void call(const Graph &G, const EdgeArray< T > &weight, const List< node > &sources, NodeArray< edge > &predecessor, NodeArray< T > &distance, bool directed=false)
Calculates, based on the graph G with corresponding edge costs and source nodes, the shortest paths a...
const node * m_t
Pointer to the sink node.
Interface for Max Flow Algorithms.
TCap computeValue(const EdgeArray< TCap > &cap, const node &s, const node &t) override
Compute only the value of the flow.
const Graph * m_G
Pointer to the given graph.
edge lastEdge() const
Returns the last edge in the list of all edges.
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. ...
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
Dynamic arrays indexed with nodes.
Implementation of Dijkstra's single source shortest path algorithm.
Computes a max flow in s-t-planar network via dual shortest paths.
const node * m_s
Pointer to the source node.
edge newEdge(node v, node w)
Creates a new edge (v,w) and returns it.
EdgeArray< TCap > * m_flow
Pointer to (extern) flow array.
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.
Faces in a combinatorial embedding.
Class for the representation of edges.
Copies of graphs supporting edge splitting.
Class for the representation of nodes.
bool isFeasibleInstance() const
Return whether the instance is feasible, i.e. the capacities are non-negative.
const node & dualNode(face f) const
Returns the node in the dual graph corresponding to f.
A dual graph including its combinatorial embedding of an embedded graph.
edge pred() const
Returns the predecessor in the list of all edges.
bool isSTPlanar(const Graph &graph, const node s, const node t)
Returns whether G is s-t-planar (i.e.
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, a new ("internal") array will be created. If a flow array is given, the algorithm uses this "external" array.
const edge & dualEdge(edge e) const
Returns the edge in the dual graph corresponding to e.
Declaration of simple graph algorithms.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
node source() const
Returns the source node of the edge.
edge splitFace(adjEntry adjSrc, adjEntry adjTgt)
Splits a face by inserting a new edge.
The namespace for all OGDF objects.
Declaration of extended graph algorithms.
bool isConnected(const Graph &G)
Returns true iff G is connected.
Combinatorial embeddings of planar graphs with modification functionality.
const EdgeArray< TCap > * m_cap
Pointer to the given capacity array.
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
void createBackArcs(Graph &gr, EdgeArray< TCap > &new_costs)
Create back arcs for all edges and set the backedges' new_costs to zero.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.