Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

DavidsonHarelLayout.h
Go to the documentation of this file.
1 
33 #pragma once
34 
36 #include <ogdf/basic/basic.h>
37 
38 namespace ogdf {
39 class GraphAttributes;
40 
42 
52 public:
54  enum class SettingsParameter { Standard, Repulse, Planar };
55 
57  enum class SpeedParameter { Fast, Medium, HQ };
58 
61 
63 
65  virtual void call(GraphAttributes& GA) override;
66 
68  void fixSettings(SettingsParameter sp);
69 
71 
75  void setSpeed(SpeedParameter sp);
76 
78 
82  void setPreferredEdgeLengthMultiplier(double multi) { m_multiplier = multi; }
83 
85  void setPreferredEdgeLength(double elen) { m_prefEdgeLength = elen; }
86 
88  void setRepulsionWeight(double w);
89 
91  double getRepulsionWeight() const { return m_repulsionWeight; }
92 
94  void setAttractionWeight(double);
95 
97  double getAttractionWeight() const { return m_attractionWeight; }
98 
100  void setNodeOverlapWeight(double);
101 
103  double getNodeOverlapWeight() const { return m_nodeOverlapWeight; }
104 
106  void setPlanarityWeight(double);
107 
109  double getPlanarityWeight() const { return m_planarityWeight; }
110 
112  void setStartTemperature(int t);
113 
115  int getStartTemperature() const { return m_startTemperature; }
116 
118  void setNumberOfIterations(int steps);
119 
121  int getNumberOfIterations() const { return m_numberOfIterations; }
122 
125  void setIterationNumberAsFactor(bool b) { m_itAsFactor = b; }
126 
127 private:
135  double m_multiplier;
137  bool m_crossings;
139 };
140 
141 }
ogdf
The namespace for all OGDF objects.
Definition: multilevelmixer.cpp:39
ogdf::GraphAttributes
Stores additional attributes of a graph (like layout information).
Definition: GraphAttributes.h:72
ogdf::DavidsonHarelLayout::getNodeOverlapWeight
double getNodeOverlapWeight() const
Returns the weight for the energy function NodeOverlap.
Definition: DavidsonHarelLayout.h:103
ogdf::DavidsonHarelLayout::getPlanarityWeight
double getPlanarityWeight() const
Returns the weight for the energy function Planarity.
Definition: DavidsonHarelLayout.h:109
ogdf::DavidsonHarelLayout::m_itAsFactor
bool m_itAsFactor
Should m_numberOfIterations be factor (true) or fixed number.
Definition: DavidsonHarelLayout.h:138
ogdf::DavidsonHarelLayout::setPreferredEdgeLength
void setPreferredEdgeLength(double elen)
Sets the preferred edge length to elen.
Definition: DavidsonHarelLayout.h:85
ogdf::DavidsonHarelLayout::m_repulsionWeight
double m_repulsionWeight
The weight for repulsion energy.
Definition: DavidsonHarelLayout.h:128
ogdf::DavidsonHarelLayout::m_planarityWeight
double m_planarityWeight
The weight for edge crossing energy.
Definition: DavidsonHarelLayout.h:131
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:133
ogdf::DavidsonHarelLayout::m_startTemperature
int m_startTemperature
The temperature at the start of the optimization.
Definition: DavidsonHarelLayout.h:132
ogdf::DavidsonHarelLayout::m_prefEdgeLength
double m_prefEdgeLength
Preferred edge length (abs value), only used if > 0.
Definition: DavidsonHarelLayout.h:136
ogdf::DavidsonHarelLayout::m_crossings
bool m_crossings
Should crossings be computed?
Definition: DavidsonHarelLayout.h:137
ogdf::DavidsonHarelLayout::SettingsParameter
SettingsParameter
Easy way to set fixed costs.
Definition: DavidsonHarelLayout.h:54
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:135
ogdf::DavidsonHarelLayout::m_nodeOverlapWeight
double m_nodeOverlapWeight
The weight for node overlap energy.
Definition: DavidsonHarelLayout.h:130
ogdf::DavidsonHarelLayout::getAttractionWeight
double getAttractionWeight() const
Returns the weight for the energy function Attraction.
Definition: DavidsonHarelLayout.h:97
ogdf::DavidsonHarelLayout::setPreferredEdgeLengthMultiplier
void setPreferredEdgeLengthMultiplier(double multi)
Sets the preferred edge length multiplier for attraction.
Definition: DavidsonHarelLayout.h:82
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:125
ogdf::DavidsonHarelLayout::m_speed
SpeedParameter m_speed
You can override this by manually setting iter=0.
Definition: DavidsonHarelLayout.h:134
ogdf::DavidsonHarelLayout::SpeedParameter
SpeedParameter
Easy way to set temperature and iterations.
Definition: DavidsonHarelLayout.h:57
ogdf::DavidsonHarelLayout::~DavidsonHarelLayout
~DavidsonHarelLayout()
Definition: DavidsonHarelLayout.h:62
ogdf::DavidsonHarelLayout::getRepulsionWeight
double getRepulsionWeight() const
Returns the weight for the energy function Repulsion.
Definition: DavidsonHarelLayout.h:91
ogdf::DavidsonHarelLayout::getNumberOfIterations
int getNumberOfIterations() const
Returns the number of iterations per temperature step.
Definition: DavidsonHarelLayout.h:121
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::DavidsonHarelLayout::m_attractionWeight
double m_attractionWeight
The weight for attraction energy.
Definition: DavidsonHarelLayout.h:129
ogdf::DavidsonHarelLayout::getStartTemperature
int getStartTemperature() const
Returns the starting temperature.
Definition: DavidsonHarelLayout.h:115
ogdf::DavidsonHarelLayout
The Davidson-Harel layout algorithm.
Definition: DavidsonHarelLayout.h:51
ogdf::LayoutModule
Interface of general layout algorithms.
Definition: LayoutModule.h:45