Expand description
The implementation roughly follows sugiyamas algorithm for creating a layered graph layout.
Usually Sugiyamas algorithm consists of 4 Phases:
- Remove Cycles
- Assign each vertex to a rank/layer
- Reorder vertices in each rank to reduce crossings
- Calculate the final coordinates.
Currently, phase 2 to 4 are implemented, Cycle removal might be added at a later time.
The whole algorithm roughly follows the 1993 paper “A technique for drawing directed graphs” by Gansner et al. It can be found here.
See the submodules for each phase for more details on the implementation and references used.
Modules§
Structs§
Enums§
- Crossing
Minimization - Defines the heuristic used for crossing minimization. During crossing minimization, the vertices of one layer are ordered, so they’re as close to neighboring vertices as possible.
- Ranking
Type - Defines the Ranking type, i.e. how vertices are placed on each layer.
Constants§
Functions§
- assign_
coordinates - Assigns final coordinates to vertices using the computed algorithm state and a label dimensions map. This can be called multiple times with different size maps to create different layout variants.
- run_
sugiyama_ algorithm - Runs the Sugiyama algorithm and returns the layers and vertex graph. This is the computationally expensive part that only needs to be run once.