43 template<
typename TCost>
57 bool preferedImplyPlanar)
override {
63 TCost maxCost = std::numeric_limits<TCost>::min();
66 maxCost = max(maxCost, (*pCost)[e]);
70 weight[e] = maxCost - (*pCost)[copy.
original(e)];
76 if (copy.
copy(e) ==
nullptr) {
80 }
else if (!graph.
empty()) {
88 if (parent[v] ==
nullptr) {
92 while (!nodes.empty()) {
93 node u = nodes.popRet();
98 if (parent[w] ==
nullptr) {
111 bool vIsParent = v == parent[w];
112 bool wIsParent = w == parent[v];
116 if (e->
isSelfLoop() || (!vIsParent && !wIsParent)) {
118 }
else if (vIsParent) {
120 }
else if (wIsParent) {
node target() const
Returns the target node of the edge.
void clear()
Removes all elements from the list.
node copy(node v) const
Returns the node in the graph copy corresponding to v.
iterator pushBack(const E &x)
Adds element x at the end of the list.
Data type for general directed graphs (adjacency list representation).
An array that keeps track of the number of inserted elements; also usable as an efficient stack...
T makeMinimumSpanningTree(Graph &G, const EdgeArray< T > &weight)
Reduce a graph to its minimum spanning tree (MST) using Kruskal's algorithm.
virtual Module::ReturnType doCall(const Graph &graph, const List< edge > &preferredEdges, List< edge > &delEdges, const EdgeArray< TCost > *pCost, bool preferedImplyPlanar) override
Computes the set of edges delEdges which have to be deleted to obtain the planar subgraph.
Maximum planar subgraph heuristic that yields a spanning tree.
ReturnType
The return type of a module.
internal::GraphObjectContainer< EdgeElement > edges
The container containing all edge objects.
int numberOfEdges() const
Returns the number of edges in the graph.
Dynamic arrays indexed with nodes.
Interface for planar subgraph algorithms.
static void copy(const T &from, T &to)
The solution is feasible.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
Class for the representation of edges.
Copies of graphs supporting edge splitting.
Class for the representation of nodes.
const Graph & original() const
Returns a reference to the original graph.
int size() const
Returns the number of elements in the list.
virtual PlanarSubgraphTree * clone() const override
Returns a new instance of the planar subgraph module with the same option settings.
Declaration of simple graph algorithms.
Implementation of disjoint sets data structures (union-find functionality).
node source() const
Returns the source node of the edge.
The namespace for all OGDF objects.
Declaration of extended graph algorithms.
Declaration of interface for planar subgraph algorithms.
int numberOfNodes() const
Returns the number of nodes in the graph.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
int connectedComponents(const Graph &G, NodeArray< int > &component)
Computes the connected components of G.
bool empty() const
Returns true iff the graph is empty, i.e., contains no nodes.
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
internal::GraphObjectContainer< AdjElement > adjEntries
The container containing all entries in the adjacency list of this node.