Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

VPSC

Also known as Variable Placement with Separation Constraints

optimization connector-routing

VPSC (Variable Placement with Separation Constraints) finds the positions closest to the desired ones, in the least-squares sense, so that every constraint x_r − x_l ≥ gap holds. Variables joined by constraints that hold exactly (active constraints) form a block, which moves as one to the mean of its desired positions. It merges blocks along the most violated constraint until no constraint is violated. Then it splits a block where the two halves want to move apart (a negative Lagrange multiplier), and repeats. In connector-routing, Placement::Project uses it to place nudged segments, with exact rational arithmetic.

Pseudocode

algorithm Project(d, C)input: desired positions d (nil for a fixed node), constraints C of the form x_r − x_l ≥ gapoutput: positions x as close to d as possible (least squares) that satisfy every constraintB ← one block per node                    ▷ each node has offset 0 in its blocksatisfy(B, C)a ← most-negative-multiplier(B)while a ≠ nil dosplit(B, a)                             ▷ the two halves of a would rather move apartsatisfy(B, C)a ← most-negative-multiplier(B)return round(x[n] = position(block(n)) + offset[n] for every node n)procedure satisfy(B, C)while some constraint between two blocks is violated doc ← most-violated(C)merge(block(left(c)), block(right(c)), c)   ▷ shift offsets so c holds with equalityfunction position(b)if b has a fixed node n thenreturn fixed[n] − offset[n]return mean of d[n] − offset[n] over the nodes n of bfunction multiplier(a)▷ the right side of a: nodes linked to right(a) by the other active constraintsreturn ∑ over n in right-side(a) of x[n] − d[n]

In the crates

Lineage

Comes from

Nothing on this site.

Led to

Nudging builds on it

Papers

  1. Fast Node Overlap Removal Tim Dwyer, Kim Marriott, Peter J. Stuckey · 2006· Graph Drawing (GD 2005), LNCS introduces doi 10.1007/11618058_15
  2. Orthogonal Connector Routing Michael Wybrow, Kim Marriott, Peter J. Stuckey · 2010· Graph Drawing (GD 2009), LNCS applies doi 10.1007/978-3-642-11805-0_22