|
Open Graph Drawing Framework |
v. 2023.09 (Elderberry)
|
|
|
Go to the documentation of this file.
45 template<
class E,
class INDEX>
58 class FindKuratowskis;
59 class KuratowskiStructure;
61 namespace boyer_myrvold {
62 class BoyerMyrvoldInit;
96 :
BoyerMyrvoldPlanar(g, bundles, static_cast<int>(embeddingGrade), limitStructures, output,
97 randomness, avoidE2Minors, extractSubgraph, edgeCosts) { }
110 bool deleteFlipFlags);
244 return m_link[direction][v]->theNode();
286 bool between =
false;
287 while (root !=
nullptr) {
292 if (root == stopx || root == stopy) {
305 <<
"\nprintNodeInfo(" <<
m_dfi[v] <<
"): "
315 std::cout << adj->
twinNode() <<
" ";
480 return lhs >
static_cast<int>(rhs);
484 return lhs ==
static_cast<int>(rhs);
488 return lhs !=
static_cast<int>(rhs);
492 return lhs <= static_cast<int>(rhs);
The namespace for all OGDF objects.
BoyerMyrvoldPlanar & operator=(const BoyerMyrvoldPlanar &)
Assignment operator is undefined!
BoyerMyrvoldPlanar(Graph &g, bool bundles, EmbeddingGrade embeddingGrade, bool limitStructures, SListPure< KuratowskiStructure > &output, double randomness, bool avoidE2Minors, bool extractSubgraph, const EdgeArray< int > *edgeCosts=nullptr)
Constructor, for parameters see BoyerMyrvold.
Includes declaration of graph class.
void seed(const std::minstd_rand rand)
Seeds the random generator for performing a random DFS. If this method is never called the random gen...
bool pertinent(node w) const
Checks whether node w is pertinent. w has to be non-virtual.
void mergeBiconnectedComponent(ArrayBuffer< int > &stack)
Merges the last two biconnected components saved in stack. Embeds them iff m_embeddingGrade !...
#define OGDF_ASSERT(expr)
Assert condition expr. See doc/build.md for more information.
NodeArray< int > m_dfi
The one and only DFI-NodeArray.
NodeArray< int > m_highestSubtreeDFI
The highest DFI in a subtree with node as root.
node theNode() const
Returns the node whose adjacency list contains this element.
bool m_extractSubgraph
Flag for extracting a planar subgraph instead of testing for planarity.
void createShortCircuitEdge(const node v, const int v_dir, const node w, const int w_dir)
Creates a short circuit edge from node v with direction v_dir to node w with direction w_dir.
bool inactive(node w, int v)
Checks whether real node w is inactive while embedding node with DFI v.
node activeSuccessor(node w, int &direction, int v, int &info) const
Walks upon external face in the given direction starting at w until an active vertex is reached.
NodeArray< ListPure< node > > m_separatedDFSChildList
A list to all separated DFS-children of node.
NodeArray< int > m_leastAncestor
The DFI of the least ancestor node over all backedges.
NodeArray< adjEntry > m_adjParent
The adjEntry which goes from DFS-parent to current vertex.
const EdgeArray< int > * m_edgeCosts
const double m_randomness
NodeArray< int > m_numUnembeddedBackedgesInBicomp
Stores for each (virtual) bicomp root how many backedges to its bicomp still have to be embedded.
bool operator==(const Tuple2< E1, E2 > &t1, const Tuple2< E1, E2 > &t2)
Equality operator for 2-tuples.
bool embed()
Starts the embedding phase, which embeds m_g node by node in descending DFI-order.
BoyerMyrvoldPlanar(Graph &g, bool bundles, int embeddingGrade, bool limitStructures, SListPure< KuratowskiStructure > &output, double randomness, bool avoidE2Minors, bool extractSubgraph, const EdgeArray< int > *edgeCosts=nullptr)
Constructor, for parameters see BoyerMyrvold.
NodeArray< SListPure< adjEntry > > m_backedgeFlags
Holds information, if node is the source of a backedge.
const static int DirectionCCW
Direction for counterclockwise traversal.
bool externallyActive(node w, int v) const
Checks whether real node w is externally active while embedding node with DFI v.
NodeArray< edge > m_visitedWithBackedge
Stores for each (real) non-root vertex v with which backedge it was visited during the walkup.
node constSuccessorWithoutShortCircuit(node v, int direction) const
Walks upon external face in direction avoiding short circuit edges.
const bool m_avoidE2Minors
adjEntry twin() const
Returns the corresponding adjacency element associated with the same edge.
NodeArray< SListPure< node > > m_pertinentRoots
List of virtual bicomp roots, that are pertinent to the current embedded node.
Array< node > m_nodeFromDFI
Returns appropriate node from given DFI.
Class for adjacency list elements.
node successorWithoutShortCircuit(node w, int &direction)
Walks upon external face in given direction avoiding short circuit edges.
int walkdown(const int i, const node v, FindKuratowskis *findKuratowskis)
Walkdown: Embeds all backedges with DFI i as targetnode to node v.
NodeArray< bool > m_flipped
Iff true, the node is the root of a bicomp which has to be flipped.
@ DfsParallel
parallel DFS-edge
node constSuccessorOnExternalFace(node v, int direction)
Returns the successornode on the external face in given direction.
int infoAboutNode(node w, int v) const
Checks all dynamic information about a node w while embedding node with DFI v.
void flipBicomp(int c, int marker, NodeArray< int > &visited, bool wholeGraph, bool deleteFlipFlags)
Flips all nodes of the bicomp with unique, real, rootchild c as necessary.
bool wNodesExist(node root, node stopx, node stopy) const
Checks, if one ore more wNodes exist between the two stopping vertices stopx and stopy.
NodeArray< ListIterator< node > > m_pNodeInParent
Pointer to node contained in the DFSChildList of his parent, if exists.
int degree() const
Returns the degree of the node (indegree + outdegree).
EmbeddingGrade
Denotes the different embedding options.
const int m_embeddingGrade
SListPure< KuratowskiStructure > & m_output
Data structure for the Kuratowski subdivisions, which will be returned.
EdgeArray< BoyerMyrvoldEdgeType > m_edgeType
Contains the type of each edge.
Declaration of singly linked lists and iterators.
adjEntry succ() const
Returns the successor in the adjacency list.
void printNodeInfo(node v)
Prints informations about node v.
adjEntry beforeShortCircuitEdge(node v, int direction) const
Returns underlying former adjEntry, if a short circuit edge in direction of v exists.
NodeArray< int > m_visited
This Array keeps track of all vertices that are visited by current walkup.
void postProcessEmbedding()
Postprocessing of the graph, so that all virtual vertices are embedded and all bicomps are flipped.
RegisteredArray for nodes, edges and adjEntries of a graph.
NodeArray< int > m_lowPoint
The lowpoint of each node.
@ BackDeleted
deleted backedge
Data type for general directed graphs (adjacency list representation).
int m_flippedNodes
The whole number of bicomps, which have to be flipped.
void embedBackedges(const node v, const int v_dir, const node w, const int w_dir)
Links (and embeds iff m_embeddingGrade != EmbeddingGrade::doNotEmbed) backedges from node v with dire...
bool operator!=(const Tuple2< E1, E2 > &t1, const Tuple2< E1, E2 > &t2)
Inequality operator for 2-tuples.
node twinNode() const
Returns the associated node of the corresponding adjacency entry (shorthand for twin()->theNode()).
NodeArray< node > m_realVertex
Link to non-virtual vertex of a virtual Vertex.
bool start()
Starts the embedding algorithm.
Wrapper class used for preprocessing and valid invocation of the planarity test.
EdgeArray< node > m_pointsToRoot
Identifies the rootnode of the child bicomp the given backedge points to.
node walkup(const node v, const node w, const int marker, const edge back)
Walkup: Builds the pertinent subgraph for the backedge back.
NodeArray< adjEntry > m_link[2]
Links to opposite adjacency entries on external face in clockwise resp. ccw order.
const bool m_limitStructures
Basic declarations, included by all source files.
bool operator>(int lhs, BoyerMyrvoldPlanar::EmbeddingGrade rhs)
bool internallyActive(node w, int v) const
Checks whether real node w is internally active while embedding node with DFI v.
Graph & m_g
Input graph, which can be altered.
adjEntry firstAdj() const
Returns the first entry in the adjaceny list.
node constActiveSuccessor(node w, int direction, int v, int &info) const
Walks upon external face in the given direction (without changing it) until an active vertex is reach...
This class collects information about Kuratowski Subdivisions which is used for extraction later.
Declaration and implementation of Array class and Array algorithms.
This class implements the extended BoyerMyrvold planarity embedding algorithm.
node successorOnExternalFace(node w, int &direction) const
Walks upon external face in the given direction starting at w.
Class for the representation of edges.
Declaration of doubly linked lists and iterators.
NodeArray< adjEntry > m_beforeSCE[2]
Links for short circuit edges.
BoyerMyrvoldEdgeType
Type of edge.
const static int DirectionCW
Direction for clockwise traversal.
This class is used in the Boyer-Myrvold planarity test for preprocessing purposes.
Class for the representation of nodes.
void mergeUnprocessedNodes()
Merges unprocessed virtual nodes such as the dfs-roots with their real counterpart.
bool operator<=(int lhs, BoyerMyrvoldPlanar::EmbeddingGrade rhs)
RegisteredArray for edges of a graph, specialized for EdgeArray<edge>.