Open
Graph Drawing
Framework

 v. 2025.10-dev (Foxglove)
 

Loading...
Searching...
No Matches
OnePlanarization.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
37#include <ogdf/basic/List.h>
38#include <ogdf/basic/basic.h>
40
42class EdgePairPartition;
43
45
52private:
53 const EdgePairPartition* m_epp = nullptr;
54 NodeSet m_saturatedVertices; // vertices that are incident to an uncrossable edge
56 EdgeSet m_kiteEdges; // uncrossable
57 EdgeSet m_crossingEdges; // edges incident to crossing vertices (uncrossable)
58 EdgeSet m_freeEdges; // edges that still have at least one other edge they are allowed to cross
59 EdgeSet m_remainingEdges; // uncrossable edges that are not kite edges or crossing edges
60
61public:
62 OnePlanarization() = default;
63
65 explicit OnePlanarization(const EdgePairPartition* ep) { init(ep); }
66
68 void init(const EdgePairPartition* ep);
69
71 const EdgePairPartition* getEdgePairPartition() const { return m_epp; }
72
74 bool isPlanar() const { return ogdf::isPlanar(*this); }
75
77 const NodeSet& crossingVertices() const { return m_crossingVertices; }
78
80
84 const EdgeSet& kiteEdges() const { return m_kiteEdges; }
85
87
91 const EdgeSet& crossingEdges() const { return m_crossingEdges; }
92
94 const EdgeSet& freeEdges() const { return m_freeEdges; }
95
97 const EdgeSet& remainingEdges() const { return m_remainingEdges; }
98
101 cp.init(*reinterpret_cast<const Graph*>(this));
102 for (edge e : m_freeEdges) {
103 cp.delEdge(cp.copy(e));
104 }
105 }
106
107private:
108 using GraphCopy::init;
109};
110}
Includes declaration of graph class.
Declaration of graph copy classes.
Declaration and implementation of NodeSet, EdgeSet, and AdjEntrySet classes.
Declaration of doubly linked lists and iterators.
Basic declarations, included by all source files.
Class for the representation of edges.
Definition Graph_d.h:364
Edge sets.
Definition GraphSets.h:86
void init(const Graph &G)
Re-initializes the copy using G, creating copies for all nodes and edges in G.
Definition GraphCopy.h:72
Copies of graphs supporting edge splitting.
Definition GraphCopy.h:390
edge copy(edge e) const override
Returns the first edge in the list of edges corresponding to edge e.
Definition GraphCopy.h:463
void delEdge(edge e) override
Removes edge e and clears the list of edges corresponding to e's original edge.
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Node sets.
Definition GraphSets.h:54
A partial solution for a 1-Planarity instance, representing a node in the backtracking tree.
The graph corresponding to a partial solution for the 1-Planarity problem.
const NodeSet & crossingVertices() const
Returns the set of all crossing vertices in the graph.
const EdgeSet & kiteEdges() const
Returns the set of all kite edges in the graph.
bool isPlanar() const
Returns true if the graph is planar and thus represents a solution.
void init(const EdgePairPartition *ep)
Re-initializes the graph with ep.
const EdgeSet & crossingEdges() const
Returns the set of all edges that are incident to a crossing vertex.
const EdgeSet & freeEdges() const
Returns the set of all edges that may still cross some other edge.
OnePlanarization(const EdgePairPartition *ep)
Associates the graph with ep and computes the planarization.
void getSaturatedSubgraph(GraphCopy &cp) const
Computes the subgraph induced by uncrossable edges.
const EdgeSet & remainingEdges() const
Returns the set of all uncrossable edges that are neither crossing edges nor kite edges.
const EdgePairPartition * getEdgePairPartition() const
Returns the associated EdgePairPartition.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:118
Declaration of extended graph algorithms.
bool isPlanar(const Graph &G)
Returns true, if G is planar, false otherwise.