Works

グラフ探索のメモ

グラフ探索のメモ

迷路を最短で解くなら BFS。 コストがあるなら Dijkstra。

  • BFS: 近い順に広げる
  • Dijkstra: コスト最小
  • A*: 目的地があるとき強い
const q = [start];