Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
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
41namespace ogdf {
42template<class E>
43class List;
44
46
53public:
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
77protected:
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}
Includes declaration of graph class.
Declaration of class SeparatorLiptonTarjan.
Basic declarations, included by all source files.
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
Computes planar separators using the Dual of the graph.
virtual double getMaxSeparatorSize(int n) const override
Provides the maximal separator size that this algorithm guarantees as a function of the number of nod...
SeparatorDual(bool useTriangulatingBFS=false, unsigned int treeHeightIt=0)
Constructor.
virtual void makeTree() override
Creates the BFS tree used by the algorithm.
unsigned int treeHeightIterations
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 std::string getSpecificName() const override
Returns the unique name of the core algorithm, to be combined with postprocessors later.
Computes planar separators according to Lipton and Tarjan 1979.
#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.