1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

迷路を作って解くJava実装

Last updated at Posted at 2019-03-02

本文

  • やったこと:Javaで迷路を作り、到達可能か求める(深さ優先探索 DFS)、または最短経路を求める(幅優先探索 BFS)
  • ソース => GitHub
  • 実行結果 => Ideone
  • その他の入力例 => README

実行時の注意

  • 6つの引数が必須、順番は固定
  • -debugで迷路・経路を標準出力に書き込める
    • ただし出力量制限はない
    • 小さい迷路から大きな迷路へ、どのくらい表示できるか確認しながら出力した方がいい
  • -debugの代わりに-no-denugとか適当に入れれば標準出力OFFになる
  • 大きさは2501*2501を超えた辺りから、生成の実行時間が長くてつらい
  • 4つ目の引数circuitsに大きな数字を入れると、生成の実行時間が長くてやっぱりつらい
    • 100000とか無理

雑感

  • 迷路を作る実装はレアかも
  • 1.最短距離と2.書き換えた経路の両方を返す方が好ましいが、面倒なのでやってない

Hope this helps.

1
0
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?