mirror of
https://github.com/tgorordo/titanic.caltech.edu.git
synced 2026-06-05 14:52:15 -07:00
tidy
This commit is contained in:
parent
98da744bf0
commit
0cee74ff54
3 changed files with 6 additions and 19 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -1 +1,4 @@
|
||||||
index.html
|
index.html
|
||||||
|
LAVegas.osm
|
||||||
|
traveling-tommys.html
|
||||||
|
traveling-tommys.pdf
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -202,7 +202,8 @@ function build_tsp_model(m)
|
||||||
model = Model(GLPK.Optimizer)
|
model = Model(GLPK.Optimizer)
|
||||||
@variable(model, x[1:n, 1:n], Bin, Symmetric)
|
@variable(model, x[1:n, 1:n], Bin, Symmetric)
|
||||||
@objective(model, Min, sum(m .* x) / 2)
|
@objective(model, Min, sum(m .* x) / 2)
|
||||||
@constraint(model, [i in 1:n], sum(x[i, :]) == 2)
|
@constraint(model, [i in 1:n], sum(x[i, [j for j in 1:n if j != i]]) == 1)
|
||||||
|
@constraint(model, [j in 1:n], sum(x[[i for i in 1:n if i != j], j]) == 1)
|
||||||
@constraint(model, [i in 1:n], x[i, i] == 0.)
|
@constraint(model, [i in 1:n], x[i, i] == 0.)
|
||||||
return model
|
return model
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue