44 template<
typename TCost>
58 bool preferedImplyPlanar)
override {
64 TCost maxCost = std::numeric_limits<TCost>::min();
71 weight[e] = maxCost - (*pCost)[copy.
original(e)];
77 if (copy.
copy(e) ==
nullptr) {
81 }
else if (!graph.
empty()) {
89 if (parent[v] ==
nullptr) {
93 while (!nodes.empty()) {
94 node u = nodes.popRet();
99 if (parent[w] ==
nullptr) {
112 bool vIsParent = v == parent[w];
113 bool wIsParent = w == parent[v];
117 if (e->
isSelfLoop() || (!vIsParent && !wIsParent)) {
119 }
else if (vIsParent) {
121 }
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.
int connectedComponents(const Graph &G, NodeArray< int > &component, List< node > *isolated=nullptr)
Computes the connected components of G and optionally generates a list of isolated nodes...
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.
bool isSelfLoop() const
Returns true iff the edge is a self-loop (source node = target node).
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.
void updateMax(T &max, const T &newValue)
Stores the maximum of max and newValue in max.
internal::GraphObjectContainer< NodeElement > nodes
The container containing all node objects.
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.