2

I'm trying to find/create an algorithm to find the least number of edges to traverse to, to get to a vertex.

I am using a SimpleDirectedWeightedGraph, but I don't want to use Dijkstra's algorithm because I want to omit the weights doing this.

Is there a built in method/class that can help me do this, or an algorithm I can use?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
madcrazydrumma
  • 1,847
  • 3
  • 20
  • 38
  • 1
    If the weights are ignored, the shortest path (in terms of number of edges) can be found using BFS. See this answer [JGraphT - apply BFS to WeightedGraph](https://stackoverflow.com/questions/32935692/jgrapht-apply-bfs-to-weightedgraph) – f9c69e9781fa194211448473495534 Dec 20 '20 at 13:33

0 Answers0