Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

DavidsonHarelLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 
37 namespace ogdf {
38 
40 
50 public:
52  enum class SettingsParameter { Standard, Repulse, Planar };
53 
55  enum class SpeedParameter { Fast, Medium, HQ };
56 
59 
61 
63  virtual void call(GraphAttributes& GA) override;
64 
66  void fixSettings(SettingsParameter sp);
67 
69 
73  void setSpeed(SpeedParameter sp);
74 
76 
80  void setPreferredEdgeLengthMultiplier(double multi) { m_multiplier = multi; }
81 
83  void setPreferredEdgeLength(double elen) { m_prefEdgeLength = elen; }
84 
86  void setRepulsionWeight(double w);
87 
89  double getRepulsionWeight() const { return m_repulsionWeight; }
90 
92  void setAttractionWeight(double);
93 
95  double getAttractionWeight() const { return m_attractionWeight; }
96 
98  void setNodeOverlapWeight(double);
99 
101  double getNodeOverlapWeight() const { return m_nodeOverlapWeight; }
102 
104  void setPlanarityWeight(double);
105 
107  double getPlanarityWeight() const { return m_planarityWeight; }
108 
110  void setStartTemperature(int t);
111 
113  int getStartTemperature() const { return m_startTemperature; }
114 
116  void setNumberOfIterations(int steps);
117 
119  int getNumberOfIterations() const { return m_numberOfIterations; }
120 
123  void setIterationNumberAsFactor(bool b) { m_itAsFactor = b; }
124 
125 private:
133  double m_multiplier;
135  bool m_crossings;
137 };
138 
139 }
ogdf
The namespace for all OGDF objects.
Definition: AugmentationModule.h:36
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:66
ogdf::DavidsonHarelLayout::getNodeOverlapWeight
double getNodeOverlapWeight() const
Returns the weight for the energy function NodeOverlap.
Definition: DavidsonHarelLayout.h:101
ogdf::DavidsonHarelLayout::getPlanarityWeight
double getPlanarityWeight() const
Returns the weight for the energy function Planarity.
Definition: DavidsonHarelLayout.h:107
ogdf::DavidsonHarelLayout::m_itAsFactor
bool m_itAsFactor
Should m_numberOfIterations be factor (true) or fixed number.
Definition: DavidsonHarelLayout.h:136
ogdf::DavidsonHarelLayout::setPreferredEdgeLength
void setPreferredEdgeLength(double elen)
Sets the preferred edge length to elen.
Definition: DavidsonHarelLayout.h:83
ogdf::DavidsonHarelLayout::m_repulsionWeight
double m_repulsionWeight
The weight for repulsion energy.
Definition: DavidsonHarelLayout.h:126
ogdf::DavidsonHarelLayout::m_planarityWeight
double m_planarityWeight
The weight for edge crossing energy.
Definition: DavidsonHarelLayout.h:129
LayoutModule.h
Declaration of interface for layout algorithms (class LayoutModule)
ogdf::DavidsonHarelLayout::m_numberOfIterations
int m_numberOfIterations
The number of iterations per temperature step.
Definition: DavidsonHarelLayout.h:131
ogdf::DavidsonHarelLayout::m_startTemperature
int m_startTemperature
The temperature at the start of the optimization.
Definition: DavidsonHarelLayout.h:130
ogdf::DavidsonHarelLayout::m_prefEdgeLength
double m_prefEdgeLength
Preferred edge length (abs value), only used if > 0.
Definition: DavidsonHarelLayout.h:134
ogdf::DavidsonHarelLayout::m_crossings
bool m_crossings
Should crossings be computed?
Definition: DavidsonHarelLayout.h:135
ogdf::DavidsonHarelLayout::SettingsParameter
SettingsParameter
Easy way to set fixed costs.
Definition: DavidsonHarelLayout.h:52
ogdf::DavidsonHarelLayout::m_multiplier
double m_multiplier
By default, number of iterations per temperature step is number of vertices multiplied by multiplier.
Definition: DavidsonHarelLayout.h:133
ogdf::DavidsonHarelLayout::m_nodeOverlapWeight
double m_nodeOverlapWeight
The weight for node overlap energy.
Definition: DavidsonHarelLayout.h:128
ogdf::DavidsonHarelLayout::getAttractionWeight
double getAttractionWeight() const
Returns the weight for the energy function Attraction.
Definition: DavidsonHarelLayout.h:95
ogdf::DavidsonHarelLayout::setPreferredEdgeLengthMultiplier
void setPreferredEdgeLengthMultiplier(double multi)
Sets the preferred edge length multiplier for attraction.
Definition: DavidsonHarelLayout.h:80
ogdf::DavidsonHarelLayout::setIterationNumberAsFactor
void setIterationNumberAsFactor(bool b)
Switch between using iteration number as fixed number or factor (*number of nodes of graph)
Definition: DavidsonHarelLayout.h:123
ogdf::DavidsonHarelLayout::m_speed
SpeedParameter m_speed
You can override this by manually setting iter=0.
Definition: DavidsonHarelLayout.h:132
ogdf::DavidsonHarelLayout::SpeedParameter
SpeedParameter
Easy way to set temperature and iterations.
Definition: DavidsonHarelLayout.h:55
ogdf::DavidsonHarelLayout::~DavidsonHarelLayout
~DavidsonHarelLayout()
Definition: DavidsonHarelLayout.h:60
ogdf::DavidsonHarelLayout::getRepulsionWeight
double getRepulsionWeight() const
Returns the weight for the energy function Repulsion.
Definition: DavidsonHarelLayout.h:89
ogdf::DavidsonHarelLayout::getNumberOfIterations
int getNumberOfIterations() const
Returns the number of iterations per temperature step.
Definition: DavidsonHarelLayout.h:119
OGDF_EXPORT
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
Definition: config.h:101
ogdf::DavidsonHarelLayout::m_attractionWeight
double m_attractionWeight
The weight for attraction energy.
Definition: DavidsonHarelLayout.h:127
ogdf::DavidsonHarelLayout::getStartTemperature
int getStartTemperature() const
Returns the starting temperature.
Definition: DavidsonHarelLayout.h:113
ogdf::DavidsonHarelLayout
The Davidson-Harel layout algorithm.
Definition: DavidsonHarelLayout.h:49
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:44