This class implements the extended BoyerMyrvold planarity embedding algorithm. More...
#include <ogdf/planarity/boyer_myrvold/BoyerMyrvoldPlanar.h>
Public Types | |
| enum | EmbeddingGrade { EmbeddingGrade::doNotEmbed =-3, EmbeddingGrade::doNotFind =-2, EmbeddingGrade::doFindUnlimited =-1, EmbeddingGrade::doFindZero =0 } |
| Denotes the different embedding options. More... | |
Public Member Functions | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| BoyerMyrvoldPlanar & | operator= (const BoyerMyrvoldPlanar &) |
| Assignment operator is undefined! More... | |
| void | seed (const std::minstd_rand rand) |
| Seeds the random generator for performing a random DFS. If this method is never called the random generator will be seeded by a value extracted from the global random generator. More... | |
| bool | start () |
| Starts the embedding algorithm. More... | |
Static Public Attributes | |
| static const int | DirectionCCW |
| Direction for counterclockwise traversal. More... | |
| static const int | DirectionCW |
| Direction for clockwise traversal. More... | |
Protected Member Functions | |
Methods for Walkup and Walkdown | |
| bool | pertinent (node w) |
Checks whether node w is pertinent. w has to be non-virtual. More... | |
| bool | internallyActive (node w, int v) |
Checks whether real node w is internally active while embedding node with DFI v. More... | |
| bool | externallyActive (node w, int v) |
Checks whether real node w is externally active while embedding node with DFI v. More... | |
| bool | inactive (node w, int v) |
Checks whether real node w is inactive while embedding node with DFI v. More... | |
| int | infoAboutNode (node w, int v) |
Checks all dynamic information about a node w while embedding node with DFI v. More... | |
| node | successorOnExternalFace (node w, int &direction) |
Walks upon external face in the given direction starting at w. More... | |
| node | successorWithoutShortCircuit (node w, int &direction) |
Walks upon external face in given direction avoiding short circuit edges. More... | |
| node | constSuccessorOnExternalFace (node v, int direction) |
Returns the successornode on the external face in given direction. More... | |
| node | constSuccessorWithoutShortCircuit (node v, int direction) |
Walks upon external face in direction avoiding short circuit edges. More... | |
| adjEntry | beforeShortCircuitEdge (node v, int direction) |
Returns underlying former adjEntry, if a short circuit edge in direction of v exists. More... | |
| node | activeSuccessor (node w, int &direction, int v, int &info) |
Walks upon external face in the given direction starting at w until an active vertex is reached. More... | |
| node | constActiveSuccessor (node w, int direction, int v, int &info) |
Walks upon external face in the given direction (without changing it) until an active vertex is reached. More... | |
| bool | wNodesExist (node root, node stopx, node stopy) |
Checks, if one ore more wNodes exist between the two stopping vertices stopx and stopy. More... | |
| void | printNodeInfo (node v) |
Prints informations about node v. More... | |
| void | mergeBiconnectedComponent (StackPure< int > &stack, const int j) |
Merges the last two biconnected components saved in stack while embedding them. More... | |
| void | mergeBiconnectedComponentOnlyPlanar (StackPure< int > &stack, const int j) |
Merges the last two biconnected components saved in stack without embedding them. More... | |
| void | embedBackedges (const node v, const int v_dir, const node w, const int w_dir, const int i) |
Embeds backedges from node v with direction v_dir to node w with direction w_dir. More... | |
| void | embedBackedgesOnlyPlanar (const node v, const int v_dir, const node w, const int w_dir, const int i) |
Links (not embed) backedges from node v with direction v_dir to node w with direction w_dir. More... | |
| 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. More... | |
| node | walkup (const node v, const node w, const int marker, const edge back) |
Walkup: Builds the pertinent subgraph for the backedge back. More... | |
| int | walkdown (const int i, const node v, FindKuratowskis *findKuratowskis) |
Walkdown: Embeds all backedges with DFI i as targetnode to node v. More... | |
| void | mergeUnprocessedNodes () |
| Merges unprocessed virtual nodes such as the dfs-roots with their real counterpart. More... | |
| void | postProcessEmbedding () |
| Postprocessing of the graph, so that all virtual vertices are embedded and all bicomps are flipped. More... | |
| bool | embed () |
| Starts the embedding phase, which embeds m_g node by node in descending DFI-order. More... | |
Protected Attributes | |
| bool | m_extractSubgraph = true |
| Flag for extracting a planar subgraph instead of testing for planarity. More... | |
| int | m_flippedNodes |
| The whole number of bicomps, which have to be flipped. More... | |
| Graph & | m_g |
| Input graph, which can be altered. More... | |
Some parameters... see BoyerMyrvold for further options | |
| const bool | m_bundles |
| const int | m_embeddingGrade |
| const bool | m_limitStructures |
| const double | m_randomness |
| const bool | m_avoidE2Minors |
| const EdgeArray< int > * | m_edgeCosts |
| std::minstd_rand | m_rand |
Members from BoyerMyrvoldInit | |
| NodeArray< node > | m_realVertex |
| Link to non-virtual vertex of a virtual Vertex. More... | |
| NodeArray< int > | m_dfi |
| The one and only DFI-NodeArray. More... | |
| Array< node > | m_nodeFromDFI |
| Returns appropriate node from given DFI. More... | |
| NodeArray< adjEntry > | m_link [2] |
| Links to opposite adjacency entries on external face in clockwise resp. ccw order. More... | |
| NodeArray< adjEntry > | m_beforeSCE [2] |
| Links for short circuit edges. More... | |
| NodeArray< adjEntry > | m_adjParent |
| The adjEntry which goes from DFS-parent to current vertex. More... | |
| NodeArray< int > | m_leastAncestor |
| The DFI of the least ancestor node over all backedges. More... | |
| EdgeArray< BoyerMyrvoldEdgeType > | m_edgeType |
| Contains the type of each edge. More... | |
| NodeArray< int > | m_lowPoint |
| The lowpoint of each node. More... | |
| NodeArray< int > | m_highestSubtreeDFI |
| The highest DFI in a subtree with node as root. More... | |
| NodeArray< ListPure< node > > | m_separatedDFSChildList |
| A list to all separated DFS-children of node. More... | |
| NodeArray< ListIterator< node > > | m_pNodeInParent |
| Pointer to node contained in the DFSChildList of his parent, if exists. More... | |
Members for Walkup and Walkdown | |
| NodeArray< int > | m_visited |
| This Array keeps track of all vertices that are visited by current walkup. More... | |
| EdgeArray< node > | m_pointsToRoot |
| Identifies the rootnode of the child bicomp the given backedge points to. More... | |
| NodeArray< int > | m_visitedWithBackedge |
| Keeps track of all vertices that are visited by the walkup through a specific backedge. More... | |
| NodeArray< bool > | m_flipped |
| Iff true, the node is the root of a bicomp which has to be flipped. More... | |
| NodeArray< SListPure< adjEntry > > | m_backedgeFlags |
| Holds information, if node is the source of a backedge. More... | |
| NodeArray< SListPure< node > > | m_pertinentRoots |
| List of virtual bicomp roots, that are pertinent to the current embedded node. More... | |
| SListPure< KuratowskiStructure > & | m_output |
| Data structure for the Kuratowski subdivisions, which will be returned. More... | |
Friends | |
| class | boyer_myrvold::BoyerMyrvoldInit |
| class | BoyerMyrvold |
| class | ExtractKuratowskis |
| class | FindKuratowskis |
This class implements the extended BoyerMyrvold planarity embedding algorithm.
Definition at line 61 of file BoyerMyrvoldPlanar.h.
|
strong |
Denotes the different embedding options.
| Enumerator | |
|---|---|
| doNotEmbed | |
| doNotFind | |
| doFindUnlimited | |
| doFindZero | |
Definition at line 76 of file BoyerMyrvoldPlanar.h.
| ogdf::BoyerMyrvoldPlanar::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.
|
inline |
Constructor, for parameters see BoyerMyrvold.
Definition at line 96 of file BoyerMyrvoldPlanar.h.
|
protected |
Walks upon external face in the given direction starting at w until an active vertex is reached.
Returns dynamical typeinformation info of that endvertex.
Returns underlying former adjEntry, if a short circuit edge in direction of v exists.
Otherwise the common edge is returned. In every case the returned adjEntry points to the targetnode.
Definition at line 252 of file BoyerMyrvoldPlanar.h.
|
inlineprotected |
Walks upon external face in the given direction (without changing it) until an active vertex is reached.
Returns dynamical typeinformation info of that endvertex. But does not change the direction.
Definition at line 265 of file BoyerMyrvoldPlanar.h.
|
inlineprotected |
Returns the successornode on the external face in given direction.
direction is not changed.
Definition at line 233 of file BoyerMyrvoldPlanar.h.
|
inlineprotected |
Walks upon external face in direction avoiding short circuit edges.
direction is not changed.
Definition at line 242 of file BoyerMyrvoldPlanar.h.
|
protected |
Creates a short circuit edge from node v with direction v_dir to node w with direction w_dir.
|
protected |
Starts the embedding phase, which embeds m_g node by node in descending DFI-order.
Returns true, if graph is planar, false otherwise.
|
protected |
Embeds backedges from node v with direction v_dir to node w with direction w_dir.
i is the DFI of current embedded node.
|
protected |
Links (not embed) backedges from node v with direction v_dir to node w with direction w_dir.
i is the DFI of current embedded node.
|
inlineprotected |
Checks whether real node w is externally active while embedding node with DFI v.
Definition at line 155 of file BoyerMyrvoldPlanar.h.
| void ogdf::BoyerMyrvoldPlanar::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.
| c | is the unique rootchild of the bicomp |
| marker | is the value which marks nodes as visited |
| visited | is the array containing visiting information |
| wholeGraph | Iff true, all bicomps of all connected components will be traversed |
| deleteFlipFlags | Iff true, the flipping flags will be deleted after flipping |
|
inlineprotected |
Checks whether real node w is inactive while embedding node with DFI v.
Definition at line 163 of file BoyerMyrvoldPlanar.h.
|
inlineprotected |
Checks all dynamic information about a node w while embedding node with DFI v.
Definition at line 179 of file BoyerMyrvoldPlanar.h.
|
inlineprotected |
Checks whether real node w is internally active while embedding node with DFI v.
Definition at line 149 of file BoyerMyrvoldPlanar.h.
|
protected |
Merges the last two biconnected components saved in stack while embedding them.
j is the outgoing traversal direction of the current node to embed
|
protected |
Merges the last two biconnected components saved in stack without embedding them.
j is the outgoing traversal direction of the current node to embed
|
protected |
Merges unprocessed virtual nodes such as the dfs-roots with their real counterpart.
| BoyerMyrvoldPlanar& ogdf::BoyerMyrvoldPlanar::operator= | ( | const BoyerMyrvoldPlanar & | ) |
Assignment operator is undefined!
|
inlineprotected |
Checks whether node w is pertinent. w has to be non-virtual.
Definition at line 143 of file BoyerMyrvoldPlanar.h.
|
protected |
Postprocessing of the graph, so that all virtual vertices are embedded and all bicomps are flipped.
In addition, embedding steps for parallel edges and self-loops are implemented.
|
inlineprotected |
Prints informations about node v.
Definition at line 294 of file BoyerMyrvoldPlanar.h.
|
inline |
Seeds the random generator for performing a random DFS. If this method is never called the random generator will be seeded by a value extracted from the global random generator.
Definition at line 134 of file BoyerMyrvoldPlanar.h.
| bool ogdf::BoyerMyrvoldPlanar::start | ( | ) |
Starts the embedding algorithm.
Walks upon external face in the given direction starting at w.
If none of the bicomps has been flipped then CW = clockwise and CCW = counterclockwise holds. In general, the traversaldirection could have been changed due to flipped components. If this occurs, the traversaldirection is flipped.
Definition at line 201 of file BoyerMyrvoldPlanar.h.
|
inlineprotected |
Walks upon external face in given direction avoiding short circuit edges.
Definition at line 216 of file BoyerMyrvoldPlanar.h.
|
protected |
Walkdown: Embeds all backedges with DFI i as targetnode to node v.
| i | is the DFI of the current vertex to embed |
| v | is the virtual node being the root of the bicomp attached to i |
| findKuratowskis | collects information in order to extract Kuratowski Subdivisions later |
|
protected |
Walkup: Builds the pertinent subgraph for the backedge back.
back is the backedge between nodes v and w. v is the current node to embed. All visited nodes are marked with value marker. The Function returns the last traversed node.
Checks, if one ore more wNodes exist between the two stopping vertices stopx and stopy.
The node root is root of the bicomp containing the stopping vertices
Definition at line 272 of file BoyerMyrvoldPlanar.h.
|
friend |
Definition at line 64 of file BoyerMyrvoldPlanar.h.
|
friend |
Definition at line 63 of file BoyerMyrvoldPlanar.h.
|
friend |
Definition at line 66 of file BoyerMyrvoldPlanar.h.
|
friend |
Definition at line 65 of file BoyerMyrvoldPlanar.h.
|
static |
Direction for counterclockwise traversal.
Definition at line 70 of file BoyerMyrvoldPlanar.h.
|
static |
Direction for clockwise traversal.
Definition at line 73 of file BoyerMyrvoldPlanar.h.
The adjEntry which goes from DFS-parent to current vertex.
Definition at line 410 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 372 of file BoyerMyrvoldPlanar.h.
Holds information, if node is the source of a backedge.
This information refers to the adjEntries on the targetnode and is used during the walkdown
Definition at line 462 of file BoyerMyrvoldPlanar.h.
Links for short circuit edges.
If short circuit edges are introduced, the former adjEntries to the neighbors have to be saved here for embedding and merging purposes. If there is no short circuit edge, this adjEntry is nullptr.
Definition at line 407 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 368 of file BoyerMyrvoldPlanar.h.
|
protected |
The one and only DFI-NodeArray.
Definition at line 392 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 373 of file BoyerMyrvoldPlanar.h.
|
protected |
Contains the type of each edge.
Definition at line 418 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 369 of file BoyerMyrvoldPlanar.h.
|
protected |
Flag for extracting a planar subgraph instead of testing for planarity.
Definition at line 378 of file BoyerMyrvoldPlanar.h.
|
protected |
Iff true, the node is the root of a bicomp which has to be flipped.
The DFS-child of every bicomp root vertex is unique. if a bicomp is flipped, this DFS-child is marked to check whether the bicomp has to be flipped or not.
Definition at line 456 of file BoyerMyrvoldPlanar.h.
|
protected |
The whole number of bicomps, which have to be flipped.
Definition at line 381 of file BoyerMyrvoldPlanar.h.
|
protected |
Input graph, which can be altered.
Definition at line 364 of file BoyerMyrvoldPlanar.h.
|
protected |
The highest DFI in a subtree with node as root.
Definition at line 424 of file BoyerMyrvoldPlanar.h.
|
protected |
The DFI of the least ancestor node over all backedges.
If no backedge exists, the least ancestor is the DFI of that node itself
Definition at line 415 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 370 of file BoyerMyrvoldPlanar.h.
Links to opposite adjacency entries on external face in clockwise resp. ccw order.
m_link[0]=CCW, m_link[1]=CW
Definition at line 400 of file BoyerMyrvoldPlanar.h.
|
protected |
The lowpoint of each node.
Definition at line 421 of file BoyerMyrvoldPlanar.h.
Returns appropriate node from given DFI.
Definition at line 395 of file BoyerMyrvoldPlanar.h.
|
protected |
Data structure for the Kuratowski subdivisions, which will be returned.
Definition at line 468 of file BoyerMyrvoldPlanar.h.
List of virtual bicomp roots, that are pertinent to the current embedded node.
Definition at line 465 of file BoyerMyrvoldPlanar.h.
|
protected |
Pointer to node contained in the DFSChildList of his parent, if exists.
If node isn't in list or list doesn't exist, the pointer is set to nullptr.
Definition at line 434 of file BoyerMyrvoldPlanar.h.
Identifies the rootnode of the child bicomp the given backedge points to.
Definition at line 444 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 374 of file BoyerMyrvoldPlanar.h.
|
protected |
Definition at line 371 of file BoyerMyrvoldPlanar.h.
Link to non-virtual vertex of a virtual Vertex.
A virtual vertex has negative DFI of the DFS-Child of related non-virtual Vertex
Definition at line 389 of file BoyerMyrvoldPlanar.h.
A list to all separated DFS-children of node.
The list is sorted by lowpoint values (in linear time)
Definition at line 429 of file BoyerMyrvoldPlanar.h.
|
protected |
This Array keeps track of all vertices that are visited by current walkup.
Definition at line 441 of file BoyerMyrvoldPlanar.h.
|
protected |
Keeps track of all vertices that are visited by the walkup through a specific backedge.
This is done in order to refer to the unique child-bicomp of v.
Definition at line 449 of file BoyerMyrvoldPlanar.h.