Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

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

Protected Member Functions

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

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< int > m_cIndex
 
int m_clusterLeftOffset
 
int m_clusterRightOffset
 
bool m_fixedLayerDistance
 Use fixed layer distances? More...
 
NodeArray< bool > m_isVirtual
 
double m_layerDistance
 The minimal distance between layers. More...
 
double m_nodeDistance
 The minimal distance between nodes. More...
 
ClusterGraphCopyAttributesm_pACGC
 
const ExtendedNestingGraphm_pH
 
int m_segmentOffset
 
int m_vertexOffset
 
NodeArray< int > m_vIndex
 
double m_weightBalancing
 The weight for balancing. More...
 
double m_weightClusters
 The weight for cluster boundary variables. More...
 
double m_weightSegments
 The weight of edge segments. More...
 

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 90 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 129 of file OptimalHierarchyClusterLayout.h.

◆ fixedLayerDistance() [2/2]

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

Sets the option fixedLayerDistance to b.

Definition at line 134 of file OptimalHierarchyClusterLayout.h.

◆ layerDistance() [1/2]

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

Returns the minimal allowed y-distance between layers.

Definition at line 114 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 119 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 103 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 108 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 150 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 155 of file OptimalHierarchyClusterLayout.h.

◆ weightClusters() [1/2]

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

Returns the weight for cluster boundary variables.

Definition at line 161 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 166 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 139 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 144 of file OptimalHierarchyClusterLayout.h.

Member Data Documentation

◆ m_cIndex

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

Definition at line 209 of file OptimalHierarchyClusterLayout.h.

◆ m_clusterLeftOffset

int ogdf::OptimalHierarchyClusterLayout::m_clusterLeftOffset
private

Definition at line 204 of file OptimalHierarchyClusterLayout.h.

◆ m_clusterRightOffset

int ogdf::OptimalHierarchyClusterLayout::m_clusterRightOffset
private

Definition at line 205 of file OptimalHierarchyClusterLayout.h.

◆ m_fixedLayerDistance

bool ogdf::OptimalHierarchyClusterLayout::m_fixedLayerDistance
private

Use fixed layer distances?

Definition at line 192 of file OptimalHierarchyClusterLayout.h.

◆ m_isVirtual

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

Definition at line 207 of file OptimalHierarchyClusterLayout.h.

◆ m_layerDistance

double ogdf::OptimalHierarchyClusterLayout::m_layerDistance
private

The minimal distance between layers.

Definition at line 191 of file OptimalHierarchyClusterLayout.h.

◆ m_nodeDistance

double ogdf::OptimalHierarchyClusterLayout::m_nodeDistance
private

The minimal distance between nodes.

Definition at line 190 of file OptimalHierarchyClusterLayout.h.

◆ m_pACGC

ClusterGraphCopyAttributes* ogdf::OptimalHierarchyClusterLayout::m_pACGC
private

Definition at line 199 of file OptimalHierarchyClusterLayout.h.

◆ m_pH

const ExtendedNestingGraph* ogdf::OptimalHierarchyClusterLayout::m_pH
private

Definition at line 200 of file OptimalHierarchyClusterLayout.h.

◆ m_segmentOffset

int ogdf::OptimalHierarchyClusterLayout::m_segmentOffset
private

Definition at line 203 of file OptimalHierarchyClusterLayout.h.

◆ m_vertexOffset

int ogdf::OptimalHierarchyClusterLayout::m_vertexOffset
private

Definition at line 202 of file OptimalHierarchyClusterLayout.h.

◆ m_vIndex

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

Definition at line 208 of file OptimalHierarchyClusterLayout.h.

◆ m_weightBalancing

double ogdf::OptimalHierarchyClusterLayout::m_weightBalancing
private

The weight for balancing.

Definition at line 195 of file OptimalHierarchyClusterLayout.h.

◆ m_weightClusters

double ogdf::OptimalHierarchyClusterLayout::m_weightClusters
private

The weight for cluster boundary variables.

Definition at line 196 of file OptimalHierarchyClusterLayout.h.

◆ m_weightSegments

double ogdf::OptimalHierarchyClusterLayout::m_weightSegments
private

The weight of edge segments.

Definition at line 194 of file OptimalHierarchyClusterLayout.h.


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