]> git.scottworley.com Git - slidingtile/blobdiff - sliding_tile.cc
Bound the frontier. I.e., do beam search.
[slidingtile] / sliding_tile.cc
index cfa7425b72964340748900700cbc3199587842a2..2b7f31a64d88e49cb645e82353f2a446896eafc5 100644 (file)
@@ -5,8 +5,9 @@
 
 DEFINE_string(start, "", "The starting tile positions.  0 is the hole.");
 DEFINE_string(goal, "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,0", "The desired tile positions.  0 is the hole.");
+DEFINE_int32(max_frontier, 100000, "The maximum frontier size.  Larger values run longer and give shorter paths.");
 
 int main(int argc, char** argv) {
   gflags::ParseCommandLineFlags(&argc, &argv, false);
-  std::cout << *find_path(FLAGS_start, FLAGS_goal);
+  std::cout << *find_path(FLAGS_start, FLAGS_goal, FLAGS_max_frontier);
 }