Selecting connected sections of graphs

HI,

I have some large directed (left to right) graphs.

I would like to find connected subgraphs, in particular all nodes that point towards a particular node towards the right. (i.e. every node and edge that branches in to a target location, but none that branch out)

Is there an efficient way to do this?

Cheers.

I am assuming by towards

I am assuming by towards the right, you don't mean geometrically, but that you want all nodes that have a directed path to a given node. This can be done using gvpr with the script

BEG_G {
$tvtype = TV_rev;
$tvnext = NULL;
$tvroot = node($,ARGV[0]);
}
N[1]

and the command line

gvpr -atarget_node_name -if pre.g graph.gv

where the file pre.g contains the script given above.

If this isn't exactly what you want, you can probably tailor gvpr to give you what you want.

 

Recent comments