Modular multilevel graph layout. More...
#include <ogdf/energybased/multilevel_mixer/ModularMultilevelMixer.h>
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< LayoutModule > | m_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< InitialPlacer > | m_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< MultilevelBuilder > | m_multilevelBuilder |
The multilevel builder module computes the multilevel hierarchy. | |
std::unique_ptr< LayoutModule > | m_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. | |
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 73 of file ModularMultilevelMixer.h.
Error codes for calls.
Enumerator | |
---|---|
None | no error |
LevelBound | level bound exceeded by merger step |
Definition at line 113 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 179 of file ModularMultilevelMixer.h.
|
inline |
Returns the error code of last call.
Definition at line 176 of file ModularMultilevelMixer.h.
If len
> 0, all edge weights will be set to len
.
Definition at line 140 of file ModularMultilevelMixer.h.
If size
> 0, all node sizes will be set to size
.
Definition at line 143 of file ModularMultilevelMixer.h.
|
inline |
Sets the final layout module to finalLayout
.
Definition at line 126 of file ModularMultilevelMixer.h.
|
inline |
Sets the initial placer module to placement
.
Definition at line 134 of file ModularMultilevelMixer.h.
Determines how many times the one-level layout will be called.
Definition at line 137 of file ModularMultilevelMixer.h.
Determines if computation is stopped when number of levels is too high.
Definition at line 149 of file ModularMultilevelMixer.h.
|
inline |
Sets the one-level layout module to levelLayout
.
Definition at line 121 of file ModularMultilevelMixer.h.
|
inline |
Sets the multilevel builder module to levelBuilder
.
Definition at line 129 of file ModularMultilevelMixer.h.
Determines if an initial random layout is computed.
Definition at line 146 of file ModularMultilevelMixer.h.
|
private |
Ratio between sizes of previous (p) and current (c) level graphs: c/p.
Definition at line 106 of file ModularMultilevelMixer.h.
|
private |
The error code of the last call.
Definition at line 182 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 89 of file ModularMultilevelMixer.h.
|
private |
If set to a value > 0, all edge weights will be set to this value.
Definition at line 101 of file ModularMultilevelMixer.h.
|
private |
If set to a value > 0, all node sizes will be set to this value.
Definition at line 104 of file ModularMultilevelMixer.h.
|
private |
The initial placer module computes the initial positions for nodes inserted into the previous level.
Definition at line 95 of file ModularMultilevelMixer.h.
|
private |
Determines if computation is stopped when number of levels is too high.
Definition at line 108 of file ModularMultilevelMixer.h.
|
private |
The multilevel builder module computes the multilevel hierarchy.
Definition at line 92 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 81 of file ModularMultilevelMixer.h.
|
private |
Determines if initial random layout is computed.
Definition at line 109 of file ModularMultilevelMixer.h.
|
private |
The one-level layout will be called m_times to improve quality.
Definition at line 98 of file ModularMultilevelMixer.h.