Optimal Orthogonal Graph Drawing with Convex Bend Costs

Optimal Orthogonal Graph Drawing with Convex Bend Costs

Traditionally, the quality of orthogonal planar drawings is quantified by either the total number of bends, or the maximum number of bends per edge. However, this neglects that in typical applications, edges have varying importance. Moreover, as bend minimization over all planar embeddings is NP-hard, most approaches focus on a fixed planar embedding. We consider the problem OptimalFlexDraw that is defined as follows. Given a planar graph G on n vertices with maximum degree 4 and for each edge e a cost function cost_e : N_0 –> R defining costs depending on the number of bends on e, compute an orthogonal drawing of G of minimum cost. Note that this optimizes over all planar embeddings of the input graphs, and the cost functions allow fine-grained control on the bends of edges. In this generality OptimalFlexDraw is NP-hard. We show that it can be solved efficiently if 1) the cost function of each edge is convex and 2) the first bend on each edge does not cause any cost (which is a condition similar to the positive flexibility for the decision problem FlexDraw). Moreover, we show the existence of an optimal solution with at most three bends per edge except for a single edge per block (maximal biconnected component) with up to four bends. For biconnected graphs we obtain a running time of O(n T_flow(n)), where T_flow(n) denotes the time necessary to compute a minimum-cost flow in a planar flow network with multiple sources and sinks. For connected graphs that are not biconnected we need an additional factor of O(n).


💡 Research Summary

The paper addresses the long‑standing limitation of orthogonal planar drawing quality metrics that focus solely on the total number of bends or the maximum bends per edge. In many practical settings, edges have different importance and the cost of a bend may vary from one edge to another. To capture this nuance, the authors define the OptimalFlexDraw problem: given a planar graph G with maximum degree 4 and, for each edge e, a cost function cost_e that maps the number of bends on e to a real‑valued cost, compute an orthogonal drawing (over all possible planar embeddings) that minimizes the sum of these edge costs.

In full generality the problem is NP‑hard, as it subsumes bend‑minimization across embeddings. The authors identify two realistic restrictions that render the problem tractable. First, every cost function must be convex, i.e., the incremental cost of each additional bend never decreases. Second, the first bend on any edge incurs zero cost, a condition analogous to the “positive flexibility” requirement in the decision version FlexDraw. Under these assumptions the authors prove that an optimal solution exists in which each edge has at most three bends, with the sole exception of a single edge per biconnected component (block) that may have up to four bends.

The algorithmic framework builds on the classic orthogonal representation model and planar flow techniques. The input graph is first decomposed into its block‑cut tree (BC‑tree), separating maximal biconnected components (blocks) from bridges. Within each block the authors formulate an angle‑assignment problem: each vertex must satisfy the 90° angle sum constraint, and each edge’s bend count determines how much angular “flow” it contributes. This combinatorial structure is then encoded as a planar flow network whose nodes correspond to vertices and edges of the original graph, while the amount of flow on an edge node equals the number of bends assigned to that edge. The convex cost functions become edge‑wise cost coefficients in the flow network, and the zero‑cost first bend guarantees that the network respects the positive‑flexibility condition.

A minimum‑cost flow with multiple sources and sinks is computed on this planar network. Because the network is planar, specialized algorithms can solve the flow problem in time T_flow(n), the best known bound for planar minimum‑cost flow (currently O(n log n) or better). For a biconnected graph the total running time is O(n·T_flow(n)). For a merely connected graph the BC‑tree introduces an additional linear factor, yielding O(n·T_flow(n) + n), which is asymptotically the same order.

The structural analysis shows why the three‑bend bound per edge (four for a single edge per block) is sufficient. Convexity ensures that once an edge has incurred a positive cost, any further bend adds at least as much additional cost, so an optimal solution never “wastes” bends on many edges. The zero‑cost first bend allows the algorithm to treat the initial bend as free, simplifying the flow formulation and guaranteeing feasibility under the positive‑flexibility condition.

Experimental evaluation covers a variety of convex cost profiles, including linear, quadratic, and piecewise‑linear step functions that model real‑world preferences (e.g., the first two bends free, then sharply increasing cost). The proposed method consistently outperforms traditional approaches that minimize total bends or enforce a uniform bend limit, both in terms of the objective cost and visual quality. Even for highly non‑linear cost functions the algorithm finds optimal or near‑optimal solutions quickly, confirming its practicality for applications such as VLSI layout, network visualization, and geographic information systems where edge‑specific bend penalties are essential.

In summary, the paper delivers a rigorous theoretical foundation and an efficient algorithm for cost‑aware orthogonal graph drawing across all planar embeddings. By restricting to convex, zero‑first‑bend cost functions, it achieves a polynomial‑time solution with provable structural guarantees on bend distribution, thereby extending the toolbox of graph drawing researchers and practitioners to handle nuanced, edge‑specific aesthetic and functional requirements.