Does anyone know if the Java Jung2 graph library provides the in-built capability to traverse a Digraph (directed graph) given a start Vector? I did see that there's a
BFSDistanceLabeler class that returns a map of distances, which could do, but I then need to sort the values (highest distance first) and iterate through the sorted set.
I'm not sure what you mean by "traverse a digraph given a start vector". If you want to do a topological sort of a graph and then iterate through the vertices in that order, that's pretty easy:
(1) Calculate the breadth-first distances using BFSDistanceLabeler.
(2) Create a
Comparator for vertices that is aware of those distances (it will need to look up the distance for a vertex in the BFSDL data).
(3) Get the collection of vertices from the graph and sort it using that