58template<
typename TCost>
67 edge e_st =
nullptr)
override {
68 return call(graph,
nullptr, s, t, edgeList, e_st);
76 return call(graph, &weight, s, t, edgeList, e_st);
91template<
typename TCost>
94 bool weighted = (weight !=
nullptr);
101 std::function<
edge(
edge)> orig = [&](
edge e) ->
edge {
return m_gc->original(e); };
104 m_weightedGc.
init(graph);
105 if (e_st !=
nullptr) {
106 e_st = m_weightedGc.
copy(e_st);
108 s = m_weightedGc.
copy(s);
109 t = m_weightedGc.
copy(t);
112 for (
edge e : edges) {
113 mapE[m_weightedGc.
copy(e)] = e;
114 if (m_weightedGc.
copy(e) == e_st) {
119 for (; i < (*weight)[e]; i++) {
120 edge copyEdge = m_weightedGc.
copy(e);
132 m_gc->init(m_weightedGc);
133 orig = [&](
edge e) ->
edge {
return mapE[m_gc->original(e)]; };
142 if (e_st !=
nullptr) {
143 e_st = m_gc->copy(e_st);
145 e_st = m_gc->searchEdge(m_gc->copy(s), m_gc->copy(t));
157 if (dual.
primalEdge(adj->theEdge()) != e_st) {
158 queue.
append(adj->theEdge());
159 prev[adj->theEdge()] = source;
166 bool dir = (eCand->
source() == prev[eCand]);
170 if (spPred[v] ==
nullptr) {
173 direction[eCand] = dir;
183 edge eDual = spPred[v];
191 }
while (v != source);
199 if (prev[adj->theEdge()] ==
nullptr) {
200 queue.
append(adj->theEdge());
201 prev[adj->theEdge()] = v;
207 auto prevIt = edgeList.
begin();
208 for (
auto it = prevIt.succ(); it != edgeList.
end(); prevIt = it++) {
209 if (*prevIt == *it) {
210 edgeList.
del(prevIt);
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.
Declaration of doubly linked lists and iterators.
Template of base class of min-st-cut algorithms.
Declaration and implementation of list-based queues (classes QueuePure<E> and Queue<E>).
Basic declarations, included by all source files.
Class for adjacency list elements.
Combinatorial embeddings of planar graphs with modification functionality.
face rightFace(adjEntry adj) const
Returns the face to the right of adj, i.e., the face containing adj.
face leftFace(adjEntry adj) const
Returns the face to the left of adj, i.e., the face containing the twin of adj.
A dual graph including its combinatorial embedding of an embedded graph.
const edge & primalEdge(edge e) const
Returns the edge in the primal graph corresponding to e.
const node & dualNode(face f) const
Returns the node in the dual graph corresponding to f.
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.
void init(const Graph &G)
Re-initializes the copy using G, creating copies for all nodes and edges in G.
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.
edge newEdge(edge eOrig)
Creates a new edge (v,w) with original edge eOrig.
Data type for general directed graphs (adjacency list representation).
void allEdges(CONTAINER &edgeContainer) const
Returns a container with all edges of the graph.
void move(edge e, adjEntry adjSrc, Direction dirSrc, adjEntry adjTgt, Direction dirTgt)
Moves edge e to a different adjacency list.
Doubly linked lists (maintaining the length of the list).
void clear()
Removes all elements from the list.
iterator pushBack(const E &x)
Adds element x at the end of the list.
void del(iterator it)
Removes it from the list.
iterator begin()
Returns an iterator to the first element of the list.
iterator end()
Returns an iterator to one-past-last element of the list.
Min-st-cut algorithm, that calculates the cut by doing a depth first search over the dual graph of of...
virtual bool call(const Graph &graph, node s, node t, List< edge > &edgeList, edge e_st=nullptr) override
The actual algorithm call.
virtual bool call(const Graph &graph, const EdgeArray< TCost > &weight, node s, node t, List< edge > &edgeList, edge e_st=nullptr) override
The actual algorithm call.
bool preprocessingDual(const Graph &graph, GraphCopy &gc, CombinatorialEmbedding &CE, node source, node target, edge e_st)
This method preprocesses gc for minstcut calculations, by adding an st-edge if needed and embedding g...
Class for the representation of nodes.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.
Implementation of list-based queues.
iterator append(const E &x)
Adds x at the end of queue.
E pop()
Removes front element and returns it.
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.
RegisteredArray for nodes, edges and adjEntries of a graph.
EdgeElement * edge
The type of edges.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
The namespace for all OGDF objects.