A possible one-liner off the top of my head:
FloydWarshallShortestPaths fwsp = new FloydWarshallShortestPaths(graph);
fwsp.getShortestPath(sourceVertex).stream().filter(path ->
path.getWeight() <= MAX_DISTANCE).collect(Collectors.toList());
Üdvözlettel,
Besenyei Szabolcs
2015-12-05 17:50 GMT+01:00 Sandeep Sas <san...@gm...>:
> Hi,
>
> I am pretty new to jgrapht.
>
> I am looking for a solution to find all nodes, which are less than x units
> away from a particular graph node. I am using jgrapht's
> DefaultDirectedWeightedGraph.
>
> Is there any easy way to perform this using jgrapht library?
>
> Thank you
> Sandeep
>
> DefaultDirectedWeightedGraph <GraphNode,DefaultWeightedEdge> graph = new
> DefaultDirectedWeightedGraph <GraphNode,DefaultWeightedEdge>(DefaultWeightedEdge.class);
>
>
>
> ------------------------------------------------------------------------------
> Go from Idea to Many App Stores Faster with Intel(R) XDK
> Give your users amazing mobile app experiences with Intel(R) XDK.
> Use one codebase in this all-in-one HTML5 development environment.
> Design, debug & build mobile apps & 2D/3D high-impact games for multiple
> OSs.
> http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140
> _______________________________________________
> jgrapht-users mailing list
> jgr...@li...
> https://lists.sourceforge.net/lists/listinfo/jgrapht-users
>
>
|