Re: [jgrapht-users] Question Rearding graph Theory algorithm
Brought to you by:
barak_naveh,
perfecthash
From: Joris K. <de...@gm...> - 2012-09-19 07:41:49
|
Hi, Let s be your initial state node, t your terminal, and u the node you are interested in. If your graph does not contain cycles, you can first compute all unique shortest paths from s to u, then the same for u to t and finally compute the total number of unique paths by combining all possible paths s-u and u-t. Alternatively you could do a Breadth-first search starting from s. Each time you discover node t you can count the number of occurrences of the nodes by counting the predecessors. br, Joris On Thu, Sep 13, 2012 at 10:03 PM, Hicheminfo <lm...@gm...> wrote: > Hi, > I would like to know the algorithm that computes the number of occurrences > of a node in directed graph starting from an initial state to terminal > state. More precisely, the number of paths such node n is included in from > initial state to terminal state considering the paths are simple. > > > > -- > View this message in context: http://jgrapht-users.107614.n3.nabble.com/Question-Rearding-graph-Theory-algorithm-tp4024726.html > Sent from the jgrapht-users mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Got visibility? > Most devs has no idea what their production app looks like. > Find out how fast your code is with AppDynamics Lite. > http://ad.doubleclick.net/clk;262219671;13503038;y? > http://info.appdynamics.com/FreeJavaPerformanceDownload.html > _______________________________________________ > jgrapht-users mailing list > jgr...@li... > https://lists.sourceforge.net/lists/listinfo/jgrapht-users |