From: erg Date: Thu, 1 Apr 2010 01:17:44 +0000 (+0000) Subject: Fix for bug 1911 X-Git-Tag: LAST_LIBGRAPH~32^2~1372 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e62b5944493f98d9cbea6e400f09e31287ac5a9b;p=graphviz Fix for bug 1911 --- diff --git a/lib/circogen/blocktree.c b/lib/circogen/blocktree.c index 6f303b2cf..60f0aa5f4 100644 --- a/lib/circogen/blocktree.c +++ b/lib/circogen/blocktree.c @@ -80,6 +80,20 @@ pop (estack* s) } +/* dfs: + * + * Current scheme adds articulation point to first non-trivial child + * block. If none exists, it will be added to its parent's block, if + * non-trivial, or else given its own block. + * + * FIX: + * This should be modified to: + * - allow user to specify which block gets a node, perhaps on per-node basis. + * - if an articulation point is not used in one of its non-trivial blocks, + * dummy edges should be added to preserve biconnectivity + * - turn on user-supplied blocks. + * - Post-process to move articulation point to largest block + */ static void dfs(Agraph_t * g, Agnode_t * u, circ_state * state, int isRoot, estack* stk) { Agedge_t *e; @@ -96,7 +110,7 @@ static void dfs(Agraph_t * g, Agnode_t * u, circ_state * state, int isRoot, esta if (!EDGEORDER(e)) EDGEORDER(e) = 1; } - if (VAL(v) == 0) { + if (VAL(v) == 0) { /* Since VAL(root) == 0, it gets treated as artificial cut point */ PARENT(v) = u; push(stk, e); dfs(g, v, state, 0, stk); @@ -118,7 +132,7 @@ static void dfs(Agraph_t * g, Agnode_t * u, circ_state * state, int isRoot, esta } } while (ep != e); if (block) { /* If block != NULL, it's not empty */ - if (blockSize (block) > 1) + if (!BLOCK(u) && blockSize (block) > 1) addNode(block, u); if (isRoot && (BLOCK(u) == block)) insertBlock(&state->bl, block);