Skip to content

Commit

Permalink
fix off by one
Browse files Browse the repository at this point in the history
  • Loading branch information
Larry committed Dec 9, 2016
1 parent 4472e50 commit fd4569b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions c/greedy/tsp.dSYM/Contents/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.apple.xcode.dsym.tsp</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>dSYM</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Binary file added c/greedy/tsp.dSYM/Contents/Resources/DWARF/tsp
Binary file not shown.
4 changes: 3 additions & 1 deletion julia/greedy/greedy.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ function tsp(g, n)
path = []
count = 0
dist = 0
for i in 1:n
show = false
for i in 1:n-1
push!(seen, cur)
push!(path, cur)
count += 1
d, cur = get_nearest_unseen(g[cur][2], seen, count, n)
dist += d
show = false
end
println(dist)
println(path)
Expand Down

0 comments on commit fd4569b

Please sign in to comment.