elfs: (Default)
[personal profile] elfs
My current work assignment involves dynamically rendering a directed graph with potentially both cycles and disconnects. A "graph" in this case is a mathematical construct of nodes and connectors; "directed" means the connectors go in one direction, from one node to another. A "disconnected" graph means there may be subgraphs for which one cannot, starting from an arbitrary node, traverse the list of nodes to reach another arbitrary node; there isn't a connector between the two subgraphs. A graph with "cycles" is one where it's possible to end up in a loop, going around and around and around.

Drawing this beast on the screen aesthetically is considered a Hard Problem, but fortunately, there are a number of papers on it with "good enough" solutions. The best seems to be Alaa K. Ismaeel's Dynamic Hierarchical Graph Drawing.

According to the book, there are a few steps one must take: (1) figure out all of the disconnected subgraphs; (2) figure out if any of the subgraphs have cycles; (3) break the cycles, but remember what you broke so you can put it back; (4) figure out at what "depth" each node should be; (5) re-arrange the nodes such that you minimize the number of connectors that "cross" each other; (6) lay out the nodes with enough distance between them. I'm up to (3), and even managed to get it to successfully and correctly break the cycles in a Petersen Graph without damaging the graph's internal logic.

Man, that was fun. Well, on to the rest of it tomorrow.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

Profile

elfs: (Default)
Elf Sternberg

March 2026

S M T W T F S
1234567
8910111213 14
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 29th, 2026 09:07 am
Powered by Dreamwidth Studios