Interface DecrossTwoLayer<Ops>

a decrossing operator that reorders by looking at pairs of layers

This method can be very fast and is a general heuristic for efficient minimization. Customize with a two layer operator with order, different inits, or the number of passes.

Type Parameters

Hierarchy

Methods

Methods

  • sets the initialization passes before decrossings

    For every initialization operator, this will run the two layer heuristic, ultimately choosing the ordering that minimized overall crossings. For this reason, only quick decrossing operators should be used, not expensive ones. The empty list is treated as a singleton list with a noop operator.

    (default: [decrossDfs(), decrossDfs().topDown(false)])

    Type Parameters

    • const NewInits extends readonly Decross<never, never>[]

    Parameters

    • val: NewInits

    Returns DecrossTwoLayer<U<Ops, "inits", NewInits>>

  • get the current initialization passes

    Returns Ops["inits"]

  • sets the Twolayer accessor for minimizing a layer at a time

    The Twolayer operator takes pairs of layers, and reorders one. There are three built-in variants:

    • twolayerGreedy - This takes another two-layer operator, runs it, and then afterwards performs greedy swaps of nodes to reduce the number of edge crossings further. While not perfect, it can improve the results of simpler heuristics.
    • twolayerAgg - This aggregates the indices of ancestor nodes and orders nodes according to those aggregates. This is very fast and produces a good first-order decrossing, but is best when used in conjunction with twolayerGreedy.
    • twolayerOpt - This is the sibling to decrossOpt that only optimizes a single layer, but otherwise has similar options. Just like full optimal decrossing, this will fail on large graphs, but also rarely produces better results than the combination of twolayerGreedy and twolayerAgg.

    (default: twolayerGreedy)

    Type Parameters

    • NewOrder extends Twolayer<never, never>

    Parameters

    • val: NewOrder

    Returns DecrossTwoLayer<U<Ops, "order", NewOrder>>

  • get the current Twolayer for ordering

    Returns Ops["order"]

Generated using TypeDoc