FloydWarshall Algorithm

45 views
Skip to first unread message

sudhir...@gmail.com

unread,
Mar 31, 2015, 11:00:01 AM3/31/15
to grph-high-performa...@googlegroups.com, Sudhir Kylasa
Hi,

I need the (shortest) paths for Floyd Warshall's algorithm. In the javadoc, I notice that there is a method which returns the distanceMatrix for this algorithm, but there is not such matrix which computes the Paths between a given pair of nodes.

For my work, I need a database of Paths between any given pairs of nodes. I use this database of paths for my computations.

Is there a way to do this in Grph library.

Thanks
Sudhir Kylasa
PhD Student @ Purdue University.

Luc Hogie

unread,
Apr 3, 2015, 9:32:43 AM4/3/15
to sudhir...@gmail.com, grph-high-performa...@googlegroups.com, Sudhir Kylasa

The package grph.algo.distance features the class FloydWarshallAlgorithm which does what you want. Keep in mind that this operation is cumbersome and hence will have poor performance on large graphs.




--
You received this message because you are subscribed to the Google Groups "Grph: High Performance Graph Library for Java" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grph-high-performance-gr...@googlegroups.com.
To post to this group, send an email to grph-high-performa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Luc Hogie 

Phone: 06 80 91 40 71

Skype: luchogie


"Je suis heureux parce que c'est bon pour la santé" Voltaire


sudhir...@gmail.com

unread,
Apr 8, 2015, 3:17:13 PM4/8/15
to grph-high-performa...@googlegroups.com, sudhir...@gmail.com, kyl...@gmail.com
Hi,

I tried to compute all pairs shortest paths as follows:

FloydWarshallAlgorithm alg = new FloydWarshallAlgorithm(new SimpleEdgeIncidenceList());
DistanceMatrix allPaths = alg.compute(g);

But this code is not working. All the paths are negative for some reason.

My graph is an undirected graph, with no edge weights. I use number of hops as the distance between two nodes.

Can you please help me compute this ?
I am nearing a research publication deadline... Fast response is really appreciated.

Thanks
Sudhir Kylasa
Reply all
Reply to author
Forward
0 new messages