Anonymous user
Transportation problem: Difference between revisions
→{{header|Julia}}: swap optimizers: GLPK for Ipopt (produces integer solutions)
(→{{header|R}}: fix double output line) |
(→{{header|Julia}}: swap optimizers: GLPK for Ipopt (produces integer solutions)) |
||
Line 2,496:
=={{header|Julia}}==
Code taken from [https://github.com/dylanomics/transportation_problem here] using [https://jump.dev/JuMP.jl/stable/ JuMP].
<lang julia>using JuMP,
# cost vector
Line 2,512:
# construct model
model = Model(
@variable(model, x[i=1:N] >= 0, base_name="traded quantities")
cost_fn = @expression(model, c'*x) # cost function
Line 2,531:
{{out}}
<pre>solution vector of quantities = [20.
minimum total cost =
=={{header|Kotlin}}==
|