Module

LayeredLayout.CycleRemoval

Package
purescript-layered-layout
Repository
markgrafhq/purescript-layered-layout

#makeAcyclicWithOrder Source

makeAcyclicWithOrder :: CycleStrategy -> Array NodeId -> Array Constraints -> Array Edge -> AcyclicResult

Like makeAcyclicWith but lets the caller pass the canonical input order of nodes so the Greedy strategy can break max-outflow ties by model order (port of ELK's GREEDY_MODEL_ORDER variant). Pass [] when no model order should be applied.

#AcyclicResult Source

type AcyclicResult = { edges :: Array Edge, reversedEdges :: Set (NodeId /\ NodeId) }

#CycleStrategy Source

data CycleStrategy

Cycle-removal strategy. DepthFirst is the existing DepthFirstCycleBreaker port. Greedy is ELK's default GreedyCycleBreaker, which drains sinks/sources iteratively and breaks ties by maximum out-flow; it generally reverses fewer edges than the DFS variant.

Constructors

Instances