Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

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 
42 namespace ogdf {
43 template<class E>
44 class List;
45 
47 
55  friend class Cycle;
56 
57 public:
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 
70 protected:
71  bool useTriBFS;
72  unsigned int treeHeightIterations;
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 
110  edge chooseEdge() const;
111 };
112 
113 
114 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::SeparatorLiptonTarjan::useTriBFS
bool useTriBFS
Definition: SeparatorLiptonTarjan.h:71
ogdf::SeparatorLiptonTarjan
Computes planar separators according to Lipton and Tarjan 1979.
Definition: SeparatorLiptonTarjan.h:54
ogdf::matching_blossom::Cycle
Definition: Cycle.h:44
ogdf::PlanarSeparatorModule
Abstract description of all planar separator algorithms.
Definition: PlanarSeparatorModule.h:925
ogdf::SeparatorLiptonTarjan::getMaxSeparatorSize
virtual double getMaxSeparatorSize(int n) const override
Provides the maximal separator size that this algorithm guarantees as a function of the number of nod...
Definition: SeparatorLiptonTarjan.h:67
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
ogdf::SeparatorLiptonTarjan::treeHeightIterations
unsigned int treeHeightIterations
Definition: SeparatorLiptonTarjan.h:72
basic.h
Basic declarations, included by all source files.
ogdf::SeparatorLiptonTarjan::tree
std::shared_ptr< BFSTreeClassical > tree
Definition: SeparatorLiptonTarjan.h:77
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::EdgeElement
Class for the representation of edges.
Definition: Graph_d.h:363
ogdf::SeparatorLiptonTarjan::SeparatorLiptonTarjan
SeparatorLiptonTarjan(bool useTriangulatingBFS=false, unsigned int treeHeightIt=0)
Constructor.
Definition: SeparatorLiptonTarjan.h:64
ogdf::sync_plan::internal::to_string
std::string to_string(const std::function< std::ostream &(std::ostream &)> &func)
ogdf::SeparatorLiptonTarjan::getSpecificName
virtual std::string getSpecificName() const override
Returns the unique name of the core algorithm, to be combined with postprocessors later.
Definition: SeparatorLiptonTarjan.h:79
PlanarSeparatorModule.h
Declaration of base class of all planar separator algorithms.