The Davidson-Harel approach for drawing graphs. More...
#include <ogdf/energybased/DavidsonHarel.h>
Public Member Functions | |
DavidsonHarel () | |
Creates an instance of Davidsen-Harel base class. | |
~DavidsonHarel () | |
void | addEnergyFunction (EnergyFunction *F, double weight) |
Adds an energy function F with a certain weight. | |
void | call (GraphAttributes &GA) |
Calls the Davidson-Harel method for graph GA . | |
List< string > | returnEnergyFunctionNames () |
Returns a list of the names of the energy functions. | |
List< double > | returnEnergyFunctionWeights () |
Returns a list of the weights of the energy functions. | |
void | setNumberOfIterations (int steps) |
Sets the number of iterations for each temperature step to steps . | |
void | setStartTemperature (int startTemp) |
Sets the start temperature to startTemp . | |
Private Types | |
using | EnergyFunction = davidson_harel::EnergyFunction |
Private Member Functions | |
DavidsonHarel (const DavidsonHarel &) | |
Fake copy constructor (dummy to avoid copying) | |
node | computeCandidateLayout (const GraphAttributes &, DPoint &) const |
Randomly computes a node and a new position for that node. | |
void | computeFirstRadius (const GraphAttributes &AG) |
Computes the first disk radius as the half the diamter of the enclosing rectangle. | |
void | computeInitialEnergy () |
Computes the energy of the initial layout and stores it in m_energy. | |
void | initParameters () |
Resets the parameters for subsequent runs. | |
DavidsonHarel & | operator= (const DavidsonHarel &dh) |
Fake assignment operator (dummy to avoid copying) | |
void | placeIsolatedNodes (GraphAttributes &AG) const |
Computes positions for the vertices of degree zero. | |
double | randNum () const |
Computes a random number between zero and one. | |
bool | testEnergyValue (double newVal) |
Tests if new energy value satisfies annealing property (only better if m_fineTune). | |
Private Attributes | |
double | m_diskRadius |
The radius of the disk around the old position of a vertex where the new position will be. | |
double | m_energy |
The current energy of the system. | |
List< EnergyFunction * > | m_energyFunctions |
The list of the energy functions. | |
List< node > | m_nonIsolatedNodes |
The list of nodes with degree greater 0. | |
int | m_numberOfIterations |
The number of iterations per temperature step. | |
double | m_shrinkingFactor |
The factor for radius. | |
int | m_temperature |
The temperature during the annealing process. | |
List< double > | m_weightsOfEnergyFunctions |
The list of the weights for the energy functions. | |
Static Private Attributes | |
static const double | m_coolingFactor |
The fraction by which the temperature is lowered after a temperature step is finished. | |
static const double | m_defaultRadius |
The default starting radius. | |
static const int | m_defaultTemp |
The default starting temperature. | |
static const int | m_iterationMultiplier |
Per default, the number of iterations per temperature are set as a constant multiple of the number of vertices. | |
static const double | m_shrinkFactor |
the constant by which the radius of the circle around each vertex is shrunk when the temperature is lowered | |
The Davidson-Harel approach for drawing graphs.
Definition at line 40 of file DavidsonHarel.h.
Definition at line 41 of file DavidsonHarel.h.
ogdf::DavidsonHarel::DavidsonHarel | ( | ) |
Creates an instance of Davidsen-Harel base class.
|
inline |
Definition at line 47 of file DavidsonHarel.h.
|
inlineprivate |
Fake copy constructor (dummy to avoid copying)
Definition at line 115 of file DavidsonHarel.h.
void ogdf::DavidsonHarel::addEnergyFunction | ( | EnergyFunction * | F, |
double | weight | ||
) |
Adds an energy function F
with a certain weight.
void ogdf::DavidsonHarel::call | ( | GraphAttributes & | GA | ) |
Calls the Davidson-Harel method for graph GA
.
|
private |
Randomly computes a node and a new position for that node.
|
private |
Computes the first disk radius as the half the diamter of the enclosing rectangle.
|
private |
Computes the energy of the initial layout and stores it in m_energy.
|
private |
Resets the parameters for subsequent runs.
|
private |
Fake assignment operator (dummy to avoid copying)
|
private |
Computes positions for the vertices of degree zero.
|
private |
Computes a random number between zero and one.
List< string > ogdf::DavidsonHarel::returnEnergyFunctionNames | ( | ) |
Returns a list of the names of the energy functions.
Returns a list of the weights of the energy functions.
Sets the number of iterations for each temperature step to steps
.
Sets the start temperature to startTemp
.
Tests if new energy value satisfies annealing property (only better if m_fineTune).
The fraction by which the temperature is lowered after a temperature step is finished.
Definition at line 75 of file DavidsonHarel.h.
The default starting radius.
Definition at line 71 of file DavidsonHarel.h.
The default starting temperature.
Definition at line 69 of file DavidsonHarel.h.
|
private |
The radius of the disk around the old position of a vertex where the new position will be.
Definition at line 81 of file DavidsonHarel.h.
|
private |
The current energy of the system.
Definition at line 82 of file DavidsonHarel.h.
|
private |
The list of the energy functions.
Definition at line 85 of file DavidsonHarel.h.
Per default, the number of iterations per temperature are set as a constant multiple of the number of vertices.
Definition at line 73 of file DavidsonHarel.h.
The list of nodes with degree greater 0.
Definition at line 88 of file DavidsonHarel.h.
|
private |
The number of iterations per temperature step.
Definition at line 83 of file DavidsonHarel.h.
the constant by which the radius of the circle around each vertex is shrunk when the temperature is lowered
Definition at line 77 of file DavidsonHarel.h.
|
private |
The factor for radius.
Definition at line 80 of file DavidsonHarel.h.
|
private |
The temperature during the annealing process.
Definition at line 79 of file DavidsonHarel.h.
The list of the weights for the energy functions.
Definition at line 86 of file DavidsonHarel.h.