Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
ogdf::SeparatorDual Class Reference

Computes planar separators using the Dual of the graph. More...

#include <ogdf/graphalg/SeparatorDual.h>

+ Inheritance diagram for ogdf::SeparatorDual:

Public Member Functions

 SeparatorDual (bool useTriangulatingBFS=false, unsigned int treeHeightIt=0)
 Constructor.
 
virtual double getMaxSeparatorSize (int n) const override
 Provides the maximal separator size that this algorithm guarantees as a function of the number of nodes of the graph, or a negative value if the guarantee cannot be expressed through such a function.
 
virtual std::string getSpecificName () const override
 Returns the unique name of the core algorithm, to be combined with postprocessors later.
 
- Public Member Functions inherited from ogdf::SeparatorLiptonTarjan
 SeparatorLiptonTarjan (bool useTriangulatingBFS=false, unsigned int treeHeightIt=0)
 Constructor.
 
- Public Member Functions inherited from ogdf::PlanarSeparatorModule
 PlanarSeparatorModule ()
 
virtual ~PlanarSeparatorModule ()
 
void addPostProcessor (Postprocessor &post)
 Adds a postprocessor to this separator, which will always be applied.
 
void clearPostProcessors ()
 Deletes all appended postprocessors from this separator.
 
std::string getExitPoint () const
 Returns the exitPoint, i.e.
 
virtual std::string getName () const
 Returns the full name of this algorithm.
 
virtual bool separate (const Graph &G, List< node > &separator, List< node > &first, List< node > &second, bool checkPreconditions=true) final
 Separates a planar graph.
 
virtual bool separate (const Graph &G, NodeArray< short > &assignments, bool checkPreconditions=true) final
 Separates a planar graph.
 
void setStartIndex (int index)
 

Protected Member Functions

virtual bool doSeparate (const Graph &G, List< node > &separator, List< node > &first, List< node > &second) override
 Core of the specific separation algorithm - override this in inheriting classes.
 
virtual void makeTree () override
 Creates the BFS tree used by the algorithm.
 
- Protected Member Functions inherited from ogdf::SeparatorLiptonTarjan
edge chooseEdge () const
 Chooses the initial edge for the very first cycle.
 
void fillLists (List< node > &separator, List< node > &first, List< node > &second) const
 Fills the lists with the cycle / inside / outside once the cycle is ready.
 
- Protected Member Functions inherited from ogdf::PlanarSeparatorModule
bool cleanup (const Graph &G, List< node > &separator, List< node > &first, List< node > &second)
 Performs built-in post-processing: For small instances, it can happen that all nodes are assigned to the separator, while both components are empty, which can be fixed by moving half of the nodes to the first list.
 
node getStartNode (const Graph &G) const
 Selects the starting node for the BFS.
 
bool postProcess (const Graph &G, List< node > &separator, List< node > &first, List< node > &second)
 Apply all postprocessors.
 
virtual void reset ()
 Reset everything to enable reuse of the module.
 
bool separateComponents (GraphCopy &G, List< node > &separator, List< node > &first, List< node > &second, bool skip=false) const
 Checks if the graph consists of multiple connected components, takes necessary steps for fixing that, returns true if this already solved the graph, false if the core algorithm still needs to run.
 
bool setup (const Graph &G, List< node > &separator, List< node > &first, List< node > &second, bool checkPreconditions=true)
 Performs some initial setup to ensure that all preconditions hold and takes trivial steps to separate the graph.
 

Protected Attributes

unsigned int treeHeightIterations
 
bool useTriBFS
 
- Protected Attributes inherited from ogdf::SeparatorLiptonTarjan
std::shared_ptr< BFSTreeClassicaltree
 
unsigned int treeHeightIterations
 
bool useTriBFS
 
- Protected Attributes inherited from ogdf::PlanarSeparatorModule
std::string exitPoint
 
std::shared_ptr< GraphCopygraph
 
std::vector< Postprocessor * > postProcessors
 
int startNodeIndex = -1
 

Detailed Description

Computes planar separators using the Dual of the graph.

Computes planar separators using the dual of the graph as presented in the textbook "The Design and Analysis of Algorithms" by D. Kozen, Springer, 1992.

Definition at line 51 of file SeparatorDual.h.

Constructor & Destructor Documentation

◆ SeparatorDual()

ogdf::SeparatorDual::SeparatorDual ( bool  useTriangulatingBFS = false,
unsigned int  treeHeightIt = 0 
)
inline

Constructor.

Parameters
useTriangulatingBFSwhether to use triangulating BFS for the second phase or not
treeHeightIthow many iterations of tree height maximization to perform in the first phase

Definition at line 59 of file SeparatorDual.h.

Member Function Documentation

◆ doSeparate()

virtual bool ogdf::SeparatorDual::doSeparate ( const Graph G,
List< node > &  separator,
List< node > &  first,
List< node > &  second 
)
overrideprotectedvirtual

Core of the specific separation algorithm - override this in inheriting classes.

Precondition
G is planar, simple-undirected, connected and represents a Combinatorial Embedding = is planarly embedded already.
Parameters
Gthe graph to be separated
separatorthe separator nodes
firstthe first component
secondthe second component
Returns
true on success

Reimplemented from ogdf::SeparatorLiptonTarjan.

◆ getMaxSeparatorSize()

virtual double ogdf::SeparatorDual::getMaxSeparatorSize ( int  n) const
inlineoverridevirtual

Provides the maximal separator size that this algorithm guarantees as a function of the number of nodes of the graph, or a negative value if the guarantee cannot be expressed through such a function.

See e.g. SeparatorHarPeled or SeparatorDualFC for examples.

Parameters
nthe number of nodes of the graph
Returns
the maximal separator size

Reimplemented from ogdf::SeparatorLiptonTarjan.

Definition at line 74 of file SeparatorDual.h.

◆ getSpecificName()

virtual std::string ogdf::SeparatorDual::getSpecificName ( ) const
inlineoverridevirtual

Returns the unique name of the core algorithm, to be combined with postprocessors later.

Override this in inheriting methods.

Returns
the specific name as a string

Reimplemented from ogdf::SeparatorLiptonTarjan.

Definition at line 62 of file SeparatorDual.h.

◆ makeTree()

virtual void ogdf::SeparatorDual::makeTree ( )
overrideprotectedvirtual

Creates the BFS tree used by the algorithm.

Reimplemented from ogdf::SeparatorLiptonTarjan.

Member Data Documentation

◆ treeHeightIterations

unsigned int ogdf::SeparatorDual::treeHeightIterations
protected

Definition at line 83 of file SeparatorDual.h.

◆ useTriBFS

bool ogdf::SeparatorDual::useTriBFS
protected

Definition at line 82 of file SeparatorDual.h.


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