Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Hierarchical layout (Sugiyama method)

Open
#4 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
rust

Research direction

No implementation files or tests are named. Start by reviewing the linked Graphviz and layered graph drawing references, then map the four required Sugiyama stages and the listed cluster, loop, multi-edge, component, and rank constraints onto the renderer. Done means hierarchical layouts support those stages, rankdir, spacing, and the stated special cases.

Written by the indexing model from the issue text.

Description

enhancement

Directed graphs need a hierarchical/layered layout, which is what Graphviz's `dot` engine produces. This is the Sugiyama method, consisting of four sub-steps.

First, cycle removal via DFS to identify and reverse back edges, storing a `reversed` flag so rendering can restore the original direction. Second, layer assignment using longest-path layering, which assigns each node to a rank. Edges spanning multiple layers get virtual (dummy) nodes inserted so every edge spans exactly one layer; these become bend points in the final rendering. Third, crossing minimization using the barycenter heuristic with alternating sweeps (~24 passes) to reduce edge crossings between adjacent layers. Fourth, coordinate assignment using a simplified Brandes-Kopf approach, spacing nodes within layers by `nodesep` (default 72pt) and layers by `ranksep` (default 36pt). The `rankdir` attribute (TB/BT/LR/RL) is handled by swapping axis semantics.

Cluster handling requires constraining cluster nodes to contiguous positions within their layers, then computing cluster bounding boxes after coordinate assignment. Special cases include self-loops (excluded from layering, rendered as curved paths), multi-edges, disconnected components (laid out independently then composed), and the `rank` attribute for same/min/max/source/sink constraints.

References

Dominant language
Rust
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from terror/dotgraph

All issues in terror/dotgraph

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.