Forum: Ruby #60 Numeric Maze

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Daniel S. (Guest)
on 2006-01-03 05:48
(Received via mailing list)
I used dijkstra again for this quiz, which is fine for the short paths,
but you really need to be pulling out that bitwise magic for those long
paths.

http://members.iinet.net.au/~soxbox/ruby_quiz_60/quiz_60.rb
http://members.iinet.net.au/~soxbox/ruby_quiz_60/dijkstra.rb

That dijkstra.rb is a big improvement over the one I last used in a quiz
(don't remember which one that was). My old library only worked if the
each_neighbours function was symmetrical, and had a bunch of other
inefficiencies. I also included a new SimpleDijkstra module for
situations where distances between nodes are uniform (ie. most of these
types of puzzles).

I also made an implementation using Brian Schroeder's PriorityQueue
library (http://ruby.brian-schroeder.de/priority-queue/), but for some
reason that ended up being even slower. I haven't looked into whether
that was my fault yet, but I'm assuming it is:

http://members.iinet.net.au/~soxbox/ruby_quiz_60/q....
rb




#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared
by NetIQ MailMarshal
#####################################################################################
This topic is locked and can not be replied to.