Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::SeparatorLiptonTarjanFC Class Reference

Computes planar separators using Fundamental Cycles. More...

#include <ogdf/graphalg/SeparatorLiptonTarjanFC.h>

+ Inheritance diagram for ogdf::SeparatorLiptonTarjanFC:

Public Member Functions

 SeparatorLiptonTarjanFC (bool useTriBFS=false)
 Constructor. More...
 
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. More...
 
- 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. More...
 
void clearPostProcessors ()
 Deletes all appended postprocessors from this separator. More...
 
std::string getExitPoint () const
 Returns the exitPoint, i.e. More...
 
virtual std::string getName () const
 Returns the full name of this algorithm. More...
 
virtual bool separate (const Graph &G, List< node > &separator, List< node > &first, List< node > &second, bool checkPreconditions=true) final
 Separates a planar graph. More...
 
virtual bool separate (const Graph &G, NodeArray< short > &assignments, bool checkPreconditions=true) final
 Separates a planar graph. More...
 
void setStartIndex (int index)
 

Protected Member Functions

edge chooseEdge () const
 Randomly selects the initial edge for the first cycle. More...
 
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. More...
 
virtual bool findCycle (List< node > &separator, List< node > &first, List< node > &second)
 Finds a cycle that works as a separator. More...
 
virtual std::string getSpecificName () const override
 Returns the unique name of the core algorithm, to be combined with postprocessors later. More...
 
- 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. More...
 
node getStartNode (const Graph &G) const
 Selects the starting node for the BFS. More...
 
bool postProcess (const Graph &G, List< node > &separator, List< node > &first, List< node > &second)
 Apply all postprocessors. More...
 
virtual void reset ()
 Reset everything to enable reuse of the module. More...
 
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. More...
 
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. More...
 

Protected Attributes

std::shared_ptr< ArrayBFSTreetree
 
bool useTriangulatingBFS
 
- 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 Fundamental Cycles.

Computes planar separators using only the Fundamental Cycle Lemma (ie. the second half of Lipton Tarjan).

Definition at line 94 of file SeparatorLiptonTarjanFC.h.

Constructor & Destructor Documentation

◆ SeparatorLiptonTarjanFC()

ogdf::SeparatorLiptonTarjanFC::SeparatorLiptonTarjanFC ( bool  useTriBFS = false)
inline

Constructor.

Parameters
useTriBFSwhether to use triangulating BFS or not

Definition at line 101 of file SeparatorLiptonTarjanFC.h.

Member Function Documentation

◆ chooseEdge()

edge ogdf::SeparatorLiptonTarjanFC::chooseEdge ( ) const
protected

Randomly selects the initial edge for the first cycle.

Returns
the first edge

◆ doSeparate()

virtual bool ogdf::SeparatorLiptonTarjanFC::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

Implements ogdf::PlanarSeparatorModule.

Reimplemented in ogdf::SeparatorDualFC.

◆ findCycle()

virtual bool ogdf::SeparatorLiptonTarjanFC::findCycle ( List< node > &  separator,
List< node > &  first,
List< node > &  second 
)
protectedvirtual

Finds a cycle that works as a separator.

Parameters
separatorthe separator nodes
firstthe first component
secondthe second component
Returns
true on success

Reimplemented in ogdf::SeparatorDualFC.

◆ getMaxSeparatorSize()

virtual double ogdf::SeparatorLiptonTarjanFC::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

Implements ogdf::PlanarSeparatorModule.

Reimplemented in ogdf::SeparatorDualFC.

Definition at line 103 of file SeparatorLiptonTarjanFC.h.

◆ getSpecificName()

virtual std::string ogdf::SeparatorLiptonTarjanFC::getSpecificName ( ) const
inlineoverrideprotectedvirtual

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

Implements ogdf::PlanarSeparatorModule.

Reimplemented in ogdf::SeparatorDualFC.

Definition at line 112 of file SeparatorLiptonTarjanFC.h.

Member Data Documentation

◆ tree

std::shared_ptr<ArrayBFSTree> ogdf::SeparatorLiptonTarjanFC::tree
protected

Definition at line 110 of file SeparatorLiptonTarjanFC.h.

◆ useTriangulatingBFS

bool ogdf::SeparatorLiptonTarjanFC::useTriangulatingBFS
protected

Definition at line 109 of file SeparatorLiptonTarjanFC.h.


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