solveByString method

Path solveByString(
  1. String start,
  2. String destination
)

Finds vertices by their strings and uses these to find the shortest path in between them.

Implementation

Path solveByString(String start, String destination) {
  Vertex starting = graph.keys.firstWhere((element) => element.id == start);
  Vertex end = graph.keys.firstWhere((element) => element.id == destination);
  return solve(starting, end);
}