Skip to content

ecoologic/ruby-dijkstra-for-readability

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dijkstra's shortest path algorithm

A Ruby implementation to understand the Dijkstra algorithm.

Dijkstra is an algorithm for finding the shortest paths between nodes in a graph.

  • Written in Ruby
  • Written for Readability
  • Written in an Object Oriented style
  • Loosely Tested with RSpec (more specs in another project)

Tested using the Kiwiland Railway exercise (Kaitaia / Invercargill). Can be used to solve:

  1. The length of the shortest route (in terms of distance to travel) from A to C.
  2. The length of the shortest route (in terms of distance to travel) from B to B.

See my solution here for the complete exercise.

Requirements

  • Ruby 2.3.1
  • Bundler Gem

Install

bundle
bundle exec rspec dijkstra.rb --color --format d

About

Dijkstras Shortest weighted path, written in Ruby, with an enphasis on *Readability* and Object Oriented Programming

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages