Modular multilevel graph layout. More...
#include <ogdf/energybased/multilevel_mixer/ModularMultilevelMixer.h>
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< LayoutModule > | m_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< InitialPlacer > | m_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< MultilevelBuilder > | m_multilevelBuilder |
The multilevel builder module computes the multilevel hierarchy. More... | |
std::unique_ptr< LayoutModule > | m_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... | |
Modular multilevel graph layout.
The various phases of the algorithm can be exchanged by setting module options allowing flexible customization. The algorithm provides the following module options:
Option | Type | Default | Description |
---|---|---|---|
multilevelBuilder | MultilevelBuilder | SolarMerger | The multilevel builder module that computes the multilevel graph hierarchy. |
initialPlacer | InitialPlacer | BarycenterPlacer | The initial placer module that computes the initial positions for nodes inserted into the previous level. |
levelLayout | LayoutModule | FastMultipoleEmbedder | The layout module applied on each level. |
finalLayout | LayoutModule | none | The layout module applied on the last level. |
postLayout | LayoutModule | none | The layout module applied to the final drawing for additional beautification. |
Definition at line 75 of file ModularMultilevelMixer.h.
|
strong |
Error codes for calls.
Enumerator | |
---|---|
None | no error |
LevelBound | level bound exceeded by merger step |
Definition at line 115 of file ModularMultilevelMixer.h.
ogdf::ModularMultilevelMixer::ModularMultilevelMixer | ( | ) |
|
overridevirtual |
Calls the multilevel layout algorithm for graph attributes GA
.
Implements ogdf::LayoutModule.
|
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.
MLG | is the input graph and will also be assigned the layout information. |
|
inline |
Returns the ratio c/p between sizes of previous (p) and current (c) level graphs.
Definition at line 181 of file ModularMultilevelMixer.h.
|
inline |
Returns the error code of last call.
Definition at line 178 of file ModularMultilevelMixer.h.
|
inline |
If len
> 0, all edge weights will be set to len
.
Definition at line 142 of file ModularMultilevelMixer.h.
|
inline |
If size
> 0, all node sizes will be set to size
.
Definition at line 145 of file ModularMultilevelMixer.h.
|
inline |
Sets the final layout module to finalLayout
.
Definition at line 128 of file ModularMultilevelMixer.h.
|
inline |
Sets the initial placer module to placement
.
Definition at line 136 of file ModularMultilevelMixer.h.
|
inline |
Determines how many times the one-level layout will be called.
Definition at line 139 of file ModularMultilevelMixer.h.
|
inline |
Determines if computation is stopped when number of levels is too high.
Definition at line 151 of file ModularMultilevelMixer.h.
|
inline |
Sets the one-level layout module to levelLayout
.
Definition at line 123 of file ModularMultilevelMixer.h.
|
inline |
Sets the multilevel builder module to levelBuilder
.
Definition at line 131 of file ModularMultilevelMixer.h.
|
inline |
Determines if an initial random layout is computed.
Definition at line 148 of file ModularMultilevelMixer.h.
|
private |
Ratio between sizes of previous (p) and current (c) level graphs: c/p.
Definition at line 108 of file ModularMultilevelMixer.h.
|
private |
The error code of the last call.
Definition at line 184 of file ModularMultilevelMixer.h.
|
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 91 of file ModularMultilevelMixer.h.
|
private |
If set to a value > 0, all edge weights will be set to this value.
Definition at line 103 of file ModularMultilevelMixer.h.
|
private |
If set to a value > 0, all node sizes will be set to this value.
Definition at line 106 of file ModularMultilevelMixer.h.
|
private |
The initial placer module computes the initial positions for nodes inserted into the previous level.
Definition at line 97 of file ModularMultilevelMixer.h.
|
private |
Determines if computation is stopped when number of levels is too high.
Definition at line 110 of file ModularMultilevelMixer.h.
|
private |
The multilevel builder module computes the multilevel hierarchy.
Definition at line 94 of file ModularMultilevelMixer.h.
|
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 83 of file ModularMultilevelMixer.h.
|
private |
Determines if initial random layout is computed.
Definition at line 111 of file ModularMultilevelMixer.h.
|
private |
The one-level layout will be called m_times to improve quality.
Definition at line 100 of file ModularMultilevelMixer.h.