message: FEAT: Check all paths from a for astar
diff: @@ -382,6 +382,7 @@ fn test_astar_manhattan_heuristic() {
  let d = g.add_node((0., 2.));
  let e = g.add_node((3., 3.));
  let f = g.add_node((4., 2.));
  + let _ = g.add_node((5., 5.)); // no path to node
  g.add_edge(a, b, 2.);
  g.add_edge(a, d, 4.);
  g.add_edge(b, c, 1.);
  @@ -390,19 +391,28 @@ fn test_astar_manhattan_heuristic() {
  g.add_edge(e, f, 1.);
  g.add_edge(d, e, 1.);
  - let path = astar(&g, a, |finish| finish == f, |e| *e.weight(),
  - |node| {
  + let heuristic_for = |f: NodeIndex| {
  + let g = &g;
  + move |node: NodeIndex| -> f32 {
  let (x1, y1): (f32, f32) = g[node];
  let (x2, y2): (f32, f32) = g[f];
  (x2 - x1).abs() + (y2 - y1).abs()
  - });
  + }
  + };
  + let path = astar(&g, a, |finish| finish == f, |e| *e.weight(), heuristic_for(f));
  assert_eq!(path, Some((6., vec![a, d, e, f])));
  // check against dijkstra
  - let dijkstra_run = dijkstra(&g, a, Some(f), |e| *e.weight());
  - assert_eq!(dijkstra_run[&f], 6.);
  + let dijkstra_run = dijkstra(&g, a, None, |e| *e.weight());
  +
  + for end in g.node_indices() {
  + let astar_path = astar(&g, a, |finish| finish == end, |e| *e.weight(),
  + heuristic_for(end));
  + assert_eq!(dijkstra_run.get(&end).cloned(),
  + astar_path.map(|t| t.0));
  + }
  }
  #[cfg(feature = "generate")]
  