Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches

The LP-based hierarchy cluster layout algorithm. More...

#include <ogdf/layered/OptimalHierarchyClusterLayout.h>

+ Inheritance diagram for ogdf::OptimalHierarchyClusterLayout:

Public Member Functions

 OptimalHierarchyClusterLayout ()
 Creates an instance of optimal hierarchy layout for clusters.
 
 OptimalHierarchyClusterLayout (const OptimalHierarchyClusterLayout &)
 Copy constructor.
 
 ~OptimalHierarchyClusterLayout ()
 
OptimalHierarchyClusterLayoutoperator= (const OptimalHierarchyClusterLayout &)
 Assignment operator.
 
Optional parameters
double nodeDistance () const
 Returns the minimal allowed x-distance between nodes on a layer.
 
void nodeDistance (double x)
 Sets the minimal allowed x-distance between nodes on a layer to x.
 
double layerDistance () const
 Returns the minimal allowed y-distance between layers.
 
void layerDistance (double x)
 Sets the minimal allowed y-distance between layers to x.
 
bool fixedLayerDistance () const
 Returns the current setting of option fixedLayerDistance.
 
void fixedLayerDistance (bool b)
 Sets the option fixedLayerDistance to b.
 
double weightSegments () const
 Returns the weight of edge segments connecting to vertical segments.
 
void weightSegments (double w)
 Sets the weight of edge segments connecting to vertical segments to w.
 
double weightBalancing () const
 Returns the weight for balancing successors below a node; 0.0 means no balancing.
 
void weightBalancing (double w)
 Sets the weight for balancing successors below a node to w; 0.0 means no balancing.
 
double weightClusters () const
 Returns the weight for cluster boundary variables.
 
void weightClusters (double w)
 Sets the weight for cluster boundary variables to w.
 
- Public Member Functions inherited from ogdf::HierarchyClusterLayoutModule
 HierarchyClusterLayoutModule ()
 Initializes a hierarchy cluster layout module.
 
virtual ~HierarchyClusterLayoutModule ()
 
void callCluster (const ExtendedNestingGraph &H, ClusterGraphAttributes &ACG)
 Computes a hierarchy layout of a clustered hierarchy H in ACG.
 

Protected Member Functions

virtual void doCall (const ExtendedNestingGraph &H, ClusterGraphCopyAttributes &ACGC) override
 Implements the algorithm call.
 

Private Member Functions

void buildLayerList (const LHTreeNode *vNode, List< Tuple2< int, double > > &L)
 
void computeXCoordinates (const ExtendedNestingGraph &H, ClusterGraphCopyAttributes &AGC)
 
void computeYCoordinates (const ExtendedNestingGraph &H, ClusterGraphCopyAttributes &AGC)
 

Private Attributes

ClusterArray< intm_cIndex
 
int m_clusterLeftOffset
 
int m_clusterRightOffset
 
bool m_fixedLayerDistance
 Use fixed layer distances?
 
NodeArray< boolm_isVirtual
 
double m_layerDistance
 The minimal distance between layers.
 
double m_nodeDistance
 The minimal distance between nodes.
 
ClusterGraphCopyAttributesm_pACGC
 
const ExtendedNestingGraphm_pH
 
int m_segmentOffset
 
int m_vertexOffset
 
NodeArray< intm_vIndex
 
double m_weightBalancing
 The weight for balancing.
 
double m_weightClusters
 The weight for cluster boundary variables.
 
double m_weightSegments
 The weight of edge segments.
 

Detailed Description

The LP-based hierarchy cluster layout algorithm.

OptimalHierarchyClusterLayout implements a hierarchy layout algorithm fpr cluster graphs that is based on an LP-formulation. It is only available if OGDF is compiled with LP-solver support (e.g., Coin).

The used model avoids Spaghetti-effect like routing of edges by using long vertical segments as in FastHierarchyLayout. An additional balancing can be used which balances the successors below a node.

Optional parameters

OptionTypeDefaultDescription
nodeDistancedouble3.0 The minimal allowed x-distance between nodes on a layer.
layerDistancedouble3.0 The minimal allowed y-distance between layers.
fixedLayerDistanceboolfalse If set to true, the distance between neighboured layers is always layerDistance; otherwise the distance is adjusted (increased) to improve readability.
weightSegmentsdouble2.0 The weight of edge segments connecting to vertical segments.
weightBalancingdouble0.1 The weight for balancing successors below a node; 0.0 means no balancing.
weightClustersdouble0.05 The weight for cluster boundary variables.

Definition at line 80 of file OptimalHierarchyClusterLayout.h.

Constructor & Destructor Documentation

◆ OptimalHierarchyClusterLayout() [1/2]

ogdf::OptimalHierarchyClusterLayout::OptimalHierarchyClusterLayout ( )

Creates an instance of optimal hierarchy layout for clusters.

◆ OptimalHierarchyClusterLayout() [2/2]

ogdf::OptimalHierarchyClusterLayout::OptimalHierarchyClusterLayout ( const OptimalHierarchyClusterLayout )

Copy constructor.

◆ ~OptimalHierarchyClusterLayout()

ogdf::OptimalHierarchyClusterLayout::~OptimalHierarchyClusterLayout ( )
inline

Definition at line 89 of file OptimalHierarchyClusterLayout.h.

Member Function Documentation

◆ buildLayerList()

void ogdf::OptimalHierarchyClusterLayout::buildLayerList ( const LHTreeNode vNode,
List< Tuple2< int, double > > &  L 
)
private

◆ computeXCoordinates()

void ogdf::OptimalHierarchyClusterLayout::computeXCoordinates ( const ExtendedNestingGraph H,
ClusterGraphCopyAttributes AGC 
)
private

◆ computeYCoordinates()

void ogdf::OptimalHierarchyClusterLayout::computeYCoordinates ( const ExtendedNestingGraph H,
ClusterGraphCopyAttributes AGC 
)
private

◆ doCall()

virtual void ogdf::OptimalHierarchyClusterLayout::doCall ( const ExtendedNestingGraph H,
ClusterGraphCopyAttributes ACGC 
)
overrideprotectedvirtual

Implements the algorithm call.

Implements ogdf::HierarchyClusterLayoutModule.

◆ fixedLayerDistance() [1/2]

bool ogdf::OptimalHierarchyClusterLayout::fixedLayerDistance ( ) const
inline

Returns the current setting of option fixedLayerDistance.

If set to true, the distance is always layerDistance; otherwise the distance is adjusted (increased) to improve readability.

Definition at line 124 of file OptimalHierarchyClusterLayout.h.

◆ fixedLayerDistance() [2/2]

void ogdf::OptimalHierarchyClusterLayout::fixedLayerDistance ( bool  b)
inline

Sets the option fixedLayerDistance to b.

Definition at line 127 of file OptimalHierarchyClusterLayout.h.

◆ layerDistance() [1/2]

double ogdf::OptimalHierarchyClusterLayout::layerDistance ( ) const
inline

Returns the minimal allowed y-distance between layers.

Definition at line 110 of file OptimalHierarchyClusterLayout.h.

◆ layerDistance() [2/2]

void ogdf::OptimalHierarchyClusterLayout::layerDistance ( double  x)
inline

Sets the minimal allowed y-distance between layers to x.

Definition at line 113 of file OptimalHierarchyClusterLayout.h.

◆ nodeDistance() [1/2]

double ogdf::OptimalHierarchyClusterLayout::nodeDistance ( ) const
inline

Returns the minimal allowed x-distance between nodes on a layer.

Definition at line 100 of file OptimalHierarchyClusterLayout.h.

◆ nodeDistance() [2/2]

void ogdf::OptimalHierarchyClusterLayout::nodeDistance ( double  x)
inline

Sets the minimal allowed x-distance between nodes on a layer to x.

Definition at line 103 of file OptimalHierarchyClusterLayout.h.

◆ operator=()

OptimalHierarchyClusterLayout & ogdf::OptimalHierarchyClusterLayout::operator= ( const OptimalHierarchyClusterLayout )

Assignment operator.

◆ weightBalancing() [1/2]

double ogdf::OptimalHierarchyClusterLayout::weightBalancing ( ) const
inline

Returns the weight for balancing successors below a node; 0.0 means no balancing.

Definition at line 140 of file OptimalHierarchyClusterLayout.h.

◆ weightBalancing() [2/2]

void ogdf::OptimalHierarchyClusterLayout::weightBalancing ( double  w)
inline

Sets the weight for balancing successors below a node to w; 0.0 means no balancing.

Definition at line 143 of file OptimalHierarchyClusterLayout.h.

◆ weightClusters() [1/2]

double ogdf::OptimalHierarchyClusterLayout::weightClusters ( ) const
inline

Returns the weight for cluster boundary variables.

Definition at line 150 of file OptimalHierarchyClusterLayout.h.

◆ weightClusters() [2/2]

void ogdf::OptimalHierarchyClusterLayout::weightClusters ( double  w)
inline

Sets the weight for cluster boundary variables to w.

Definition at line 153 of file OptimalHierarchyClusterLayout.h.

◆ weightSegments() [1/2]

double ogdf::OptimalHierarchyClusterLayout::weightSegments ( ) const
inline

Returns the weight of edge segments connecting to vertical segments.

Definition at line 130 of file OptimalHierarchyClusterLayout.h.

◆ weightSegments() [2/2]

void ogdf::OptimalHierarchyClusterLayout::weightSegments ( double  w)
inline

Sets the weight of edge segments connecting to vertical segments to w.

Definition at line 133 of file OptimalHierarchyClusterLayout.h.

Member Data Documentation

◆ m_cIndex

ClusterArray<int> ogdf::OptimalHierarchyClusterLayout::m_cIndex
private

Definition at line 191 of file OptimalHierarchyClusterLayout.h.

◆ m_clusterLeftOffset

int ogdf::OptimalHierarchyClusterLayout::m_clusterLeftOffset
private

Definition at line 186 of file OptimalHierarchyClusterLayout.h.

◆ m_clusterRightOffset

int ogdf::OptimalHierarchyClusterLayout::m_clusterRightOffset
private

Definition at line 187 of file OptimalHierarchyClusterLayout.h.

◆ m_fixedLayerDistance

bool ogdf::OptimalHierarchyClusterLayout::m_fixedLayerDistance
private

Use fixed layer distances?

Definition at line 174 of file OptimalHierarchyClusterLayout.h.

◆ m_isVirtual

NodeArray<bool> ogdf::OptimalHierarchyClusterLayout::m_isVirtual
private

Definition at line 189 of file OptimalHierarchyClusterLayout.h.

◆ m_layerDistance

double ogdf::OptimalHierarchyClusterLayout::m_layerDistance
private

The minimal distance between layers.

Definition at line 173 of file OptimalHierarchyClusterLayout.h.

◆ m_nodeDistance

double ogdf::OptimalHierarchyClusterLayout::m_nodeDistance
private

The minimal distance between nodes.

Definition at line 172 of file OptimalHierarchyClusterLayout.h.

◆ m_pACGC

ClusterGraphCopyAttributes* ogdf::OptimalHierarchyClusterLayout::m_pACGC
private

Definition at line 181 of file OptimalHierarchyClusterLayout.h.

◆ m_pH

const ExtendedNestingGraph* ogdf::OptimalHierarchyClusterLayout::m_pH
private

Definition at line 182 of file OptimalHierarchyClusterLayout.h.

◆ m_segmentOffset

int ogdf::OptimalHierarchyClusterLayout::m_segmentOffset
private

Definition at line 185 of file OptimalHierarchyClusterLayout.h.

◆ m_vertexOffset

int ogdf::OptimalHierarchyClusterLayout::m_vertexOffset
private

Definition at line 184 of file OptimalHierarchyClusterLayout.h.

◆ m_vIndex

NodeArray<int> ogdf::OptimalHierarchyClusterLayout::m_vIndex
private

Definition at line 190 of file OptimalHierarchyClusterLayout.h.

◆ m_weightBalancing

double ogdf::OptimalHierarchyClusterLayout::m_weightBalancing
private

The weight for balancing.

Definition at line 177 of file OptimalHierarchyClusterLayout.h.

◆ m_weightClusters

double ogdf::OptimalHierarchyClusterLayout::m_weightClusters
private

The weight for cluster boundary variables.

Definition at line 178 of file OptimalHierarchyClusterLayout.h.

◆ m_weightSegments

double ogdf::OptimalHierarchyClusterLayout::m_weightSegments
private

The weight of edge segments.

Definition at line 176 of file OptimalHierarchyClusterLayout.h.


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