Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::DavidsonHarel Class Reference

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. More...
 
 ~DavidsonHarel ()
 
void addEnergyFunction (EnergyFunction *F, double weight)
 Adds an energy function F with a certain weight. More...
 
void call (GraphAttributes &GA)
 Calls the Davidson-Harel method for graph GA. More...
 
List< string > returnEnergyFunctionNames ()
 Returns a list of the names of the energy functions. More...
 
List< double > returnEnergyFunctionWeights ()
 Returns a list of the weights of the energy functions. More...
 
void setNumberOfIterations (int steps)
 Sets the number of iterations for each temperature step to steps. More...
 
void setStartTemperature (int startTemp)
 Sets the start temperature to startTemp. More...
 

Private Types

using EnergyFunction = davidson_harel::EnergyFunction
 

Private Member Functions

 DavidsonHarel (const DavidsonHarel &)
 Fake copy constructor (dummy to avoid copying) More...
 
node computeCandidateLayout (const GraphAttributes &, DPoint &) const
 Randomly computes a node and a new position for that node. More...
 
void computeFirstRadius (const GraphAttributes &AG)
 Computes the first disk radius as the half the diamter of the enclosing rectangle. More...
 
void computeInitialEnergy ()
 Computes the energy of the initial layout and stores it in m_energy. More...
 
void initParameters ()
 Resets the parameters for subsequent runs. More...
 
DavidsonHareloperator= (const DavidsonHarel &dh)
 Fake assignment operator (dummy to avoid copying) More...
 
void placeIsolatedNodes (GraphAttributes &AG) const
 Computes positions for the vertices of degree zero. More...
 
double randNum () const
 Computes a random number between zero and one. More...
 
bool testEnergyValue (double newVal)
 Tests if new energy value satisfies annealing property (only better if m_fineTune). More...
 

Private Attributes

double m_diskRadius
 The radius of the disk around the old position of a vertex where the new position will be. More...
 
double m_energy
 The current energy of the system. More...
 
List< EnergyFunction * > m_energyFunctions
 The list of the energy functions. More...
 
List< nodem_nonIsolatedNodes
 The list of nodes with degree greater 0. More...
 
int m_numberOfIterations
 The number of iterations per temperature step. More...
 
double m_shrinkingFactor
 The factor for radius. More...
 
int m_temperature
 The temperature during the annealing process. More...
 
List< double > m_weightsOfEnergyFunctions
 The list of the weights for the energy functions. More...
 

Static Private Attributes

const static double m_coolingFactor
 The fraction by which the temperature is lowered after a temperature step is finished. More...
 
const static double m_defaultRadius
 The default starting radius. More...
 
const static int m_defaultTemp
 The default starting temperature. More...
 
const static int m_iterationMultiplier
 Per default, the number of iterations per temperature are set as a constant multiple of the number of vertices. More...
 
const static double m_shrinkFactor
 the constant by which the radius of the circle around each vertex is shrunk when the temperature is lowered More...
 

Detailed Description

The Davidson-Harel approach for drawing graphs.

Definition at line 40 of file DavidsonHarel.h.

Member Typedef Documentation

◆ EnergyFunction

Constructor & Destructor Documentation

◆ DavidsonHarel() [1/2]

ogdf::DavidsonHarel::DavidsonHarel ( )

Creates an instance of Davidsen-Harel base class.

◆ ~DavidsonHarel()

ogdf::DavidsonHarel::~DavidsonHarel ( )
inline

Definition at line 47 of file DavidsonHarel.h.

◆ DavidsonHarel() [2/2]

ogdf::DavidsonHarel::DavidsonHarel ( const DavidsonHarel )
inlineprivate

Fake copy constructor (dummy to avoid copying)

Definition at line 115 of file DavidsonHarel.h.

Member Function Documentation

◆ addEnergyFunction()

void ogdf::DavidsonHarel::addEnergyFunction ( EnergyFunction F,
double  weight 
)

Adds an energy function F with a certain weight.

◆ call()

void ogdf::DavidsonHarel::call ( GraphAttributes GA)

Calls the Davidson-Harel method for graph GA.

◆ computeCandidateLayout()

node ogdf::DavidsonHarel::computeCandidateLayout ( const GraphAttributes ,
DPoint  
) const
private

Randomly computes a node and a new position for that node.

◆ computeFirstRadius()

void ogdf::DavidsonHarel::computeFirstRadius ( const GraphAttributes AG)
private

Computes the first disk radius as the half the diamter of the enclosing rectangle.

◆ computeInitialEnergy()

void ogdf::DavidsonHarel::computeInitialEnergy ( )
private

Computes the energy of the initial layout and stores it in m_energy.

◆ initParameters()

void ogdf::DavidsonHarel::initParameters ( )
private

Resets the parameters for subsequent runs.

◆ operator=()

DavidsonHarel& ogdf::DavidsonHarel::operator= ( const DavidsonHarel dh)
private

Fake assignment operator (dummy to avoid copying)

◆ placeIsolatedNodes()

void ogdf::DavidsonHarel::placeIsolatedNodes ( GraphAttributes AG) const
private

Computes positions for the vertices of degree zero.

◆ randNum()

double ogdf::DavidsonHarel::randNum ( ) const
private

Computes a random number between zero and one.

◆ returnEnergyFunctionNames()

List<string> ogdf::DavidsonHarel::returnEnergyFunctionNames ( )

Returns a list of the names of the energy functions.

◆ returnEnergyFunctionWeights()

List<double> ogdf::DavidsonHarel::returnEnergyFunctionWeights ( )

Returns a list of the weights of the energy functions.

◆ setNumberOfIterations()

void ogdf::DavidsonHarel::setNumberOfIterations ( int  steps)

Sets the number of iterations for each temperature step to steps.

◆ setStartTemperature()

void ogdf::DavidsonHarel::setStartTemperature ( int  startTemp)

Sets the start temperature to startTemp.

◆ testEnergyValue()

bool ogdf::DavidsonHarel::testEnergyValue ( double  newVal)
private

Tests if new energy value satisfies annealing property (only better if m_fineTune).

Member Data Documentation

◆ m_coolingFactor

const static double ogdf::DavidsonHarel::m_coolingFactor
staticprivate

The fraction by which the temperature is lowered after a temperature step is finished.

Definition at line 75 of file DavidsonHarel.h.

◆ m_defaultRadius

const static double ogdf::DavidsonHarel::m_defaultRadius
staticprivate

The default starting radius.

Definition at line 71 of file DavidsonHarel.h.

◆ m_defaultTemp

const static int ogdf::DavidsonHarel::m_defaultTemp
staticprivate

The default starting temperature.

Definition at line 69 of file DavidsonHarel.h.

◆ m_diskRadius

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 81 of file DavidsonHarel.h.

◆ m_energy

double ogdf::DavidsonHarel::m_energy
private

The current energy of the system.

Definition at line 82 of file DavidsonHarel.h.

◆ m_energyFunctions

List<EnergyFunction*> ogdf::DavidsonHarel::m_energyFunctions
private

The list of the energy functions.

Definition at line 85 of file DavidsonHarel.h.

◆ m_iterationMultiplier

const static int ogdf::DavidsonHarel::m_iterationMultiplier
staticprivate

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.

◆ m_nonIsolatedNodes

List<node> ogdf::DavidsonHarel::m_nonIsolatedNodes
private

The list of nodes with degree greater 0.

Definition at line 88 of file DavidsonHarel.h.

◆ m_numberOfIterations

int ogdf::DavidsonHarel::m_numberOfIterations
private

The number of iterations per temperature step.

Definition at line 83 of file DavidsonHarel.h.

◆ m_shrinkFactor

const static double ogdf::DavidsonHarel::m_shrinkFactor
staticprivate

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.

◆ m_shrinkingFactor

double ogdf::DavidsonHarel::m_shrinkingFactor
private

The factor for radius.

Definition at line 80 of file DavidsonHarel.h.

◆ m_temperature

int ogdf::DavidsonHarel::m_temperature
private

The temperature during the annealing process.

Definition at line 79 of file DavidsonHarel.h.

◆ m_weightsOfEnergyFunctions

List<double> ogdf::DavidsonHarel::m_weightsOfEnergyFunctions
private

The list of the weights for the energy functions.

Definition at line 86 of file DavidsonHarel.h.


The documentation for this class was generated from the following file: