Papers
Topics
Authors
Recent
2000 character limit reached

Octilinear Compaction in Graph Drawings

Updated 2 December 2025
  • Octilinear compaction is a graph drawing method that minimizes grid area by enforcing edges to follow horizontal, vertical, or ±45° diagonal directions.
  • It employs dual network flow techniques to synchronize edge lengths and optimize vertex placements under strict angular and bend constraints.
  • The method is NP-hard with no PTAS available, though fixed-parameter tractable and XP algorithms are achieved under convex and almost convex restrictions.

Octilinear compaction is a constrained minimization problem within the graph drawing paradigm, specifically targeting planar representations where each edge is restricted to horizontal, vertical, or diagonal orientations (slopes in {0,,±1}\{0,\infty,\pm1\}). The objective is, given a realizable octilinear representation R\mathcal{R} of a planar graph G=(V,E)G=(V,E), to produce a straight-line grid drawing ΓR\Gamma \in \mathcal{R} with minimum area, where area is defined as (xmaxxmin+1)(ymaxymin+1)(x_{\max} - x_{\min} + 1)(y_{\max} - y_{\min} + 1). This problem generalizes orthogonal compaction by permitting diagonal segments and is central to applications demanding aesthetic and compact layouts, such as metro map schematics and circuit diagrams.

1. Formal Specification of Octilinear Compaction

An octilinear representation is a quadruple specifying (i) a planar embedding, (ii) angles between consecutive edges at vertices selected from the octilinear set {π4,π2,3π4,,7π4}\{\frac{\pi}{4}, \frac{\pi}{2}, \frac{3\pi}{4}, \ldots, \frac{7\pi}{4}\}, (iii) the number and placement of bends per edge, and (iv) the bend angles (multiples of π4\frac{\pi}{4}). A drawing realizes the representation if it adheres strictly to the above specifications: the embedding, the prescribed angles, the bend counts and placements, and the restriction to the octilinear slopes.

Formally, octilinear compaction asks for a grid drawing of the input representation R\mathcal{R} such that:

  • Vertices are placed at integer grid coordinates.
  • Edges follow prescribed routing with unit-length straight segments along the allowed slopes.
  • No edge crossings are permitted.
  • The area A(Γ)A(\Gamma) of the bounding box is minimized.

2. Computational Hardness and Inapproximability

While orthogonal realizability can be resolved in linear time and orthogonal compaction is known to be NP-hard for cycles, octilinear compaction introduces new complexity due to diagonal segments. The problem is intrinsically at least as hard as its orthogonal counterpart. The key result is:

Theorem: Octilinear Compaction admits no polynomial-time approximation scheme (PTAS), even under the significant restriction that the representation has no reflex angle except possibly four located at the external face (Förster et al., 25 Nov 2025).

A critical aspect of the hardness proof is an inapproximability construction based on 3-SAT reductions using variable and clause gadgets (triangular and rectangular substructures) and “unit-chain” boundary augmentations. The optimal area is highly sensitive to feasible unit length choices (u=1\ell_u=1 or $2$), and any (9/4ϵ)(9/4-\epsilon) approximation algorithm would differentiate satisfiable from unsatisfiable SAT instances, violating P\neqNP unless P=NP. Importantly, this hardness persists even if every internal face is strictly convex and all nonconvexity is confined to just four corners at the boundary (“almost convex” constraint).

3. Algorithmic Techniques under Convexity and “Almost Convex” Constraints

When input representations are restricted to be convex, i.e., with no reflex angles in internal faces and no inflex (angle >π> \pi) on the outer face, a polynomial-time algorithm is available via dual network flow formulations ((Förster et al., 25 Nov 2025), Lemma 1):

  • Horizontal flow (GG\to): Constructed on the dual graph using faces as nodes and arcs for vertical edges, with flow demands encoding required face width relationships.
  • Vertical flow (GG\downarrow): Analogous construction for horizontal edges and heights.

The solution of these two flows synchronizes edge lengths and guarantees a minimum-area drawing respecting all representation constraints.

When the representation is almost convex (no internal reflex, up to four reflex at the boundary) but contains diagonal edges, an XP algorithm parameterized by δ=\delta= number of diagonals is available (Förster et al., 25 Nov 2025):

  1. The optimal length \ell of each diagonal belongs to [1,A(δ)][1,A(\delta)], where A(δ)A(\delta) is exponential in δ\delta but independent of nn.
  2. All \ell combinations are enumerated, A(δ)δ=2O(δlogδ)A(\delta)^\delta = 2^{O(\delta \log \delta)}.
  3. For each assignment, convex compaction is reduced to two flow networks augmented by length constraints, solved via an LP in O(n3)O(n^3).
  4. The best drawing is reported, yielding a total running time O(2O(δlogδ)nO(1))O(2^{O(\delta\log\delta)} \cdot n^{O(1)}).

This establishes an XP (slice-wise polynomial) result in δ\delta, subsuming convex representations as the special case δ=0\delta = 0.

4. Constraints of Representation: Convexity and Reflex Angles

Octilinear compaction and realizability are, in general, highly sensitive to angle constraints. The “almost convex” regime is defined precisely as allowing:

  • No internal reflex corners (angles >π> \pi at inner faces).
  • At most four boundary reflex corners on the external face.

Under these constraints, neither octilinear realizability nor compaction admits efficient (polynomial-time) constant-factor approximations. The complexity increases sharply with the number ω\omega of reflex angles. If any internal reflex angles appear, algorithmic treatment requires elaborate “shadow” or “cage” constructions, branching over possible alignments; thus, only fixed-parameter tractable (FPT) solutions in ω\omega are currently known for realizability (Theorem 2 in (Förster et al., 25 Nov 2025)).

The table summarizes the effect of constraints:

Representation Constraint Realizability Complexity Compaction Complexity
All faces strictly convex Polynomial-time (flow) Polynomial-time (flow)
“Almost convex”: ≤4 boundary reflex NP-hard NP-hard, no PTAS
Internal faces non-convex (ϕ1\phi\geq 1) para-NP-hard -

5. Parameterization and Prospects for Efficient Algorithms

Further parameterized complexity results stem from the number of reflex angles (ω\omega) and the number of diagonal segments (δ\delta). Octilinear realizability is FPT in ω\omega, leveraging “shadow graph” structures, entailing O(2ω2)O(2^{\omega^2}) branching on alignment choices (Förster et al., 25 Nov 2025). If internal nonconvexity is allowed (ϕ1\phi\geq 1 face non-convex, up to κ=8\kappa=8 reflex per face), the problems remain para-NP-hard.

For octilinear compaction, the main tractable regime is XP in δ\delta, raising relevant open questions:

  • Whether the XP algorithm for compaction can be elevated to FPT status in δ\delta.
  • The existence of constant-factor approximation algorithms under almost convexity, or possible APX-hardness.
  • Determination of the exact face-reflex threshold κ<8\kappa^* < 8 below which realizability becomes polynomial-time solvable.
  • Extension of combinatorial parameters (e.g., “kitty-corner” counts) familiar from orthogonal compaction to the octilinear paradigm.

6. Open Problems and Future Directions

Research directions prompted by these findings include: precise demarcation of tractability boundaries via parameterization, structural analysis of octilinear representations to identify potential classes admitting efficient compaction, exploration of approximation algorithms under strong convexity constraints, and generalization of orthogonal compaction parameters and techniques to the octilinear setting.

A plausible implication is that resolving whether any constant-factor approximation exists for octilinear compaction under almost convex constraints would have broad impact on the understanding of geometric graph drawing optimization. Further paper into the combinatorics of reflex corners and their structural consequences is likely to illuminate new fixed-parameter tractable cases or hardness thresholds.

For detailed proofs, gadget constructions, and network flow reductions, see the appendices of (Förster et al., 25 Nov 2025).

Definition Search Book Streamline Icon: https://streamlinehq.com
References (1)
Slide Deck Streamline Icon: https://streamlinehq.com

Whiteboard

Forward Email Streamline Icon: https://streamlinehq.com

Follow Topic

Get notified by email when new papers are published related to Octilinear Compaction.