Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches
SubgraphPlanarizer.h
Go to the documentation of this file.
1
32#pragma once
33
34#include <ogdf/basic/Logger.h>
38
39#include <memory>
40#include <random>
41
42namespace ogdf {
43
45
107 class ThreadMaster;
108 class Worker;
109
110protected:
114 int& crossingNumber) override;
115
116public:
119
122
124 virtual CrossingMinimizationModule* clone() const override;
125
128
131
134
136 int permutations() { return m_permutations; }
137
139 void permutations(int p) { m_permutations = p; }
140
142 bool setTimeout() { return m_setTimeout; }
143
145 void setTimeout(bool b) { m_setTimeout = b; }
146
148 unsigned int maxThreads() const { return m_maxThreads; }
149
151 void maxThreads(unsigned int n) {
152#ifndef OGDF_MEMORY_POOL_NTS
153 m_maxThreads = n;
154#endif
155 }
156
157private:
158 static void doWorkHelper(ThreadMaster& master, EdgeInsertionModule& inserter,
159 std::minstd_rand& rng);
160
164 int& crossingNumber);
165
166 std::unique_ptr<PlanarSubgraphModule<int>> m_subgraph;
167 std::unique_ptr<EdgeInsertionModule> m_inserter;
168
171 unsigned int m_maxThreads;
172};
173
174}
Declaration of CrossingMinimization Module, an interface for crossing minimization algorithms.
Declaration of interface for edge insertion algorithms.
Contains logging functionality.
Declaration of interface for planar subgraph algorithms.
The parameterized class Array implements dynamic arrays of type E.
Definition Array.h:214
Base class for crossing minimization algorithms.
Dynamic arrays indexed with edges.
Definition EdgeArray.h:125
Interface for edge insertion algorithms.
Centralized global and local logging facility working on streams like std::cout.
Definition Logger.h:100
ReturnType
The return type of a module.
Definition Module.h:50
Planarized representations (of a connected component) of a graph.
Definition PlanRep.h:57
Light-weight version of a planarized representation, associated with a PlanRep.
Interface for planar subgraph algorithms.
The planarization approach for crossing minimization.
SubgraphPlanarizer & operator=(const SubgraphPlanarizer &planarizer)
Assignment operator. Copies option settings only.
std::unique_ptr< EdgeInsertionModule > m_inserter
The edge insertion module.
bool m_setTimeout
The option for setting timeouts in submodules.
int permutations()
Returns the number of permutations.
int m_permutations
The number of permutations.
void setInserter(EdgeInsertionModule *pInserter)
Sets the module option for the edge insertion module.
bool setTimeout()
Returns the current setting of options setTimeout.
void setTimeout(bool b)
Sets the option setTimeout to b.
static void doWorkHelper(ThreadMaster &master, EdgeInsertionModule &inserter, std::minstd_rand &rng)
virtual ReturnType doCall(PlanRep &pr, int cc, const EdgeArray< int > *pCostOrig, const EdgeArray< bool > *pForbiddenOrig, const EdgeArray< uint32_t > *pEdgeSubGraphs, int &crossingNumber) override
Implements the algorithm call.
void setSubgraph(PlanarSubgraphModule< int > *pSubgraph)
Sets the module option for the computation of the planar subgraph.
SubgraphPlanarizer()
Creates an instance of subgraph planarizer with default settings.
static bool doSinglePermutation(PlanRepLight &prl, int cc, const EdgeArray< int > *pCost, const EdgeArray< bool > *pForbid, const EdgeArray< uint32_t > *pEdgeSubGraphs, Array< edge > &deletedEdges, EdgeInsertionModule &inserter, std::minstd_rand &rng, int &crossingNumber)
SubgraphPlanarizer(const SubgraphPlanarizer &planarizer)
Creates an instance of subgraph planarizer with the same settings as planarizer.
unsigned int m_maxThreads
The maximal number of used threads.
virtual CrossingMinimizationModule * clone() const override
Returns a new instance of subgraph planarizer with the same option settings.
unsigned int maxThreads() const
Returns the maximal number of used threads.
std::unique_ptr< PlanarSubgraphModule< int > > m_subgraph
The planar subgraph algorithm.
void maxThreads(unsigned int n)
Sets the maximal number of used threads to n.
void permutations(int p)
Sets the number of permutations to p.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition config.h:101
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.