The Davidson-Harel layout algorithm. More...
#include <ogdf/energybased/DavidsonHarelLayout.h>
Public Types | |
enum class | SettingsParameter { Standard , Repulse , Planar } |
Easy way to set fixed costs. More... | |
enum class | SpeedParameter { Fast , Medium , HQ } |
Easy way to set temperature and iterations. More... | |
Public Member Functions | |
DavidsonHarelLayout () | |
Creates an instance of Davidson-Harel layout. | |
~DavidsonHarelLayout () | |
virtual void | call (GraphAttributes &GA) override |
Calls the layout algorithm for graph attributes GA . | |
void | fixSettings (SettingsParameter sp) |
Fixes the cost values to special configurations. | |
double | getAttractionWeight () const |
Returns the weight for the energy function Attraction. | |
double | getNodeOverlapWeight () const |
Returns the weight for the energy function NodeOverlap. | |
int | getNumberOfIterations () const |
Returns the number of iterations per temperature step. | |
double | getPlanarityWeight () const |
Returns the weight for the energy function Planarity. | |
double | getRepulsionWeight () const |
Returns the weight for the energy function Repulsion. | |
int | getStartTemperature () const |
Returns the starting temperature. | |
void | setAttractionWeight (double) |
Sets the weight for the energy function Attraction. | |
void | setIterationNumberAsFactor (bool b) |
Switch between using iteration number as fixed number or factor (*number of nodes of graph) | |
void | setNodeOverlapWeight (double) |
Sets the weight for the energy function NodeOverlap. | |
void | setNumberOfIterations (int steps) |
Sets the number of iterations per temperature step to steps . | |
void | setPlanarityWeight (double) |
Sets the weight for the energy function Planarity. | |
void | setPreferredEdgeLength (double elen) |
Sets the preferred edge length to elen . | |
void | setPreferredEdgeLengthMultiplier (double multi) |
Sets the preferred edge length multiplier for attraction. | |
void | setRepulsionWeight (double w) |
Sets the weight for the energy function Repulsion. | |
void | setSpeed (SpeedParameter sp) |
More convenient way of setting the speed of the algorithm. | |
void | setStartTemperature (int t) |
Sets the starting temperature to t . | |
Public Member Functions inherited from ogdf::LayoutModule | |
LayoutModule () | |
Initializes a layout module. | |
virtual | ~LayoutModule () |
void | operator() (GraphAttributes &GA) |
Computes a layout of graph GA . | |
Private Attributes | |
double | m_attractionWeight |
The weight for attraction energy. | |
bool | m_crossings |
Should crossings be computed? | |
bool | m_itAsFactor |
Should m_numberOfIterations be factor (true) or fixed number. | |
double | m_multiplier |
By default, number of iterations per temperature step is number of vertices multiplied by multiplier. | |
double | m_nodeOverlapWeight |
The weight for node overlap energy. | |
int | m_numberOfIterations |
The number of iterations per temperature step. | |
double | m_planarityWeight |
The weight for edge crossing energy. | |
double | m_prefEdgeLength |
Preferred edge length (abs value), only used if > 0. | |
double | m_repulsionWeight |
The weight for repulsion energy. | |
SpeedParameter | m_speed |
You can override this by manually setting iter=0. | |
int | m_startTemperature |
The temperature at the start of the optimization. | |
The Davidson-Harel layout algorithm.
The implementation used in DavidsonHarelLayout is based on the following publication:
Ron Davidson, David Harel: Drawing Graphs Nicely Using Simulated Annealing. ACM Transactions on Graphics 15(4), pp. 301-331, 1996.
Definition at line 49 of file DavidsonHarelLayout.h.
Easy way to set fixed costs.
Enumerator | |
---|---|
Standard | |
Repulse | |
Planar |
Definition at line 52 of file DavidsonHarelLayout.h.
Easy way to set temperature and iterations.
Enumerator | |
---|---|
Fast | |
Medium | |
HQ |
Definition at line 55 of file DavidsonHarelLayout.h.
ogdf::DavidsonHarelLayout::DavidsonHarelLayout | ( | ) |
Creates an instance of Davidson-Harel layout.
|
inline |
Definition at line 60 of file DavidsonHarelLayout.h.
|
overridevirtual |
Calls the layout algorithm for graph attributes GA
.
Implements ogdf::LayoutModule.
void ogdf::DavidsonHarelLayout::fixSettings | ( | SettingsParameter | sp | ) |
Fixes the cost values to special configurations.
|
inline |
Returns the weight for the energy function Attraction.
Definition at line 95 of file DavidsonHarelLayout.h.
|
inline |
Returns the weight for the energy function NodeOverlap.
Definition at line 101 of file DavidsonHarelLayout.h.
|
inline |
Returns the number of iterations per temperature step.
Definition at line 119 of file DavidsonHarelLayout.h.
|
inline |
Returns the weight for the energy function Planarity.
Definition at line 107 of file DavidsonHarelLayout.h.
|
inline |
Returns the weight for the energy function Repulsion.
Definition at line 89 of file DavidsonHarelLayout.h.
|
inline |
Returns the starting temperature.
Definition at line 113 of file DavidsonHarelLayout.h.
Sets the weight for the energy function Attraction.
Switch between using iteration number as fixed number or factor (*number of nodes of graph)
Definition at line 123 of file DavidsonHarelLayout.h.
Sets the weight for the energy function NodeOverlap.
Sets the number of iterations per temperature step to steps
.
Sets the weight for the energy function Planarity.
Sets the preferred edge length to elen
.
Definition at line 83 of file DavidsonHarelLayout.h.
Sets the preferred edge length multiplier for attraction.
This is bad design, cause you dont need to have an attraction function, DH is purely modular and independent with its cost functions.
Definition at line 80 of file DavidsonHarelLayout.h.
Sets the weight for the energy function Repulsion.
void ogdf::DavidsonHarelLayout::setSpeed | ( | SpeedParameter | sp | ) |
More convenient way of setting the speed of the algorithm.
Influences number of iterations per temperature step, starting temperature, and cooling factor.
|
private |
The weight for attraction energy.
Definition at line 127 of file DavidsonHarelLayout.h.
|
private |
Should crossings be computed?
Definition at line 135 of file DavidsonHarelLayout.h.
|
private |
Should m_numberOfIterations be factor (true) or fixed number.
Definition at line 136 of file DavidsonHarelLayout.h.
|
private |
By default, number of iterations per temperature step is number of vertices multiplied by multiplier.
Definition at line 133 of file DavidsonHarelLayout.h.
|
private |
The weight for node overlap energy.
Definition at line 128 of file DavidsonHarelLayout.h.
|
private |
The number of iterations per temperature step.
Definition at line 131 of file DavidsonHarelLayout.h.
|
private |
The weight for edge crossing energy.
Definition at line 129 of file DavidsonHarelLayout.h.
|
private |
Preferred edge length (abs value), only used if > 0.
Definition at line 134 of file DavidsonHarelLayout.h.
|
private |
The weight for repulsion energy.
Definition at line 126 of file DavidsonHarelLayout.h.
|
private |
You can override this by manually setting iter=0.
Definition at line 132 of file DavidsonHarelLayout.h.
|
private |
The temperature at the start of the optimization.
Definition at line 130 of file DavidsonHarelLayout.h.