-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.jl
More file actions
117 lines (92 loc) · 3.03 KB
/
Copy pathsetup.jl
File metadata and controls
117 lines (92 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
#!/usr/bin/env julia
"""
TSP Solver Setup Script
========================
This script installs all required Julia packages and provides instructions for
installing external binaries (Concorde, LKH).
Run with: julia setup.jl
"""
using Pkg
println("="^60)
println("TSP Solver Suite - Setup Script")
println("="^60)
# Activate the project in the current directory
Pkg.activate(".")
println("\n[*] Installing Julia packages...\n")
# Core dependencies (Concorde is called via CLI, not as a Julia package)
packages = [
"TSPLIB", # TSPLIB instance loader
"Statistics", # Basic statistics (stdlib)
"Random", # Random number generation (stdlib)
"JuMP", # Mathematical optimization modeling
"HiGHS", # Open-source linear/integer programming solver
"LKH", # Lin-Kernighan Heuristic wrapper
"Hygese", # HGS-CVRP solver
"TravelingSalesmanHeuristics", # Classical TSP heuristics
"Metaheuristics", # Metaheuristic algorithms
]
for pkg in packages
println(" [+] Installing $pkg...")
try
Pkg.add(pkg)
println(" [OK] $pkg installed successfully")
catch e
println(" [WARN] Failed to install $pkg: $e")
end
end
println("\n[*] Instantiating project dependencies...")
Pkg.instantiate()
println("\n[*] Building LKH...")
try
Pkg.build("LKH")
println(" [OK] LKH built successfully")
catch e
println(" [WARN] LKH build failed: $e")
println(" See DEVELOPMENT.md for manual installation instructions")
end
println("\n" * "="^60)
println("External Binary Installation")
println("="^60)
# Check if Concorde is installed
concorde_path = expanduser("~/.local/bin/concorde")
concorde_in_path = try
!isempty(strip(read(`which concorde`, String)))
catch
false
end
if isfile(concorde_path) || concorde_in_path
println("\n[OK] Concorde binary found!")
else
println("""
[WARN] CONCORDE TSP Solver NOT FOUND
--------------------------------
Concorde is required for optimal TSP solutions on larger instances.
Quick Install (Linux x86_64):
wget http://www.math.uwaterloo.ca/tsp/concorde/downloads/codes/linux24/concorde.gz
gunzip concorde.gz
chmod +x concorde
mv concorde ~/.local/bin/
Download page: http://www.math.uwaterloo.ca/tsp/concorde/downloads/downloads.htm
""")
end
println("""
Additional Notes:
-----------------
* HiGHS (ILP solver) is included via Julia package - no manual install needed
* For better ILP performance, consider installing Gurobi: Pkg.add("Gurobi") + a Gurobi License
* LKH.jl automatically downloads and builds LKH-3
""")
println("="^60)
println("[OK] Setup Complete!")
println("="^60)
println("""
Next steps:
1. Test the installation:
julia --project=. main.jl
2. Run a quick test in Julia REPL:
julia> include("main.jl")
julia> test_single("burma14")
3. Run the full benchmark:
julia> benchmark(use_concorde=true, use_lkh=true)
4. See DEVELOPMENT.md for detailed usage instructions.
""")