BFS tree used by both classical algorithms (LT and Dual). More...
#include <ogdf/graphalg/PlanarSeparatorModule.h>
Inheritance diagram for ogdf::planar_separators::BFSTreeClassical:Public Member Functions | |
| BFSTreeClassical (GraphCopy &G, node rootNode, unsigned int heightMaxIterations, bool findLevelsSimple=false) | |
| Constructor. | |
| ~BFSTreeClassical () | |
| void | construct (node rootNode, unsigned int numIterations) |
| Constructs the tree. | |
| void | createNewRoot (bool useTriBFS=false) |
| Creates a new root node for the graph, replacing all levels below t0. | |
| int | get_t0 () const |
| int | get_t1 () const |
| int | get_t2 () const |
| List< node > | getLevel (int level) const |
| Returns a level of the tree. | |
| List< node > | getNodesFrom (int start) const |
| Returns all nodes from a given level onwards. | |
| List< node > | getNodesFromTo (int start, int end) const |
| Returns all nodes between two levels. | |
| int | getSeparatorLevel () const |
| int | getSizeOfLevel (int level) const |
| Gets the size of a specific level. | |
| bool | isVisited (node n) const |
| Checks whether a node is visited by BFS. | |
| void | reconstruct () |
| Reconstructs the tree using triangulating bfs. | |
| void | removeSeparatorLevels (List< node > &separator, List< node > &second) |
| Removes the two separator levels t0 and t2 from the tree. | |
| void | restructure (List< node > &separator, List< node > &second, bool useTriBFS=false) |
| Restructures the tree by adding a new root and deleting all nodes below t0 and above t2, adding all nodes that are removed to the second component and keeping levels t0 and t2 in the separator. | |
Public Member Functions inherited from ogdf::planar_separators::ArrayBFSTree | |
| ArrayBFSTree (GraphCopy &G, node rootNode) | |
| Constructor. | |
| adjEntry | getAdjToParent (node n) const override |
Returns the adjEntry that leads up to the parent of n. | |
| List< node > | getChildrenOfNode (node n) const override |
| Returns all (immediate) children of a node. | |
| int | getDescendantsOfNode (node n) const override |
| Returns the total number of children, grandchildren etc. | |
| GraphCopy * | getGraph () const override |
| Allows access to a copy of the graph. | |
| int | getGraphSize () const override |
| Gets the number of nodes of the graph. | |
| int | getLevelOfNode (node n) const override |
| Returns the level (=depth in the tree) for a node. | |
| node | getParentOfNode (node n) const override |
Returns the node that is the parent of n in the tree. | |
| node | getRoot () const override |
| Gets the current root node of the tree. | |
| void | init () |
| Initializes all internal arrays. | |
| bool | isInTree (edge e) const override |
| Checks if an edge is a tree-edge. | |
Public Member Functions inherited from ogdf::planar_separators::BFSTree | |
| virtual | ~BFSTree ()=default |
Protected Member Functions | |
| void | findLevels () |
| Finds the levels t0 and t2 of the tree that might serve as separators. | |
| void | findLevelsSimple () |
| Simplified version of findLevels that simply finds a level smaller than sqrt(n). | |
Private Member Functions | |
| void | visit (node v, node parent, adjEntry adj, SListPure< node > &bfs) |
Private Attributes | |
| bool | belowMiddle = true |
| int | currentLevel = 0 |
| unsigned int | heightMaxIterations |
| int | k |
| List< List< node > > | levels |
| double | m_ratio |
| bool | simple |
| int | t0 |
| int | t1 |
| int | t2 |
Additional Inherited Members | |
Protected Attributes inherited from ogdf::planar_separators::ArrayBFSTree | |
| NodeArray< List< node > > | childrenOfNode |
| NodeArray< int > | descendantsOfNode |
| NodeArray< adjEntry > | edgeToParent |
| EdgeArray< bool > | inTree |
| NodeArray< int > | levelOfNode |
| NodeArray< bool > | mark |
| NodeArray< node > | parentOfNode |
| GraphCopy * | pGraph |
| node | root |
BFS tree used by both classical algorithms (LT and Dual).
Definition at line 233 of file PlanarSeparatorModule.h.
| ogdf::planar_separators::BFSTreeClassical::BFSTreeClassical | ( | GraphCopy & | G, |
| node | rootNode, | ||
| unsigned int | heightMaxIterations, | ||
| bool | findLevelsSimple = false |
||
| ) |
Constructor.
| G | the graph |
| rootNode | node at which tree should be rooted |
| heightMaxIterations | how many iterations of tree height maximization to run |
| findLevelsSimple | whether the levels should be found using the simple method or not |
|
inline |
Definition at line 246 of file PlanarSeparatorModule.h.
| void ogdf::planar_separators::BFSTreeClassical::construct | ( | node | rootNode, |
| unsigned int | numIterations | ||
| ) |
Constructs the tree.
| rootNode | the root node at which construction starts in this iteration |
| numIterations | how many iterations of tree height maximization to run |
| void ogdf::planar_separators::BFSTreeClassical::createNewRoot | ( | bool | useTriBFS = false | ) |
Creates a new root node for the graph, replacing all levels below t0.
| useTriBFS | whether to use triangulating BFS or not |
|
protected |
Finds the levels t0 and t2 of the tree that might serve as separators.
This is the original version described by Lipton & Tarjan.
|
protected |
Simplified version of findLevels that simply finds a level smaller than sqrt(n).
|
inline |
Definition at line 329 of file PlanarSeparatorModule.h.
|
inline |
Definition at line 331 of file PlanarSeparatorModule.h.
|
inline |
Definition at line 333 of file PlanarSeparatorModule.h.
Returns a level of the tree.
| level | index of the desired level |
Returns all nodes from a given level onwards.
| start | index of the start level |
Returns all nodes between two levels.
| start | index of the start level |
| end | index of the end level |
|
inline |
Definition at line 327 of file PlanarSeparatorModule.h.
| int ogdf::planar_separators::BFSTreeClassical::getSizeOfLevel | ( | int | level | ) | const |
Gets the size of a specific level.
| level | index of the desired level |
|
inline |
Checks whether a node is visited by BFS.
| n | the node |
Definition at line 325 of file PlanarSeparatorModule.h.
| void ogdf::planar_separators::BFSTreeClassical::reconstruct | ( | ) |
Reconstructs the tree using triangulating bfs.
| void ogdf::planar_separators::BFSTreeClassical::removeSeparatorLevels | ( | List< node > & | separator, |
| List< node > & | second | ||
| ) |
Removes the two separator levels t0 and t2 from the tree.
| separator | the list of separator nodes |
| second | the second component |
| void ogdf::planar_separators::BFSTreeClassical::restructure | ( | List< node > & | separator, |
| List< node > & | second, | ||
| bool | useTriBFS = false |
||
| ) |
Restructures the tree by adding a new root and deleting all nodes below t0 and above t2, adding all nodes that are removed to the second component and keeping levels t0 and t2 in the separator.
| separator | the list of separator nodes |
| second | the second component of the separation |
| useTriBFS | whether to use triangulating BFS |
|
private |
|
private |
Definition at line 356 of file PlanarSeparatorModule.h.
|
private |
Definition at line 355 of file PlanarSeparatorModule.h.
|
private |
Definition at line 351 of file PlanarSeparatorModule.h.
|
private |
Definition at line 363 of file PlanarSeparatorModule.h.
Definition at line 349 of file PlanarSeparatorModule.h.
|
private |
Definition at line 357 of file PlanarSeparatorModule.h.
|
private |
Definition at line 352 of file PlanarSeparatorModule.h.
|
private |
Definition at line 360 of file PlanarSeparatorModule.h.
|
private |
Definition at line 361 of file PlanarSeparatorModule.h.
|
private |
Definition at line 362 of file PlanarSeparatorModule.h.