Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
SeparatorLiptonTarjan.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Graph.h>
35#include <ogdf/basic/basic.h>
37
38#include <cmath>
39#include <memory>
40#include <string>
41
42namespace ogdf {
43template<class E>
44class List;
45
47
55 friend class Cycle;
56
57public:
64 SeparatorLiptonTarjan(bool useTriangulatingBFS = false, unsigned int treeHeightIt = 0)
65 : useTriBFS {useTriangulatingBFS}, treeHeightIterations(treeHeightIt + 1) { }
66
67 virtual double getMaxSeparatorSize(int n) const override { return sqrt(8) * sqrt(n); }
68
69
70protected:
73
74 virtual bool doSeparate(const Graph& G, List<node>& separator, List<node>& first,
75 List<node>& second) override;
76
77 std::shared_ptr<BFSTreeClassical> tree;
78
79 virtual std::string getSpecificName() const override {
80 std::string name = "LT";
81 if (useTriBFS) {
82 name += "-triBFS";
83 }
84 if (treeHeightIterations > 1) {
85 name += "-THM-" + std::to_string(treeHeightIterations - 1);
86 }
87
88 return name;
89 }
90
94 virtual void makeTree();
95
103 void fillLists(List<node>& separator, List<node>& first, List<node>& second) const;
104
111};
112
113
114}
Includes declaration of graph class.
Declaration of base class of all planar separator algorithms.
Basic declarations, included by all source files.
Class for the representation of edges.
Definition Graph_d.h:364
Data type for general directed graphs (adjacency list representation).
Definition Graph_d.h:866
Doubly linked lists (maintaining the length of the list).
Definition List.h:1451
Abstract description of all planar separator algorithms.
Computes planar separators according to Lipton and Tarjan 1979.
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.
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.
std::shared_ptr< BFSTreeClassical > tree
virtual std::string getSpecificName() const override
Returns the unique name of the core algorithm, to be combined with postprocessors later.
virtual void makeTree()
Creates the BFS tree used by the algorithm.
SeparatorLiptonTarjan(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 nod...
edge chooseEdge() const
Chooses the initial edge for the very first cycle.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF dynamic library (shared object / DLL),...
Definition config.h:117
The namespace for all OGDF objects.