56 : m_hasEdgeCostsAttribute(
false)
57 , m_hasInitialLayout(
false)
58 , m_numberOfIterations(200)
61 , m_componentLayout(
false)
66 , m_forcing2DLayout(
false)
77 inline void hasInitialLayout(
bool hasInitialLayout);
80 inline void fixXCoordinates(
bool fix);
83 inline void fixYCoordinates(
bool fix);
90 inline void layoutComponentsSeparately(
bool separate);
94 inline void setEdgeCosts(
double edgeCosts);
98 inline void setIterations(
int numberOfIterations);
104 inline void useEdgeCostsAttribute(
bool useEdgeCostsAttribute);
Splits and packs the components of a Graph.
Declaration of interface for layout algorithms (class LayoutModule)
Declaration of the pivot MDS.
Declaration of several shortest path algorithms.
Stores additional attributes of a graph (like layout information).
Data type for general directed graphs (adjacency list representation).
Interface of general layout algorithms.
Dynamic arrays indexed with nodes.
Energy-based layout using stress minimization.
void setForcing2DLayout(bool forcing2DLayout)
Sets whether a 2D-layout should be calculated even when GraphAttributes::threeD is set.
TerminationCriterion m_terminationCriterion
Indicates whether epsilon convergence is used or not.
virtual void call(GraphAttributes &GA) override
Calls the layout algorithm with uniform edge costs.
void initMatrices(const Graph &G, NodeArray< NodeArray< double > > &shortestPathMatrix, NodeArray< NodeArray< double > > &weightMatrix)
Convenience method to initialize the matrices.
bool m_fixYCoords
Indicates whether the y coordinates will be modified or not.
bool m_hasEdgeCostsAttribute
Tells whether the stress minimization is based on uniform edge costs or a edge costs attribute.
void convergenceCriterion(TerminationCriterion criterion)
Tells which TerminationCriterion should be used.
double calcStress(const GraphAttributes &GA, NodeArray< NodeArray< double > > &shortestPathMatrix, NodeArray< NodeArray< double > > &weightMatrix)
Calculates the stress for the given layout.
void call(GraphAttributes &GA, NodeArray< NodeArray< double > > &shortestPathMatrix, NodeArray< NodeArray< double > > &weightMatrix)
Runs the stress for a given Graph, shortest path and weight matrix.
bool m_forcing2DLayout
Indicates whether a 2D-layout is calculated even when GraphAttributes::threeD is set.
void hasInitialLayout(bool hasInitialLayout)
Tells whether the current layout should be used or the initial layout needs to be computed.
void fixYCoordinates(bool fix)
Tells whether the y coordinates are allowed to be modified or not.
static const int DEFAULT_NUMBER_OF_PIVOTS
Default number of pivots used for the initial Pivot-MDS layout.
bool m_use3D
Indicates whether a 3D-layout is computed.
bool finished(GraphAttributes &GA, int numberOfPerformedIterations, NodeArray< double > &prevXCoords, NodeArray< double > &prevYCoords, const double prevStress, const double curStress)
Checks for epsilon convergence and whether the performed number of iterations exceed the predefined m...
bool m_componentLayout
Indicates whether the components should be treated separately.
void computeInitialLayout(GraphAttributes &GA)
Calculates the intial layout of the graph if necessary.
void useEdgeCostsAttribute(bool useEdgeCostsAttribute)
Tells whether the edge costs are uniform or defined by some edge costs attribute.
~StressMinimization()
Destructor.
bool m_fixZCoords
Indicates whether the z coordinates will be modified or not.
void nextIteration(GraphAttributes &GA, NodeArray< NodeArray< double > > &shortestPathMatrix, NodeArray< NodeArray< double > > &weightMatrix)
Runs the next iteration of the stress minimization process. Note that serial update is used.
int m_numberOfIterations
Number of iterations performed by the stress minimization.
void fixXCoordinates(bool fix)
Tells whether the x coordinates are allowed to be modified or not.
void layoutComponentsSeparately(bool separate)
Sets whether the graph's components should be layouted separately or a dummy distance should be used ...
void replaceInfinityDistances(NodeArray< NodeArray< double > > &shortestPathMatrix, double newVal)
Replaces infinite distances to the given value.
double m_edgeCosts
The weight of an edge.
static const double EPSILON
Convergence constant.
void setEdgeCosts(double edgeCosts)
Sets the desired distance between adjacent nodes. If the new value is smaller or equal 0 the default ...
void copyLayout(const GraphAttributes &GA, NodeArray< double > &newX, NodeArray< double > &newY)
Convenience method copying the layout of the graph in case of epsilon convergence.
void setIterations(int numberOfIterations)
Sets a fixed number of iterations for stress majorization. If the new value is smaller or equal 0 the...
bool m_hasInitialLayout
Tells whether an initial layout has to be computed or not.
void calcWeights(const Graph &G, NodeArray< NodeArray< double > > &shortestPathMatrix, NodeArray< NodeArray< double > > &weightMatrix)
Calculates the weight matrix of the shortest path matrix. This is done by w_ij = s_ij^{-2}.
double m_avgEdgeCosts
The average edge costs. Needed to define distances of nodes belonging to different graph components.
void fixZCoordinates(bool fix)
Tells whether the z coordinates are allowed to be modified or not.
bool m_fixXCoords
Indicates whether the x coordinates will be modified or not.
void copyLayout(const GraphAttributes &GA, NodeArray< double > &newX, NodeArray< double > &newY, NodeArray< double > &newZ)
Convenience method copying the layout of the graph in case of epsilon convergence for 3D.
void minimizeStress(GraphAttributes &GA, NodeArray< NodeArray< double > > &shortestPathMatrix, NodeArray< NodeArray< double > > &weightMatrix)
Minimizes the stress for each component separately given the shortest path matrix and the weight matr...
StressMinimization()
Constructor: Constructs instance of stress majorization.
#define OGDF_EXPORT
Specifies that a function or class is exported by the OGDF DLL.
static MultilevelBuilder * getDoubleFactoredZeroAdjustedMerger()
The namespace for all OGDF objects.
@ None
Two geometric objects do not intersect.
Declaration of simple graph algorithms.