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 | setStartTemperature (int startTemp) |
| Sets the start temperature to startTemp. | |
| void | setNumberOfIterations (int steps) |
| Sets the number of iterations for each temperature step to steps. | |
| void | addEnergyFunction (EnergyFunction *F, double weight) |
| Adds an energy function F with a certain weight. | |
| 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 | call (GraphAttributes &GA) |
| Calls the Davidson-Harel method for graph GA. | |
Private Member Functions | |
| void | initParameters () |
| Resets the parameters for subsequent runs. | |
| node | computeCandidateLayout (const GraphAttributes &, DPoint &) const |
| Randomly computes a node and a new position for that node. | |
| bool | testEnergyValue (double newVal) |
| Tests if new energy value satisfies annealing property (only better if m_fineTune). | |
| double | randNum () const |
| Computes a random number between zero and one. | |
| 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 | placeIsolatedNodes (GraphAttributes &AG) const |
| Computes positions for the vertices of degree zero. | |
| DavidsonHarel & | operator= (const DavidsonHarel &dh) |
| Fake assignment operator (dummy to avoid copying). | |
| DavidsonHarel (const DavidsonHarel &) | |
| Fake copy constructor (dummy to avoid copying). | |
Private Attributes | |
| int | m_temperature |
| The temperature during the annealing process. | |
| double | m_shrinkingFactor |
| The factor for radius. | |
| 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. | |
| int | m_numberOfIterations |
| The number of iterations per temperature step. | |
| List< EnergyFunction * > | m_energyFunctions |
| The list of the energy functions. | |
| List< double > | m_weightsOfEnergyFunctions |
| The list of the weights for the energy functions. | |
| List< node > | m_nonIsolatedNodes |
| The list of nodes with degree greater 0. | |
Static Private Attributes | |
| static const int | m_defaultTemp |
| The default starting temperature. | |
| static const double | m_PI |
| the constant PI | |
| static const double | m_defaultRadius |
| The default starting radius. | |
| 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_coolingFactor |
| The fraction by which the temperature is lowered after a temperature step is finished. | |
| 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 66 of file DavidsonHarel.h.
| ogdf::DavidsonHarel::DavidsonHarel | ( | ) |
Creates an instance of Davidsen-Harel base class.
| ogdf::DavidsonHarel::~DavidsonHarel | ( | ) | [inline] |
Definition at line 68 of file DavidsonHarel.h.
| ogdf::DavidsonHarel::DavidsonHarel | ( | const DavidsonHarel & | ) | [inline, private] |
Fake copy constructor (dummy to avoid copying).
Definition at line 137 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.
| node ogdf::DavidsonHarel::computeCandidateLayout | ( | const GraphAttributes & | , | |
| DPoint & | ||||
| ) | const [private] |
Randomly computes a node and a new position for that node.
| void ogdf::DavidsonHarel::computeFirstRadius | ( | const GraphAttributes & | AG | ) | [private] |
Computes the first disk radius as the half the diamter of the enclosing rectangle.
| void ogdf::DavidsonHarel::computeInitialEnergy | ( | ) | [private] |
Computes the energy of the initial layout and stores it in m_energy.
| void ogdf::DavidsonHarel::initParameters | ( | ) | [private] |
Resets the parameters for subsequent runs.
| DavidsonHarel& ogdf::DavidsonHarel::operator= | ( | const DavidsonHarel & | dh | ) | [private] |
Fake assignment operator (dummy to avoid copying).
| void ogdf::DavidsonHarel::placeIsolatedNodes | ( | GraphAttributes & | AG | ) | const [private] |
Computes positions for the vertices of degree zero.
| double ogdf::DavidsonHarel::randNum | ( | ) | const [private] |
Computes a random number between zero and one.
Returns a list of the names of the energy functions.
| List<double> ogdf::DavidsonHarel::returnEnergyFunctionWeights | ( | ) |
Returns a list of the weights of the energy functions.
| void ogdf::DavidsonHarel::setNumberOfIterations | ( | int | steps | ) |
Sets the number of iterations for each temperature step to steps.
| void ogdf::DavidsonHarel::setStartTemperature | ( | int | startTemp | ) |
Sets the start temperature to startTemp.
| bool ogdf::DavidsonHarel::testEnergyValue | ( | double | newVal | ) | [private] |
Tests if new energy value satisfies annealing property (only better if m_fineTune).
const double ogdf::DavidsonHarel::m_coolingFactor [static, private] |
The fraction by which the temperature is lowered after a temperature step is finished.
Definition at line 98 of file DavidsonHarel.h.
const double ogdf::DavidsonHarel::m_defaultRadius [static, private] |
The default starting radius.
Definition at line 94 of file DavidsonHarel.h.
const int ogdf::DavidsonHarel::m_defaultTemp [static, private] |
The default starting temperature.
Definition at line 90 of file DavidsonHarel.h.
double ogdf::DavidsonHarel::m_diskRadius [private] |
The radius of the disk around the old position of a vertex where the new position will be.
Definition at line 104 of file DavidsonHarel.h.
double ogdf::DavidsonHarel::m_energy [private] |
The current energy of the system.
Definition at line 105 of file DavidsonHarel.h.
List<EnergyFunction*> ogdf::DavidsonHarel::m_energyFunctions [private] |
The list of the energy functions.
Definition at line 108 of file DavidsonHarel.h.
const int ogdf::DavidsonHarel::m_iterationMultiplier [static, private] |
Per default, the number of iterations per temperature are set as a constant multiple of the number of vertices.
Definition at line 96 of file DavidsonHarel.h.
List<node> ogdf::DavidsonHarel::m_nonIsolatedNodes [private] |
The list of nodes with degree greater 0.
Definition at line 111 of file DavidsonHarel.h.
int ogdf::DavidsonHarel::m_numberOfIterations [private] |
The number of iterations per temperature step.
Definition at line 106 of file DavidsonHarel.h.
const double ogdf::DavidsonHarel::m_PI [static, private] |
the constant PI
Definition at line 92 of file DavidsonHarel.h.
const double ogdf::DavidsonHarel::m_shrinkFactor [static, private] |
the constant by which the radius of the circle around each vertex is shrunk when the temperature is lowered
Definition at line 100 of file DavidsonHarel.h.
double ogdf::DavidsonHarel::m_shrinkingFactor [private] |
The factor for radius.
Definition at line 103 of file DavidsonHarel.h.
int ogdf::DavidsonHarel::m_temperature [private] |
The temperature during the annealing process.
Definition at line 102 of file DavidsonHarel.h.
List<double> ogdf::DavidsonHarel::m_weightsOfEnergyFunctions [private] |
The list of the weights for the energy functions.
Definition at line 109 of file DavidsonHarel.h.