48 template<
typename TCost>
62 bool preferedImplyPlanar)
override 72 id[v] = components.makeSet();
81 if(pCost !=
nullptr) {
90 copy.
sort(v, newOrder);
95 for (
edge e : edges) {
98 int setS = components.find(
id[s]);
99 int setT = components.find(
id[t]);
105 int setV = components.find(
id[v]);
107 if(setV != setS && setV != setT) {
111 includeEdge[e] = includeEdge[f] = includeEdge[g] =
true;
112 components.link(components.link(setS, setT), setV);
121 for(
edge e : edges) {
122 int setS = components.find(
id[e->source()]);
123 int setT = components.find(
id[e->target()]);
126 includeEdge[e] =
true;
127 components.link(setS, setT);
130 if(!includeEdge[e]) {
void clear()
Removes all elements from the list.
EdgeComparer(const GraphCopy ©, const EdgeArray< TCost > &weight)
edge theEdge() const
Returns the edge associated with this adjacency entry.
iterator pushBack(const E &x)
Adds element x at the end of the list.
Data type for general directed graphs (adjacency list representation).
const EdgeArray< TCost > & m_weight
edge searchEdge(node v, node w) const
Searches and returns an edge connecting nodes v and w in time O( min(deg(v ), deg(w )))...
void sort(node v, const ADJ_ENTRY_LIST &newOrder)
Sorts the adjacency list of node v according to newOrder.
virtual PlanarSubgraphCactus * clone() const override
Returns a new instance of the planar subgraph module with the same option settings.
ReturnType
The return type of a module.
virtual Module::ReturnType doCall(const Graph &graph, const List< edge > &, 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.
void quicksort()
Sorts the list using Quicksort.
const EdgeComparer & m_edgeComparer
Interface for planar subgraph algorithms.
static void copy(const T &from, T &to)
The solution is feasible.
A Union/Find data structure for maintaining disjoint sets.
Class for the representation of edges.
void allEdges(EDGELIST &edgeList) const
Returns a list with all edges of the graph.
void allAdjEntries(ADJLIST &adjList) const
Returns a list with all adjacency entries of this node.
Copies of graphs supporting edge splitting.
AdjEntryComparer(const EdgeComparer &edgeComparer)
Class for the representation of nodes.
node opposite(node v) const
Returns the adjacent node different from v.
const Graph & original() const
Returns a reference to the original graph.
bool isSimpleUndirected(const Graph &G)
Returns true iff G contains neither self-loops nor undirected parallel edges.
Maximum planar subgraph approximation algorithm by Calinescu et al.
bool less(adjEntry adjA, adjEntry adjB) const
bool less(const edge &e, const edge &f) const
Declaration of simple graph algorithms.
Implementation of disjoint sets data structures (union-find functionality).
The namespace for all OGDF objects.
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.
bool isConnected(const Graph &G)
Returns true iff G is connected.
Class for adjacency list elements.
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.