Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::pc_tree::PCTree Class Reference

A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or C-node and allowing arbitrary permutations of the neighbors of P-nodes while only allowing flips of C-nodes. More...

#include <ogdf/basic/pctree/PCTree.h>

+ Inheritance diagram for ogdf::pc_tree::PCTree:

Classes

struct  LoggingObserver
 
struct  NextFullLeaf
 
struct  Observer
 Interface for Observers that can be notified of all changes made to the tree during an update. More...
 

Public Member Functions

 PCTree ()
 Constructs a new PCTree. More...
 
 PCTree (const PCTree &other, PCTreeNodeArray< PCNode * > &nodeMapping, bool keep_ids=false, PCTreeForest *forest=nullptr)
 Copy a PCTree. More...
 
 PCTree (const std::string &str, bool keep_ids=false, PCTreeForest *forest=nullptr)
 Deserialize a PCTree from a string str as generated by operator<<(std::ostream&, const PCTree*) or PCTree::uniqueID(). More...
 
 PCTree (int leafNum, std::vector< PCNode * > *added=nullptr, PCTreeForest *forest=nullptr)
 Convenience method generating a PCTree consisting of a single P-node with leafNum leaves, which are all copied to the optional list added. More...
 
 PCTree (PCTreeForest *forest)
 Constructs a new PCTree that is part of forest and can thus be merged with any other PCTree of the same forest. More...
 
virtual ~PCTree ()
 
Getters
 operator const PCTreeRegistry & () const
 
PCTreeForestgetForest () const
 The PCTreeForest this PCTree belongs to, or nullptr. More...
 
bool isTrivial () const
 Whether this PCTree allows all orders (consists of a single P-node). More...
 
const IntrusiveList< PCNode > & getLeaves () const
 
size_t getLeafCount () const
 
size_t getPNodeCount () const
 
size_t getCNodeCount () const
 
PCNodegetRootNode () const
 
int getTerminalPathLength () const
 
FilteringPCTreeDFS allNodes () const
 An iterable through all nodes of this PCTree. More...
 
FilteringPCTreeDFS innerNodes () const
 An iterable through all inner (non-leaf) nodes of this PCTree. More...
 
template<typename Container >
void currentLeafOrder (Container &container) const
 Store the order of leaves currently represented by this tree in container. More...
 
std::vector< PCNode * > currentLeafOrder () const
 
bool checkValid (bool allow_small_deg=true) const
 Validity check for debugging assertions. More...
 
bool isValidOrder (const std::vector< PCNode * > &order) const
 Check whether the order order is represented by this tree. More...
 
void getTree (ogdf::Graph &tree, ogdf::GraphAttributes *g_a, PCTreeNodeArray< ogdf::node > &pc_repr, ogdf::NodeArray< PCNode * > *g_repr=nullptr, bool mark_full=false, bool show_sibs=false) const
 Get a graphical representation of this tree as Graph. More...
 
void getRestrictions (std::vector< std::vector< PCNode * >> &restrictions, PCNode *fixedLeaf=nullptr) const
 Get a list of all cyclic restrictions used to generate this tree. More...
 
template<typename R >
possibleOrders () const
 Calculate the number of cyclic orders represented by this tree. More...
 
std::ostream & uniqueID (std::ostream &os, const std::function< void(std::ostream &os, PCNode *, int)> &printNode=uid_utils::nodeToID, const std::function< bool(PCNode *, PCNode *)> &compareNodes=uid_utils::compareNodesByID)
 Print a deterministic and unique representation of this PCTree to os. More...
 
std::string uniqueID (const std::function< void(std::ostream &os, PCNode *, int)> &printNode=uid_utils::nodeToID, [[maybe_unused]] const std::function< bool(PCNode *, PCNode *)> &compareNodes=uid_utils::compareNodesByID)
 

Private Attributes

PCNodem_apexCandidate = nullptr
 
bool m_apexCandidateIsFix = false
 
PCNodem_apexTPPred2 = nullptr
 
size_t m_cNodeCount = 0
 
bool m_externalForest = true
 
PCNodem_firstPartial = nullptr
 
PCTreeForestm_forest = nullptr
 
PCNodem_lastPartial = nullptr
 
IntrusiveList< PCNodem_leaves
 
std::list< Observer * > m_observers
 
size_t m_partialCount = 0
 
size_t m_pNodeCount = 0
 
PCNodem_rootNode = nullptr
 
size_t m_terminalPathLength = 0
 

Friends

std::ostream & operator<<) (std::ostream &, const ogdf::pc_tree::PCNode *)
 
std::ostream & operator<<) (std::ostream &, const ogdf::pc_tree::PCTree *)
 
class PCNode
 
class PCTreeForest
 
class PCTreeRegistry
 

Node creation / destruction

PCNodenewNode (PCNodeType type, PCNode *parent=nullptr, int id=-1)
 Create a new node. More...
 
void destroyNode (PCNode *&node)
 Destroy a node. More...
 
void destroyNode (PCNode *const &node)
 Destroy a node. More...
 
void insertLeaves (int count, PCNode *parent, std::vector< PCNode * > *added=nullptr)
 Attach count leaves to P- or C-node parent and optionally store the new leaves in a vector added. More...
 
void replaceLeaf (int leafCount, PCNode *leaf, std::vector< PCNode * > *added=nullptr)
 Convert leaf into a P-node and attach leafCount new leaves to it. More...
 
PCNodemergeLeaves (const std::vector< PCNode * > &consecutiveLeaves, bool assumeConsecutive=false)
 Merge multiple leaves into a single one and return it. More...
 
template<typename It >
PCNodemergeLeaves (It begin, It end, bool assumeConsecutive=false)
 Merge multiple leaves into a single one and return it. More...
 
void destroyLeaf (PCNode *leaf)
 Remove a leaf and also any newly-introduced inner degree-2 or -1 nodes. More...
 
PCNodesetRoot (PCNode *newRoot)
 Overwrite the stored root for this PC-tree. More...
 
PCNodechangeRoot (PCNode *newRoot)
 Change the orientation of edges such that newRoot becomes the root of the tree. More...
 
PCNodeType changeNodeType (PCNode *node, PCNodeType newType)
 Change the type of a node and update all its registrations. More...
 
void insertTree (PCNode *at, PCTree *tree)
 Insert tree tree into this tree at node at. More...
 
void unregisterNode (PCNode *node)
 
void registerNode (PCNode *node)
 

Restrictions

bool isTrivialRestriction (int size) const
 
bool makeConsecutive (std::initializer_list< PCNode * > consecutiveLeaves)
 
bool makeConsecutive (const std::vector< PCNode * > &consecutiveLeaves)
 
template<typename It >
bool makeConsecutive (It begin, It end)
 Make the leaves contained in the range denoted by iterators begin (inclusive) to end (exclusive) consecutive in all represented orders. More...
 
void resetTempData ()
 Reset all makeConsecutive()-related temporary information, especially which leaves are full (should be made consecutive). More...
 
template<typename It >
void markLeavesFull (It begin, It end)
 Only marks leaves full, does not update partial/full info of parents. More...
 
template<typename It >
void markFull (It begin, It end, std::vector< PCNode * > *fullNodeOrder=nullptr)
 Marks the leaves contained in the range denoted by iterators begin (inclusive) to end (exclusive) full, that is marked for being made consecutive in all represented orders. More...
 
bool makeFullNodesConsecutive ()
 Updates the tree to make all leaves marked as full consecutive in all represented orders. More...
 
PCNodemarkFull (PCNode *full_node, std::vector< PCNode * > *fullNodeOrder=nullptr)
 
bool findTerminalPath ()
 
void updateSingletonTerminalPath ()
 
PCNodecreateCentralNode ()
 
int updateTerminalPath (PCNode *central, PCNode *tpNeigh)
 
void addPartialNode (PCNode *partial)
 
void removePartialNode (PCNode *partial)
 
bool checkTPPartialCNode (PCNode *node)
 
size_t findEndOfFullBlock (PCNode *node, PCNode *pred, PCNode *curr, PCNode *&fullEnd, PCNode *&emptyEnd) const
 
bool setApexCandidate (PCNode *ac, bool fix=false)
 
void replaceTPNeigh (PCNode *central, PCNode *oldTPNeigh, PCNode *newTPNeigh, PCNode *newFullNeigh, PCNode *otherEndOfFullBlock)
 
PCNodesplitOffFullPNode (PCNode *node, bool skip_parent)
 

Intersect

bool intersect (PCTree &other, PCTreeNodeArray< PCNode * > &mapping)
 Intersect the restrictions represented by this tree with those represented by other, given a bijection mapping from the leaves of other to this trees' leaves. More...
 
bool findNodeRestrictions (PCTree &applyTo, PCTreeNodeArray< PCNode * > &mapping, PCTreeNodeArray< std::vector< PCNode * >> &blockNodes, PCTreeNodeArray< std::vector< PCNode * >> &subtreeNodes, PCTreeNodeArray< PCNode * > &leafPartner, PCTreeNodeArray< bool > &isFront)
 
void restoreSubtrees (PCTreeNodeArray< std::vector< PCNode * >> &blockNodes, PCTreeNodeArray< std::vector< PCNode * >> &subtreeNodes, PCTreeNodeArray< PCNode * > &leafPartner, PCTreeNodeArray< bool > &isFront)
 

Observers

using FullLeafIter = std::function< std::function< PCNode *()>()>
 
std::list< Observer * >::const_iterator addObserver (Observer *observer)
 
void removeObserver (std::list< Observer * >::const_iterator it)
 
void removeObserver (Observer *observer)
 

Detailed Description

A PC-tree represents a set of cyclic orders of its leaves by labeling its inner nodes as either P- or C-node and allowing arbitrary permutations of the neighbors of P-nodes while only allowing flips of C-nodes.

The operation PCTree::makeConsecutive() updates the tree such that a set of leaves is consecutive in all represented cyclic orders.

If you are using this implementation, please cite the following work:

Remarks
Simon D. Fink, Matthias Pfretzschner, and Ignaz Rutter. 2023. Experimental Comparison of PC-Trees and PQ-Trees. ACM J. Exp. Algorithmics 28, Article 1.10 (December 2023). https://doi.org/10.1145/3611653

For more details, see also (open access):

Remarks
Simon D. Fink. 2024. Constrained Planarity Algorithms in Theory and Practice. Doctoral Thesis, University of Passau. https://doi.org/10.15475/cpatp.2024

Definition at line 118 of file PCTree.h.

Member Typedef Documentation

◆ FullLeafIter

using ogdf::pc_tree::PCTree::FullLeafIter = std::function<std::function<PCNode*()>()>

Definition at line 631 of file PCTree.h.

Constructor & Destructor Documentation

◆ PCTree() [1/5]

ogdf::pc_tree::PCTree::PCTree ( )
inlineexplicit

Constructs a new PCTree.

The tree will be part of an automatically managed internal forest and thus not allow merging with other trees.

Definition at line 159 of file PCTree.h.

◆ PCTree() [2/5]

ogdf::pc_tree::PCTree::PCTree ( PCTreeForest forest)
inlineexplicit

Constructs a new PCTree that is part of forest and can thus be merged with any other PCTree of the same forest.

Definition at line 164 of file PCTree.h.

◆ PCTree() [3/5]

ogdf::pc_tree::PCTree::PCTree ( int  leafNum,
std::vector< PCNode * > *  added = nullptr,
PCTreeForest forest = nullptr 
)
explicit

Convenience method generating a PCTree consisting of a single P-node with leafNum leaves, which are all copied to the optional list added.

Automatically creates and manages a forest if forest is null.

◆ PCTree() [4/5]

ogdf::pc_tree::PCTree::PCTree ( const PCTree other,
PCTreeNodeArray< PCNode * > &  nodeMapping,
bool  keep_ids = false,
PCTreeForest forest = nullptr 
)
explicit

Copy a PCTree.

Parameters
otherThe PCTree to copy.
nodeMappingWill be assigned a mapping from the nodes of other to the newly created nodes in this tree.
keep_idsSet to true to use the same node IDs as in other, otherwise consecutive IDs will be generated.
forestAutomatically create and manages a forest if forest is null.

◆ PCTree() [5/5]

ogdf::pc_tree::PCTree::PCTree ( const std::string &  str,
bool  keep_ids = false,
PCTreeForest forest = nullptr 
)
explicit

Deserialize a PCTree from a string str as generated by operator<<(std::ostream&, const PCTree*) or PCTree::uniqueID().

Automatically creates and manages a forest if forest is null.

◆ ~PCTree()

virtual ogdf::pc_tree::PCTree::~PCTree ( )
virtual

Member Function Documentation

◆ addObserver()

std::list<Observer*>::const_iterator ogdf::pc_tree::PCTree::addObserver ( Observer observer)
inline

Definition at line 697 of file PCTree.h.

◆ addPartialNode()

void ogdf::pc_tree::PCTree::addPartialNode ( PCNode partial)
private

◆ allNodes()

FilteringPCTreeDFS ogdf::pc_tree::PCTree::allNodes ( ) const
inline

An iterable through all nodes of this PCTree.

Definition at line 529 of file PCTree.h.

◆ changeNodeType()

PCNodeType ogdf::pc_tree::PCTree::changeNodeType ( PCNode node,
PCNodeType  newType 
)

Change the type of a node and update all its registrations.

Returns
the previous type of the node.

◆ changeRoot()

PCNode* ogdf::pc_tree::PCTree::changeRoot ( PCNode newRoot)

Change the orientation of edges such that newRoot becomes the root of the tree.

Returns
The previous root.
See also
setRoot()

◆ checkTPPartialCNode()

bool ogdf::pc_tree::PCTree::checkTPPartialCNode ( PCNode node)
private

◆ checkValid()

bool ogdf::pc_tree::PCTree::checkValid ( bool  allow_small_deg = true) const

Validity check for debugging assertions.

◆ createCentralNode()

PCNode* ogdf::pc_tree::PCTree::createCentralNode ( )
private

◆ currentLeafOrder() [1/2]

std::vector<PCNode*> ogdf::pc_tree::PCTree::currentLeafOrder ( ) const
inline

Definition at line 547 of file PCTree.h.

◆ currentLeafOrder() [2/2]

template<typename Container >
void ogdf::pc_tree::PCTree::currentLeafOrder ( Container &  container) const
inline

Store the order of leaves currently represented by this tree in container.

Definition at line 538 of file PCTree.h.

◆ destroyLeaf()

void ogdf::pc_tree::PCTree::destroyLeaf ( PCNode leaf)

Remove a leaf and also any newly-introduced inner degree-2 or -1 nodes.

Unlike destroyNode(), the leaf leaf must still be attached (so that its parent's degree can be checked)

See also
destroyNode()

◆ destroyNode() [1/2]

void ogdf::pc_tree::PCTree::destroyNode ( PCNode *&  node)
inline

Destroy a node.

The node must be detached and may not be the root of this tree.

Parameters
nodewill be set to null afterwards

Definition at line 218 of file PCTree.h.

◆ destroyNode() [2/2]

void ogdf::pc_tree::PCTree::destroyNode ( PCNode *const &  node)

Destroy a node.

The node must be detached and may not be the root of this tree.

◆ findEndOfFullBlock()

size_t ogdf::pc_tree::PCTree::findEndOfFullBlock ( PCNode node,
PCNode pred,
PCNode curr,
PCNode *&  fullEnd,
PCNode *&  emptyEnd 
) const
private

◆ findNodeRestrictions()

bool ogdf::pc_tree::PCTree::findNodeRestrictions ( PCTree applyTo,
PCTreeNodeArray< PCNode * > &  mapping,
PCTreeNodeArray< std::vector< PCNode * >> &  blockNodes,
PCTreeNodeArray< std::vector< PCNode * >> &  subtreeNodes,
PCTreeNodeArray< PCNode * > &  leafPartner,
PCTreeNodeArray< bool > &  isFront 
)
private

◆ findTerminalPath()

bool ogdf::pc_tree::PCTree::findTerminalPath ( )
private

◆ getCNodeCount()

size_t ogdf::pc_tree::PCTree::getCNodeCount ( ) const
inline

Definition at line 519 of file PCTree.h.

◆ getForest()

PCTreeForest* ogdf::pc_tree::PCTree::getForest ( ) const
inline

The PCTreeForest this PCTree belongs to, or nullptr.

Definition at line 508 of file PCTree.h.

◆ getLeafCount()

size_t ogdf::pc_tree::PCTree::getLeafCount ( ) const
inline

Definition at line 515 of file PCTree.h.

◆ getLeaves()

const IntrusiveList<PCNode>& ogdf::pc_tree::PCTree::getLeaves ( ) const
inline

Definition at line 513 of file PCTree.h.

◆ getPNodeCount()

size_t ogdf::pc_tree::PCTree::getPNodeCount ( ) const
inline

Definition at line 517 of file PCTree.h.

◆ getRestrictions()

void ogdf::pc_tree::PCTree::getRestrictions ( std::vector< std::vector< PCNode * >> &  restrictions,
PCNode fixedLeaf = nullptr 
) const

Get a list of all cyclic restrictions used to generate this tree.

If a fixedLeaf was given, the restrictions will linear with none of them containing fixedLeaf.

◆ getRootNode()

PCNode* ogdf::pc_tree::PCTree::getRootNode ( ) const
inline

Definition at line 521 of file PCTree.h.

◆ getTerminalPathLength()

int ogdf::pc_tree::PCTree::getTerminalPathLength ( ) const
inline
Returns
the length of the terminal path in the last update operation

Definition at line 526 of file PCTree.h.

◆ getTree()

void ogdf::pc_tree::PCTree::getTree ( ogdf::Graph tree,
ogdf::GraphAttributes g_a,
PCTreeNodeArray< ogdf::node > &  pc_repr,
ogdf::NodeArray< PCNode * > *  g_repr = nullptr,
bool  mark_full = false,
bool  show_sibs = false 
) const

Get a graphical representation of this tree as Graph.

◆ innerNodes()

FilteringPCTreeDFS ogdf::pc_tree::PCTree::innerNodes ( ) const
inline

An iterable through all inner (non-leaf) nodes of this PCTree.

Definition at line 532 of file PCTree.h.

◆ insertLeaves()

void ogdf::pc_tree::PCTree::insertLeaves ( int  count,
PCNode parent,
std::vector< PCNode * > *  added = nullptr 
)

Attach count leaves to P- or C-node parent and optionally store the new leaves in a vector added.

◆ insertTree()

void ogdf::pc_tree::PCTree::insertTree ( PCNode at,
PCTree tree 
)

Insert tree tree into this tree at node at.

Both trees need to be part of the same forest. All observers of tree will be moved to this tree. If at is a leaf, it will be replaced by tree, otherwise tree will be appended as child of at.

◆ intersect()

bool ogdf::pc_tree::PCTree::intersect ( PCTree other,
PCTreeNodeArray< PCNode * > &  mapping 
)

Intersect the restrictions represented by this tree with those represented by other, given a bijection mapping from the leaves of other to this trees' leaves.

Returns
true if the intersection is non-empty and this now represented by this tree. Otherwise, the intersection is empty and the state of this tree is undefined.

◆ isTrivial()

bool ogdf::pc_tree::PCTree::isTrivial ( ) const

Whether this PCTree allows all orders (consists of a single P-node).

◆ isTrivialRestriction()

bool ogdf::pc_tree::PCTree::isTrivialRestriction ( int  size) const
Returns
true if calling makeConsecutive() with size leaves never requires changes to the tree. This is the case for size values 0, 1, getLeafCount() - 1, and getLeafCount().
See also
ogdf::pc_tree::isTrivialRestriction()

◆ isValidOrder()

bool ogdf::pc_tree::PCTree::isValidOrder ( const std::vector< PCNode * > &  order) const

Check whether the order order is represented by this tree.

◆ makeConsecutive() [1/3]

bool ogdf::pc_tree::PCTree::makeConsecutive ( const std::vector< PCNode * > &  consecutiveLeaves)
inline

Definition at line 340 of file PCTree.h.

◆ makeConsecutive() [2/3]

template<typename It >
bool ogdf::pc_tree::PCTree::makeConsecutive ( It  begin,
It  end 
)
inline

Make the leaves contained in the range denoted by iterators begin (inclusive) to end (exclusive) consecutive in all represented orders.

This is equivalent to calling resetTempData() and markFull(It, It, std::vector<PCNode*>*) followd by makeFullNodesConsecutive().

Returns
true if the update was successful, false if the leaves cannot be made consecutive and the tree was left unchanged.

Definition at line 352 of file PCTree.h.

◆ makeConsecutive() [3/3]

bool ogdf::pc_tree::PCTree::makeConsecutive ( std::initializer_list< PCNode * >  consecutiveLeaves)
inline

Definition at line 336 of file PCTree.h.

◆ makeFullNodesConsecutive()

bool ogdf::pc_tree::PCTree::makeFullNodesConsecutive ( )

Updates the tree to make all leaves marked as full consecutive in all represented orders.

Requires labels of parents to be correctly set by markFull(It, It, std::vector<PCNode*>*).

Returns
true if the update was successful, false if the leaves cannot be made consecutive and the tree was left unchanged.

◆ markFull() [1/2]

template<typename It >
void ogdf::pc_tree::PCTree::markFull ( It  begin,
It  end,
std::vector< PCNode * > *  fullNodeOrder = nullptr 
)
inline

Marks the leaves contained in the range denoted by iterators begin (inclusive) to end (exclusive) full, that is marked for being made consecutive in all represented orders.

Also propagates the markings to parents, which is required for makeFullNodesConsecutive().

Definition at line 417 of file PCTree.h.

◆ markFull() [2/2]

PCNode* ogdf::pc_tree::PCTree::markFull ( PCNode full_node,
std::vector< PCNode * > *  fullNodeOrder = nullptr 
)
private

◆ markLeavesFull()

template<typename It >
void ogdf::pc_tree::PCTree::markLeavesFull ( It  begin,
It  end 
)
inline

Only marks leaves full, does not update partial/full info of parents.

Use markFull(It, It, std::vector<PCNode*>*) to also update parents for use with makeFullNodesConsecutive().

Definition at line 401 of file PCTree.h.

◆ mergeLeaves() [1/2]

PCNode* ogdf::pc_tree::PCTree::mergeLeaves ( const std::vector< PCNode * > &  consecutiveLeaves,
bool  assumeConsecutive = false 
)
inline

Merge multiple leaves into a single one and return it.

Parameters
consecutiveLeavesThe leaves that shall be merged.
assumeConsecutiveSet to true if you already called makeConsecutive() on the leaves.
Returns
The entry of consecutiveLeaves into which all other leaves got merged.

Definition at line 246 of file PCTree.h.

◆ mergeLeaves() [2/2]

template<typename It >
PCNode* ogdf::pc_tree::PCTree::mergeLeaves ( It  begin,
It  end,
bool  assumeConsecutive = false 
)
inline

Merge multiple leaves into a single one and return it.

Parameters
begin,endIterator range spanning the leaves that shall be merged.
assumeConsecutiveSet to true if you already called makeConsecutive() on the leaves.
Returns
The entry of consecutiveLeaves into which all other leaves got merged.

Definition at line 259 of file PCTree.h.

◆ newNode()

PCNode* ogdf::pc_tree::PCTree::newNode ( PCNodeType  type,
PCNode parent = nullptr,
int  id = -1 
)

Create a new node.

Parameters
typeThe type of the node.
parentParent to attach this node to, may only be null if this tree is empty and thus has no root.
idID for the new node, or -1 to automatically use the next free one.
Returns
the new node

◆ operator const PCTreeRegistry &()

ogdf::pc_tree::PCTree::operator const PCTreeRegistry & ( ) const
inline

Definition at line 505 of file PCTree.h.

◆ possibleOrders()

template<typename R >
R ogdf::pc_tree::PCTree::possibleOrders ( ) const
inline

Calculate the number of cyclic orders represented by this tree.

Definition at line 573 of file PCTree.h.

◆ registerNode()

void ogdf::pc_tree::PCTree::registerNode ( PCNode node)
private

◆ removeObserver() [1/2]

void ogdf::pc_tree::PCTree::removeObserver ( Observer observer)
inline

Definition at line 704 of file PCTree.h.

◆ removeObserver() [2/2]

void ogdf::pc_tree::PCTree::removeObserver ( std::list< Observer * >::const_iterator  it)
inline

Definition at line 702 of file PCTree.h.

◆ removePartialNode()

void ogdf::pc_tree::PCTree::removePartialNode ( PCNode partial)
private

◆ replaceLeaf()

void ogdf::pc_tree::PCTree::replaceLeaf ( int  leafCount,
PCNode leaf,
std::vector< PCNode * > *  added = nullptr 
)

Convert leaf into a P-node and attach leafCount new leaves to it.

◆ replaceTPNeigh()

void ogdf::pc_tree::PCTree::replaceTPNeigh ( PCNode central,
PCNode oldTPNeigh,
PCNode newTPNeigh,
PCNode newFullNeigh,
PCNode otherEndOfFullBlock 
)
private

◆ resetTempData()

void ogdf::pc_tree::PCTree::resetTempData ( )
inline

Reset all makeConsecutive()-related temporary information, especially which leaves are full (should be made consecutive).

Definition at line 386 of file PCTree.h.

◆ restoreSubtrees()

void ogdf::pc_tree::PCTree::restoreSubtrees ( PCTreeNodeArray< std::vector< PCNode * >> &  blockNodes,
PCTreeNodeArray< std::vector< PCNode * >> &  subtreeNodes,
PCTreeNodeArray< PCNode * > &  leafPartner,
PCTreeNodeArray< bool > &  isFront 
)
private

◆ setApexCandidate()

bool ogdf::pc_tree::PCTree::setApexCandidate ( PCNode ac,
bool  fix = false 
)
private

◆ setRoot()

PCNode* ogdf::pc_tree::PCTree::setRoot ( PCNode newRoot)

Overwrite the stored root for this PC-tree.

Note that the passed newRoot needs to be valid as root for this tree.

Returns
The old node stored as root.
See also
changeRoot()

◆ splitOffFullPNode()

PCNode* ogdf::pc_tree::PCTree::splitOffFullPNode ( PCNode node,
bool  skip_parent 
)
private

◆ uniqueID() [1/2]

std::string ogdf::pc_tree::PCTree::uniqueID ( const std::function< void(std::ostream &os, PCNode *, int)> &  printNode = uid_utils::nodeToID,
[[maybe_unused] ] const std::function< bool(PCNode *, PCNode *)> &  compareNodes = uid_utils::compareNodesByID 
)
inline

Definition at line 598 of file PCTree.h.

◆ uniqueID() [2/2]

std::ostream& ogdf::pc_tree::PCTree::uniqueID ( std::ostream &  os,
const std::function< void(std::ostream &os, PCNode *, int)> &  printNode = uid_utils::nodeToID,
const std::function< bool(PCNode *, PCNode *)> &  compareNodes = uid_utils::compareNodesByID 
)

Print a deterministic and unique representation of this PCTree to os.

Unique node IDs and a deterministic order of nodes' children is generated using printNode and compareNodes, respectively.

See also
ogdf::pc_tree::uid_utils

◆ unregisterNode()

void ogdf::pc_tree::PCTree::unregisterNode ( PCNode node)
private

◆ updateSingletonTerminalPath()

void ogdf::pc_tree::PCTree::updateSingletonTerminalPath ( )
private

◆ updateTerminalPath()

int ogdf::pc_tree::PCTree::updateTerminalPath ( PCNode central,
PCNode tpNeigh 
)
private

Friends And Related Function Documentation

◆ operator<<) [1/2]

std::ostream& operator<<) ( std::ostream &  ,
const ogdf::pc_tree::PCNode  
)
friend

◆ operator<<) [2/2]

std::ostream& operator<<) ( std::ostream &  ,
const ogdf::pc_tree::PCTree  
)
friend

◆ PCNode

friend class PCNode
friend

Definition at line 122 of file PCTree.h.

◆ PCTreeForest

friend class PCTreeForest
friend

Definition at line 124 of file PCTree.h.

◆ PCTreeRegistry

friend class PCTreeRegistry
friend

Definition at line 123 of file PCTree.h.

Member Data Documentation

◆ m_apexCandidate

PCNode* ogdf::pc_tree::PCTree::m_apexCandidate = nullptr
private

Definition at line 146 of file PCTree.h.

◆ m_apexCandidateIsFix

bool ogdf::pc_tree::PCTree::m_apexCandidateIsFix = false
private

Definition at line 147 of file PCTree.h.

◆ m_apexTPPred2

PCNode* ogdf::pc_tree::PCTree::m_apexTPPred2 = nullptr
private

Definition at line 148 of file PCTree.h.

◆ m_cNodeCount

size_t ogdf::pc_tree::PCTree::m_cNodeCount = 0
private

Definition at line 135 of file PCTree.h.

◆ m_externalForest

bool ogdf::pc_tree::PCTree::m_externalForest = true
private

Definition at line 151 of file PCTree.h.

◆ m_firstPartial

PCNode* ogdf::pc_tree::PCTree::m_firstPartial = nullptr
private

Definition at line 144 of file PCTree.h.

◆ m_forest

PCTreeForest* ogdf::pc_tree::PCTree::m_forest = nullptr
private

Definition at line 131 of file PCTree.h.

◆ m_lastPartial

PCNode* ogdf::pc_tree::PCTree::m_lastPartial = nullptr
private

Definition at line 145 of file PCTree.h.

◆ m_leaves

IntrusiveList<PCNode> ogdf::pc_tree::PCTree::m_leaves
private

Definition at line 136 of file PCTree.h.

◆ m_observers

std::list<Observer*> ogdf::pc_tree::PCTree::m_observers
private

Definition at line 152 of file PCTree.h.

◆ m_partialCount

size_t ogdf::pc_tree::PCTree::m_partialCount = 0
private

Definition at line 142 of file PCTree.h.

◆ m_pNodeCount

size_t ogdf::pc_tree::PCTree::m_pNodeCount = 0
private

Definition at line 134 of file PCTree.h.

◆ m_rootNode

PCNode* ogdf::pc_tree::PCTree::m_rootNode = nullptr
private

Definition at line 139 of file PCTree.h.

◆ m_terminalPathLength

size_t ogdf::pc_tree::PCTree::m_terminalPathLength = 0
private

Definition at line 143 of file PCTree.h.


The documentation for this class was generated from the following file: