Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

SeparatorDual.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 <string>
40 
41 namespace ogdf {
42 template<class E>
43 class List;
44 
46 
53 public:
60  SeparatorDual(bool useTriangulatingBFS = false, unsigned int treeHeightIt = 0)
61  : useTriBFS {useTriangulatingBFS}, treeHeightIterations(treeHeightIt + 1) { }
62 
63  virtual std::string getSpecificName() const override {
64  std::string name = "Dual";
65  if (useTriBFS) {
66  name += "-triBFS";
67  }
68  if (treeHeightIterations > 1) {
69  name += "-THM-" + std::to_string(treeHeightIterations - 1);
70  }
71 
72  return name;
73  }
74 
75  virtual double getMaxSeparatorSize(int n) const override { return 4 * sqrt(n); }
76 
77 protected:
78  virtual void makeTree() override;
79 
80  virtual bool doSeparate(const Graph& G, List<node>& separator, List<node>& first,
81  List<node>& second) override;
82 
83  bool useTriBFS; // whether to use triangulating BFS for the second phase or not
84  unsigned int treeHeightIterations; // how many iterations of tree height maximisation to run
85 };
86 
87 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
Graph.h
Includes declaration of graph class.
ogdf::SeparatorLiptonTarjan
Computes planar separators according to Lipton and Tarjan 1979.
Definition: SeparatorLiptonTarjan.h:54
ogdf::SeparatorDual::getSpecificName
virtual std::string getSpecificName() const override
Returns the unique name of the core algorithm, to be combined with postprocessors later.
Definition: SeparatorDual.h:63
ogdf::SeparatorDual::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: SeparatorDual.h:75
ogdf::List
Doubly linked lists (maintaining the length of the list).
Definition: DfsMakeBiconnected.h:40
ogdf::SeparatorDual
Computes planar separators using the Dual of the graph.
Definition: SeparatorDual.h:52
ogdf::Graph
Data type for general directed graphs (adjacency list representation).
Definition: Graph_d.h:869
SeparatorLiptonTarjan.h
Declaration of class SeparatorLiptonTarjan.
ogdf::SeparatorDual::useTriBFS
bool useTriBFS
Definition: SeparatorDual.h:83
basic.h
Basic declarations, included by all source files.
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::SeparatorDual::treeHeightIterations
unsigned int treeHeightIterations
Definition: SeparatorDual.h:84
ogdf::SeparatorDual::SeparatorDual
SeparatorDual(bool useTriangulatingBFS=false, unsigned int treeHeightIt=0)
Constructor.
Definition: SeparatorDual.h:60
ogdf::sync_plan::internal::to_string
std::string to_string(const std::function< std::ostream &(std::ostream &)> &func)