From: Peter Burns Date: 2006-01-01T21:28:43+09:00 Subject: Re: Numeric Maze (#60) I'm still doing this in far too much of a brute force sort of method. I think tomorrow I'll work more towards optimizing with some sneaky math. One advantage of brute force is that, if you do it right, you can be sure that you're getting a shortest path. I've found a couple of shorter paths from Steve's, but I can't deal at all with his bigger test cases. Current progress: ~/Documents/Projects/ruby_quiz peter$ ruby 60.rb Loaded suite 60 Started .......E......E.E.E.E...... Better solution found: [300, 150, 152, 76, 38, 40, 20, 10, 12, 6, 8, 4, 2] [300, 150, 152, 76, 38, 40, 20, 10, 12, 14, 16, 8, 4, 2] ......E......E.................E.E...................E..................E....................E...................E................... Better solution found: [900, 450, 452, 226, 228, 114, 116, 58, 60, 30, 32, 16, 8] [900, 902, 904, 452, 226, 228, 114, 116, 58, 60, 30, 32, 16, 8] ....................E...............................................................................................................EEEEEEEEE.EEEEEEEEEE.EEEEEEEEEE.EEEEEEEEEE..EEEEEEEEEE.EEEEEEEEEE.EEEEEEEEEE.EEEEEEEEEE.EEEEEEEEEE.EEEEEEEEEE.E................................................................................ Finished in 434.789958 seconds. 1) Error: test_case_104(TestNumericMaze): RuntimeError: Too Slow [snip...] 483 tests, 738 assertions, 0 failures, 114 errors I'm having my solve method throw an error when it is taking too long to evaluate to more easily distinguish giving an invalid result from just taking too long. Slightly updated test suite: http://rafb.net/paste/results/SKaTxv60.nln.html