/** * Returns the ordered list of vertices traversed for a path defined by the given start and end vertices. If no path exists, an empty colleciton * is returned. * * @param graph the graph to search * @param start the starting vertex * @param end the ending vertex * @return the ordered collection of vertices or an empty collection if no path exists */ private List<Vertex<T>> getPath(DirectedGraph<T> graph, Vertex<T> start, Vertex<T> end) { List<Vertex<T>> path = traverser.traversePath(graph, start, end); // reverse the order to it goes from source to end destination Collections.reverse(path); return path; }
/** * Returns the ordered list of vertices traversed for a path defined by the given start and end vertices. If no path exists, an empty colleciton * is returned. * * @param graph the graph to search * @param start the starting vertex * @param end the ending vertex * @return the ordered collection of vertices or an empty collection if no path exists */ private List<Vertex<T>> getPath(DirectedGraph<T> graph, Vertex<T> start, Vertex<T> end) { List<Vertex<T>> path = traverser.traversePath(graph, start, end); // reverse the order to it goes from source to end destination Collections.reverse(path); return path; }
/** * Returns the ordered list of vertices traversed for a path defined by the given start and end vertices. If no path exists, an empty colleciton * is returned. * * @param graph the graph to search * @param start the starting vertex * @param end the ending vertex * @return the ordered collection of vertices or an empty collection if no path exists */ private List<Vertex<T>> getPath(DirectedGraph<T> graph, Vertex<T> start, Vertex<T> end) { List<Vertex<T>> path = traverser.traversePath(graph, start, end); // reverse the order to it goes from source to end destination Collections.reverse(path); return path; }