Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

Loading...
Searching...
No Matches

Modular multilevel graph layout. More...

#include <ogdf/energybased/multilevel_mixer/ModularMultilevelMixer.h>

+ Inheritance diagram for ogdf::ModularMultilevelMixer:

Public Types

enum class  erc { None , LevelBound }
 Error codes for calls. More...
 

Public Member Functions

 ModularMultilevelMixer ()
 
void call (GraphAttributes &GA) override
 Calls the multilevel layout algorithm for graph attributes GA.
 
virtual void call (MultilevelGraph &MLG)
 Calls the multilevel layout algorithm for multilevel graph MLG.
 
double coarseningRatio ()
 Returns the ratio c/p between sizes of previous (p) and current (c) level graphs.
 
erc errorCode ()
 Returns the error code of last call.
 
void setAllEdgeLengths (double len)
 If len > 0, all edge weights will be set to len.
 
void setAllNodeSizes (double size)
 If size > 0, all node sizes will be set to size.
 
void setFinalLayoutModule (LayoutModule *finalLayout)
 Sets the final layout module to finalLayout.
 
void setInitialPlacer (InitialPlacer *placement)
 Sets the initial placer module to placement.
 
void setLayoutRepeats (int times=1)
 Determines how many times the one-level layout will be called.
 
void setLevelBound (bool b)
 Determines if computation is stopped when number of levels is too high.
 
void setLevelLayoutModule (LayoutModule *levelLayout)
 Sets the one-level layout module to levelLayout.
 
void setMultilevelBuilder (MultilevelBuilder *levelBuilder)
 Sets the multilevel builder module to levelBuilder.
 
void setRandomize (bool b)
 Determines if an initial random layout is computed.
 
- Public Member Functions inherited from ogdf::LayoutModule
 LayoutModule ()
 Initializes a layout module.
 
virtual ~LayoutModule ()
 
void operator() (GraphAttributes &GA)
 Computes a layout of graph GA.
 

Private Attributes

double m_coarseningRatio
 Ratio between sizes of previous (p) and current (c) level graphs: c/p.
 
erc m_errorCode
 The error code of the last call.
 
std::unique_ptr< LayoutModulem_finalLayoutModule
 The layout algorithm applied on the last level (i.e., the largest graph in the multilevel hierarchy).
 
double m_fixedEdgeLength
 If set to a value > 0, all edge weights will be set to this value.
 
double m_fixedNodeSize
 If set to a value > 0, all node sizes will be set to this value.
 
std::unique_ptr< InitialPlacerm_initialPlacement
 The initial placer module computes the initial positions for nodes inserted into the previous level.
 
bool m_levelBound
 Determines if computation is stopped when number of levels is too high.
 
std::unique_ptr< MultilevelBuilderm_multilevelBuilder
 The multilevel builder module computes the multilevel hierarchy.
 
std::unique_ptr< LayoutModulem_oneLevelLayoutModule
 The layout algorithm applied on each level.
 
bool m_randomize
 Determines if initial random layout is computed.
 
int m_times
 The one-level layout will be called m_times to improve quality.
 

Detailed Description

Modular multilevel graph layout.

Module options

The various phases of the algorithm can be exchanged by setting module options allowing flexible customization. The algorithm provides the following module options:

OptionTypeDefaultDescription
multilevelBuilderMultilevelBuilderSolarMerger The multilevel builder module that computes the multilevel graph hierarchy.
initialPlacerInitialPlacerBarycenterPlacer The initial placer module that computes the initial positions for nodes inserted into the previous level.
levelLayoutLayoutModuleFastMultipoleEmbedder The layout module applied on each level.
finalLayoutLayoutModulenone The layout module applied on the last level.
postLayoutLayoutModulenone The layout module applied to the final drawing for additional beautification.

Definition at line 73 of file ModularMultilevelMixer.h.

Member Enumeration Documentation

◆ erc

Error codes for calls.

Enumerator
None 

no error

LevelBound 

level bound exceeded by merger step

Definition at line 113 of file ModularMultilevelMixer.h.

Constructor & Destructor Documentation

◆ ModularMultilevelMixer()

ogdf::ModularMultilevelMixer::ModularMultilevelMixer ( )

Member Function Documentation

◆ call() [1/2]

void ogdf::ModularMultilevelMixer::call ( GraphAttributes GA)
overridevirtual

Calls the multilevel layout algorithm for graph attributes GA.

Implements ogdf::LayoutModule.

◆ call() [2/2]

virtual void ogdf::ModularMultilevelMixer::call ( MultilevelGraph MLG)
virtual

Calls the multilevel layout algorithm for multilevel graph MLG.

This method allows the mixer to modify the Graph, saving some memory compared to a normal call(GA) in our implementation. (because the Graph is already given in the MultiLevelGraph Format (or can be converted without creating a copy) AND the layout would need a copy otherwise). All Incremental Layouts (especially energy based) CAN be called by ModularMultilevelMixer.

Parameters
MLGis the input graph and will also be assigned the layout information.

◆ coarseningRatio()

double ogdf::ModularMultilevelMixer::coarseningRatio ( )
inline

Returns the ratio c/p between sizes of previous (p) and current (c) level graphs.

Definition at line 179 of file ModularMultilevelMixer.h.

◆ errorCode()

erc ogdf::ModularMultilevelMixer::errorCode ( )
inline

Returns the error code of last call.

Definition at line 176 of file ModularMultilevelMixer.h.

◆ setAllEdgeLengths()

void ogdf::ModularMultilevelMixer::setAllEdgeLengths ( double  len)
inline

If len > 0, all edge weights will be set to len.

Definition at line 140 of file ModularMultilevelMixer.h.

◆ setAllNodeSizes()

void ogdf::ModularMultilevelMixer::setAllNodeSizes ( double  size)
inline

If size > 0, all node sizes will be set to size.

Definition at line 143 of file ModularMultilevelMixer.h.

◆ setFinalLayoutModule()

void ogdf::ModularMultilevelMixer::setFinalLayoutModule ( LayoutModule finalLayout)
inline

Sets the final layout module to finalLayout.

Definition at line 126 of file ModularMultilevelMixer.h.

◆ setInitialPlacer()

void ogdf::ModularMultilevelMixer::setInitialPlacer ( InitialPlacer placement)
inline

Sets the initial placer module to placement.

Definition at line 134 of file ModularMultilevelMixer.h.

◆ setLayoutRepeats()

void ogdf::ModularMultilevelMixer::setLayoutRepeats ( int  times = 1)
inline

Determines how many times the one-level layout will be called.

Definition at line 137 of file ModularMultilevelMixer.h.

◆ setLevelBound()

void ogdf::ModularMultilevelMixer::setLevelBound ( bool  b)
inline

Determines if computation is stopped when number of levels is too high.

Definition at line 149 of file ModularMultilevelMixer.h.

◆ setLevelLayoutModule()

void ogdf::ModularMultilevelMixer::setLevelLayoutModule ( LayoutModule levelLayout)
inline

Sets the one-level layout module to levelLayout.

Definition at line 121 of file ModularMultilevelMixer.h.

◆ setMultilevelBuilder()

void ogdf::ModularMultilevelMixer::setMultilevelBuilder ( MultilevelBuilder levelBuilder)
inline

Sets the multilevel builder module to levelBuilder.

Definition at line 129 of file ModularMultilevelMixer.h.

◆ setRandomize()

void ogdf::ModularMultilevelMixer::setRandomize ( bool  b)
inline

Determines if an initial random layout is computed.

Definition at line 146 of file ModularMultilevelMixer.h.

Member Data Documentation

◆ m_coarseningRatio

double ogdf::ModularMultilevelMixer::m_coarseningRatio
private

Ratio between sizes of previous (p) and current (c) level graphs: c/p.

Definition at line 106 of file ModularMultilevelMixer.h.

◆ m_errorCode

erc ogdf::ModularMultilevelMixer::m_errorCode
private

The error code of the last call.

Definition at line 182 of file ModularMultilevelMixer.h.

◆ m_finalLayoutModule

std::unique_ptr<LayoutModule> ogdf::ModularMultilevelMixer::m_finalLayoutModule
private

The layout algorithm applied on the last level (i.e., the largest graph in the multilevel hierarchy).

The final layout module can be set to speed up the computation if the one-level layout ist relatively slow. If not set, the one-level layout is also used on the last level.

Definition at line 89 of file ModularMultilevelMixer.h.

◆ m_fixedEdgeLength

double ogdf::ModularMultilevelMixer::m_fixedEdgeLength
private

If set to a value > 0, all edge weights will be set to this value.

Definition at line 101 of file ModularMultilevelMixer.h.

◆ m_fixedNodeSize

double ogdf::ModularMultilevelMixer::m_fixedNodeSize
private

If set to a value > 0, all node sizes will be set to this value.

Definition at line 104 of file ModularMultilevelMixer.h.

◆ m_initialPlacement

std::unique_ptr<InitialPlacer> ogdf::ModularMultilevelMixer::m_initialPlacement
private

The initial placer module computes the initial positions for nodes inserted into the previous level.

Definition at line 95 of file ModularMultilevelMixer.h.

◆ m_levelBound

bool ogdf::ModularMultilevelMixer::m_levelBound
private

Determines if computation is stopped when number of levels is too high.

Definition at line 108 of file ModularMultilevelMixer.h.

◆ m_multilevelBuilder

std::unique_ptr<MultilevelBuilder> ogdf::ModularMultilevelMixer::m_multilevelBuilder
private

The multilevel builder module computes the multilevel hierarchy.

Definition at line 92 of file ModularMultilevelMixer.h.

◆ m_oneLevelLayoutModule

std::unique_ptr<LayoutModule> ogdf::ModularMultilevelMixer::m_oneLevelLayoutModule
private

The layout algorithm applied on each level.

The one-level layout module should not completely discard the initial Layout but do incremental beautification. Usually a simple force-directed / energy-based Layout should be chosen.

Definition at line 81 of file ModularMultilevelMixer.h.

◆ m_randomize

bool ogdf::ModularMultilevelMixer::m_randomize
private

Determines if initial random layout is computed.

Definition at line 109 of file ModularMultilevelMixer.h.

◆ m_times

int ogdf::ModularMultilevelMixer::m_times
private

The one-level layout will be called m_times to improve quality.

Definition at line 98 of file ModularMultilevelMixer.h.


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