A hierarchical orderly layout algorithm based on channel points

Yi Kun Zhang, Kai bao Hu, Xin Hong Hei, Ming Zhao, Ming Hui Zhang, Hao Chen2013

Abstract

Since the conventional hierarchical layout algorithm has the disadvantage of wiring chaos in large programs, this paper proposes a hierarchical orderly layout algorithm based on channel points. By dynamically adjusting the number of channel points on each node according to program size, the algorithm solves overlap problems during wiring. Combined with a generalized tensor balance approach to reduce crossings and realize an aesthetic layout, the algorithm provides a routing strategy based on the relative positional relationship between calling nodes. Experimental results demonstrate that the algorithm effectively reduces crossings, improves layout clarity, and maintains high efficiency.

Introduction

Visualizing large-scale software architectures, such as module call graphs and class hierarchies, is critical for system maintenance and debugging. The industry standard for hierarchical graphs is the Sugiyama layout algorithm. However, as software complexity grows, the Sugiyama method often results in "wiring chaos"—a state where edges overlap excessively and cluster into unreadable patterns. While "virtual nodes" are often used to manage long-distance connections, they introduce significant computational overhead and frequently lead to unbalanced diagrams. This paper introduces an enhanced approach that replaces messy routing with structured "channel points."

The Proposed Algorithm

The proposed method builds upon the Sugiyama framework but introduces a more structured, four-step process to ensure orderliness and symmetry.

Figure 1: Flowchart of the proposed hierarchical orderly layout algorithm.
  1. Node Level Specification: Nodes are assigned to layers based on their hierarchical call relationships.
  2. Node Sorting (Generalized Tensor Balance): To improve symmetry, nodes with high correlation are placed toward the center of a layer, while less-related nodes are moved toward the edges.
  3. Channel Point Specification: Instead of arbitrary connection points, the algorithm defines specific "ports" or channel points on each node.
  4. Physical Coordinate Calculation & Routing: A specific routing logic assigns lines to idle channel points based on the node's position relative to the layer center.

Dynamic Channel Point Scaling

The core innovation of this research is the dynamic adjustment of channel points based on the total number of nodes in the program. A "one size fits all" approach to node ports fails in high-density graphs. By scaling the available "bandwidth" for connections, the algorithm ensures that even complex nodes can be wired without overlap.

Figure 2: Dynamic adjustment of channel points based on program size (A: <120 nodes, B: 120-500 nodes, C: >500 nodes).

As shown in Figure 2, the number of points increases with program size:

  • Small programs (<120 nodes): 5 points per node.
  • Medium programs (120–500 nodes): 8 points per node.
  • Large programs (>500 nodes): 15 points per node.

Key Insights and Results

By moving beyond the traditional reliance on virtual nodes, the algorithm achieves a much "lighter" and more efficient layout process. The use of a "tensor balance" approach ensures that the resulting graphs follow aesthetic standards of symmetry, which is vital for human understandability.

Qualitative comparisons show that in high-complexity scenarios—such as a node with 13 distinct call relationships—the proposed layout prevents the "spaghetti" effect. By assigning lines to specific idle ("i") or occupied ("u") channel points based on whether a node sits to the left or right of the layer center, the algorithm ensures that cross-layer connections do not tangle or cross the entire width of the graph unnecessarily.

Conclusion and Future Work

The hierarchical orderly layout algorithm based on channel points offers a significant improvement in the visualization of large software systems. It reduces the overhead of virtual node generation and provides a clearer, more symmetrical output. Future work should focus on formal computational complexity analysis and user studies to quantify the speed at which developers can navigate these improved diagrams compared to traditional layout engines.

Summary updated

Abstract

Since the conventional hierarchical layout algorithm has the disadvantage of wiring chaos in large programs, so on the basis of Sugiyama layout algorithm, this paper proposes a hierarchical orderly layout algorithm based on channel points. Adjust the number of each node in the channel dynamically according to program size in order to solve the existing algorithm's overlap problems when wiring lines, Combine the generalized tensor balance idea in layout diagram to reduce cross and realize the artistic layout, the algorithm also give the corresponding line distribution and application strategy in accordance with the relative positional relationship between the calling nodes to achieve the routing orderly. Experiment results show that the algorithm has good layout efficiency. It can reduce the crossings effectively, be realized layout clearly and be implemented simply.
BibTeX
@misc{zhang2013hierarchical,
  author = {Yi Kun Zhang and Kai bao Hu and Xin Hong Hei and Ming Zhao and Ming Hui Zhang and Hao Chen},
  title = {{A hierarchical orderly layout algorithm based on channel points}},
  year = {2013},
  doi = {10.2991/icacsei.2013.27},
}

Loading related content...

Figure