Skip to content

Commit

Permalink
update readme and makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
bradyz committed May 12, 2016
1 parent d324bd6 commit 11ac38d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ruby/greedy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
TSP_FILE_PATH=../../cpp/greedy/a280.tsp

run:
ruby tsp.rb < $(TSP_FILE_PATH)
4 changes: 4 additions & 0 deletions ruby/greedy/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ Reads from stdin, output to stdout

usage:
ruby tsp.rb < a280.tsp

or

TSP_FILE_PATH="/path/to/data.tsp" make run
3 changes: 2 additions & 1 deletion ruby/greedy/tsp.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,9 @@ def main()
total += Math.sqrt(dist(u, v))
end

puts solution.length
puts "Path: "
puts solution
puts "Path Cost: "
puts total
end

Expand Down

0 comments on commit 11ac38d

Please sign in to comment.