Or highlight with red color their edges or nodes somehow to notice them easily on huge graph?
For example, here I need nodes:
10-11-12
7-7
or at least the whole chain (9-10-11-12-13-14 and 5-6-7-8), because I have many such chains without cycles in a large graph and a few chains with cycles and want to find them quickly.
Here is a hacked version of the cycle (gvpr) program (written by Emden?) that comes with the Graphviz source.
Save it in a file named cycleColor.gvpr and use it like so: gvpr -cf cycleColor.gvpr myFile.gv >mybetterFile.gv
cycleColor:
/*
a hacked version of the "cycle" gvpr program found in the Graphviz source
Detect directed cycles
*/
BEG_G{
int cnt, i;
node_t tp, hp;
node_t stack[node_t];
edge_t anEdge;
string Tail[], Head[];
$tvtype = TV_prepostfwd;
$tvroot = fstnode($);
}
N {
if (stack[$]) {
stack[$] = NULL;
} else if ($tvedge == NULL) { /* current root */
stack[$] = $;
} else {
stack[$] = $tvedge.tail;
}
}
E {
if (stack[$.head]) {
tp = $.tail;
hp = $.head;
$.color="red";
tp.color="green";
while (tp != $.head) {
tp.color="green";
hp.color="green";
hp = tp;
tp = stack[tp];
anEdge=isEdge(tp, hp, "");
anEdge.color="red";
}
}
}
Somebody should make an AI assistant that can help people to do all these useful things, just using natural language, and some kind of nice display front end probably d3-graphviz.