Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

ogdf::PivotMDS Class Reference

The Pivot MDS (multi-dimensional scaling) layout algorithm. More...

#include <ogdf/energybased/PivotMDS.h>

+ Inheritance diagram for ogdf::PivotMDS:

Public Member Functions

 PivotMDS ()
 
virtual ~PivotMDS ()
 
virtual void call (GraphAttributes &GA) override
 Calls the layout algorithm for graph attributes GA. More...
 
bool isForcing2DLayout () const
 Returns whether a 2D-layout is calculated even when GraphAttributes::threeD is set. More...
 
void setEdgeCosts (double edgeCosts)
 Sets the desired distance between adjacent nodes. If the new value is smaller or equal 0 the default value (100) is used. More...
 
void setForcing2DLayout (bool forcing2DLayout)
 Sets whether a 2D-layout should be calculated even when GraphAttributes::threeD is set. More...
 
void setNumberOfPivots (int numberOfPivots)
 Sets the number of pivots. If the new value is smaller or equal 0 the default value (250) is used. More...
 
bool useEdgeCostsAttribute () const
 
void useEdgeCostsAttribute (bool useEdgeCostsAttribute)
 
- Public Member Functions inherited from ogdf::LayoutModule
 LayoutModule ()
 Initializes a layout module. More...
 
virtual ~LayoutModule ()
 
void operator() (GraphAttributes &GA)
 Computes a layout of graph GA. More...
 

Private Member Functions

void centerPivotmatrix (Array< Array< double >> &pivotMatrix)
 Centers the pivot matrix. More...
 
void copySPSS (Array< double > &copyTo, NodeArray< double > &copyFrom)
 
void doPathLayout (GraphAttributes &GA, const node &v)
 Computes the layout of a path. More...
 
void eigenValueDecomposition (Array< Array< double >> &K, Array< Array< double >> &eVecs, Array< double > &eValues)
 Computes the eigen value decomposition based on power iteration. More...
 
void getPivotDistanceMatrix (const GraphAttributes &GA, Array< Array< double >> &pivDistMatrix)
 Computes the pivot distance matrix based on the maxmin strategy. More...
 
node getRootedPath (const Graph &G)
 Checks whether the given graph is a path or not. More...
 
double normalize (Array< double > &x)
 Normalizes the vector x. More...
 
void pivotMDSLayout (GraphAttributes &GA)
 Computes the pivot mds layout of the given connected graph of GA. More...
 
double prod (const Array< double > &x, const Array< double > &y)
 Computes the product of two vectors x and y. More...
 
void randomize (Array< Array< double >> &matrix)
 Fills the given matrix with random doubles d 0 <= d <= 1. More...
 
void selfProduct (const Array< Array< double >> &d, Array< Array< double >> &result)
 Computes the self product of d. More...
 
void singularValueDecomposition (Array< Array< double >> &K, Array< Array< double >> &eVecs, Array< double > &eVals)
 Computes the singular value decomposition of matrix K. More...
 

Private Attributes

int m_dimensionCount
 The dimension count determines the number of evecs that will be computed. Nevertheless PivotMDS only takes the first two with the highest eigenwert into account. More...
 
double m_edgeCosts
 The costs to traverse an edge. More...
 
bool m_forcing2DLayout
 Whether a 2D-layout is calculated even when GraphAttributes::threeD is set. More...
 
bool m_hasEdgeCostsAttribute
 Tells whether the pivot mds is based on uniform edge costs or a edge costs attribute. More...
 
int m_numberOfPivots
 The number of pivots. More...
 

Static Private Attributes

const static double EPSILON
 Convergence factor used for power iteration. More...
 
const static double FACTOR
 Factor used to center the pivot matrix. More...
 
const static unsigned int SEED = 0
 Seed of the random number generator. More...
 

Detailed Description

The Pivot MDS (multi-dimensional scaling) layout algorithm.

Definition at line 57 of file PivotMDS.h.

Constructor & Destructor Documentation

◆ PivotMDS()

ogdf::PivotMDS::PivotMDS ( )
inline

Definition at line 59 of file PivotMDS.h.

◆ ~PivotMDS()

virtual ogdf::PivotMDS::~PivotMDS ( )
inlinevirtual

Definition at line 66 of file PivotMDS.h.

Member Function Documentation

◆ call()

virtual void ogdf::PivotMDS::call ( GraphAttributes GA)
overridevirtual

Calls the layout algorithm for graph attributes GA.

Calculates a 3D-layout if GraphAttributes::threeD is set for GA, and a 2D-layout otherwise. You can use setForcing2DLayout() to force the calculation of a 2D-layout even when GraphAttributes::threeD is set.

Implements ogdf::LayoutModule.

◆ centerPivotmatrix()

void ogdf::PivotMDS::centerPivotmatrix ( Array< Array< double >> &  pivotMatrix)
private

Centers the pivot matrix.

◆ copySPSS()

void ogdf::PivotMDS::copySPSS ( Array< double > &  copyTo,
NodeArray< double > &  copyFrom 
)
private

◆ doPathLayout()

void ogdf::PivotMDS::doPathLayout ( GraphAttributes GA,
const node v 
)
private

Computes the layout of a path.

◆ eigenValueDecomposition()

void ogdf::PivotMDS::eigenValueDecomposition ( Array< Array< double >> &  K,
Array< Array< double >> &  eVecs,
Array< double > &  eValues 
)
private

Computes the eigen value decomposition based on power iteration.

◆ getPivotDistanceMatrix()

void ogdf::PivotMDS::getPivotDistanceMatrix ( const GraphAttributes GA,
Array< Array< double >> &  pivDistMatrix 
)
private

Computes the pivot distance matrix based on the maxmin strategy.

◆ getRootedPath()

node ogdf::PivotMDS::getRootedPath ( const Graph G)
private

Checks whether the given graph is a path or not.

◆ isForcing2DLayout()

bool ogdf::PivotMDS::isForcing2DLayout ( ) const
inline

Returns whether a 2D-layout is calculated even when GraphAttributes::threeD is set.

Definition at line 84 of file PivotMDS.h.

◆ normalize()

double ogdf::PivotMDS::normalize ( Array< double > &  x)
private

Normalizes the vector x.

◆ pivotMDSLayout()

void ogdf::PivotMDS::pivotMDSLayout ( GraphAttributes GA)
private

Computes the pivot mds layout of the given connected graph of GA.

◆ prod()

double ogdf::PivotMDS::prod ( const Array< double > &  x,
const Array< double > &  y 
)
private

Computes the product of two vectors x and y.

◆ randomize()

void ogdf::PivotMDS::randomize ( Array< Array< double >> &  matrix)
private

Fills the given matrix with random doubles d 0 <= d <= 1.

◆ selfProduct()

void ogdf::PivotMDS::selfProduct ( const Array< Array< double >> &  d,
Array< Array< double >> &  result 
)
private

Computes the self product of d.

◆ setEdgeCosts()

void ogdf::PivotMDS::setEdgeCosts ( double  edgeCosts)
inline

Sets the desired distance between adjacent nodes. If the new value is smaller or equal 0 the default value (100) is used.

Definition at line 76 of file PivotMDS.h.

◆ setForcing2DLayout()

void ogdf::PivotMDS::setForcing2DLayout ( bool  forcing2DLayout)
inline

Sets whether a 2D-layout should be calculated even when GraphAttributes::threeD is set.

Definition at line 80 of file PivotMDS.h.

◆ setNumberOfPivots()

void ogdf::PivotMDS::setNumberOfPivots ( int  numberOfPivots)
inline

Sets the number of pivots. If the new value is smaller or equal 0 the default value (250) is used.

Definition at line 70 of file PivotMDS.h.

◆ singularValueDecomposition()

void ogdf::PivotMDS::singularValueDecomposition ( Array< Array< double >> &  K,
Array< Array< double >> &  eVecs,
Array< double > &  eVals 
)
private

Computes the singular value decomposition of matrix K.

◆ useEdgeCostsAttribute() [1/2]

bool ogdf::PivotMDS::useEdgeCostsAttribute ( ) const
inline

Definition at line 99 of file PivotMDS.h.

◆ useEdgeCostsAttribute() [2/2]

void ogdf::PivotMDS::useEdgeCostsAttribute ( bool  useEdgeCostsAttribute)
inline

Definition at line 95 of file PivotMDS.h.

Member Data Documentation

◆ EPSILON

const static double ogdf::PivotMDS::EPSILON
staticprivate

Convergence factor used for power iteration.

Definition at line 103 of file PivotMDS.h.

◆ FACTOR

const static double ogdf::PivotMDS::FACTOR
staticprivate

Factor used to center the pivot matrix.

Definition at line 106 of file PivotMDS.h.

◆ m_dimensionCount

int ogdf::PivotMDS::m_dimensionCount
private

The dimension count determines the number of evecs that will be computed. Nevertheless PivotMDS only takes the first two with the highest eigenwert into account.

Definition at line 117 of file PivotMDS.h.

◆ m_edgeCosts

double ogdf::PivotMDS::m_edgeCosts
private

The costs to traverse an edge.

Definition at line 120 of file PivotMDS.h.

◆ m_forcing2DLayout

bool ogdf::PivotMDS::m_forcing2DLayout
private

Whether a 2D-layout is calculated even when GraphAttributes::threeD is set.

Definition at line 128 of file PivotMDS.h.

◆ m_hasEdgeCostsAttribute

bool ogdf::PivotMDS::m_hasEdgeCostsAttribute
private

Tells whether the pivot mds is based on uniform edge costs or a edge costs attribute.

Definition at line 124 of file PivotMDS.h.

◆ m_numberOfPivots

int ogdf::PivotMDS::m_numberOfPivots
private

The number of pivots.

Definition at line 112 of file PivotMDS.h.

◆ SEED

const static unsigned int ogdf::PivotMDS::SEED = 0
staticprivate

Seed of the random number generator.

Definition at line 109 of file PivotMDS.h.


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