Open
Graph Drawing
Framework

 v. 2022.02 (Dogwood)
 

Modular multilevel graph layout. More...

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

+ Inheritance diagram for ogdf::ModularMultilevelMixer:

Public Types

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

Public Member Functions

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

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

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 72 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 115 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 185 of file ModularMultilevelMixer.h.

◆ errorCode()

erc ogdf::ModularMultilevelMixer::errorCode ( )
inline

Returns the error code of last call.

Definition at line 182 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 146 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 149 of file ModularMultilevelMixer.h.

◆ setFinalLayoutModule()

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

Sets the final layout module to finalLayout.

Definition at line 128 of file ModularMultilevelMixer.h.

◆ setInitialPlacer()

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

Sets the initial placer module to placement.

Definition at line 138 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 143 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 155 of file ModularMultilevelMixer.h.

◆ setLevelLayoutModule()

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

Sets the one-level layout module to levelLayout.

Definition at line 123 of file ModularMultilevelMixer.h.

◆ setMultilevelBuilder()

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

Sets the multilevel builder module to levelBuilder.

Definition at line 133 of file ModularMultilevelMixer.h.

◆ setRandomize()

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

Determines if an initial random layout is computed.

Definition at line 152 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 107 of file ModularMultilevelMixer.h.

◆ m_errorCode

erc ogdf::ModularMultilevelMixer::m_errorCode
private

The error code of the last call.

Definition at line 188 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 90 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 102 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 105 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 96 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 109 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 93 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 82 of file ModularMultilevelMixer.h.

◆ m_randomize

bool ogdf::ModularMultilevelMixer::m_randomize
private

Determines if initial random layout is computed.

Definition at line 110 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 99 of file ModularMultilevelMixer.h.


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