Skip to content

Commit

Permalink
Prevent exponential growth of length of edges in clusters
Browse files Browse the repository at this point in the history
`edgelabel_ranks` gets called for the root graph and all of its cluster
subgraphs. It should only double `ED_minlen` for each edge once. Reverting the
test for labeled edges to check only the active graph, rather than its root,
prevents it from expanding the `minlen` once for every level of cluster
containing the edge.

Fixes ellson#1246
  • Loading branch information
iamthad committed Mar 23, 2018
1 parent fc7a0ca commit b3e8099
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/dotgen/rank.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ edgelabel_ranks(graph_t * g)
node_t *n;
edge_t *e;

if (GD_has_labels(g->root) & EDGE_LABEL) {
if (GD_has_labels(g) & EDGE_LABEL) {
for (n = agfstnode(g); n; n = agnxtnode(g, n))
for (e = agfstout(g, n); e; e = agnxtout(g, e))
ED_minlen(e) *= 2;
Expand Down

0 comments on commit b3e8099

Please sign in to comment.