Reference

Contents

Index

Sugiyama.SugiyamaLayoutType
SugiyamaLayout(; kwargs...)(adj_matrix)
sugiyama(adj_matrix; kwargs...)

Layered ("hierarchical") layout for directed graphs: vertices are grouped into ranks, edge crossings between ranks are heuristically minimized, and coordinates are assigned within each rank. Ranking and crossing minimization follow Gansner, Koutsofios, North & Vo (1993, doi 10.1109/32.221135); coordinate assignment follows Brandes & Köpf (2002, doi 10.1007/3-540-45848-4_3).

Takes the adjacency matrix of a directed graph and returns coordinates of the nodes as Point{2,Ptype}. Cycles are broken by implicitly reversing edges; disconnected components are laid out independently and placed side by side.

Keyword Arguments

  • Ptype=Float64: Determines the output type Point{2,Ptype}.
  • nodesize=Float64[]: Size of each node. Filled up with ones or truncated to match the number of nodes.
  • nodespacing=1.0: Minimum gap between neighboring nodes, both within a rank and between ranks.
  • dummysize=0.0: Width of the invisible "dummy" nodes used internally to route edges spanning more than one rank.
  • minimum_length=1: Minimum number of ranks every edge must span.
  • ranking_type=:networksimplex: :networksimplex minimizes total edge length (as in the papers above); :longestpath, :up and :down are cheaper longest-path schedules (from both ends, from sources only, and from sinks only, respectively).
  • crossing_minimization=:barycenter: :barycenter or :median heuristic used to reorder each rank.
  • transpose=true: Follow up with a greedy pairwise-swap pass that further reduces crossings, at the cost of runtime.
  • direction=:right: Which way ranks flow: :down, :up, :left or :right.

This implementation is a Julia port of rust-sugiyama.

source
Sugiyama.sugiyamaFunction
sugiyama(adj_matrix; kwargs...)

Layered ("hierarchical") layout for directed graphs. Takes the adjacency matrix of a directed graph and returns coordinates of the nodes as Point{2,Ptype}.

Accepts the same keyword arguments as SugiyamaLayout, which also documents the algorithm.

source
Sugiyama.sugiyama_pathsFunction
sugiyama_paths(adj_matrix; kwargs...) -> (positions, edge_paths)

Like sugiyama, but also returns the routing of each edge as a polyline. edge_paths is a Dict{Tuple{Int,Int},Vector{Point{2,Ptype}}} mapping each nonzero (i, j) entry of adj_matrix to [positions[i], bend points..., positions[j]].

Accepts the same keyword arguments as SugiyamaLayout.

source