We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dependencies:
pkg> st Status `~/Projekte/Julia/MILP_benchmark/Project.toml` [9961bab8] Cbc v0.8.1 [60bf3e95] GLPK v0.14.12 [4076af6c] JuMP v0.21.10
Code
using JuMP import Cbc function example_transp(factory) ORIG = ["GARY", "CLEV", "PITT"] DEST = ["FRA", "DET", "LAN", "WIN", "STL", "FRE", "LAF"] supply = [1_400, 2_600, 2_900] demand = [900, 1_200, 600, 400, 1_700, 1_100, 1_000] cost = [ 39 14 11 14 16 82 8 27 9 12 9 26 95 17 24 14 17 13 28 99 20 ] model = Model(factory) set_silent(model) @variable(model, trans[1:length(ORIG), 1:length(DEST)] >= 0) @objective( model, Min, sum( cost[i, j] * trans[i, j] for i in 1:length(ORIG), j in 1:length(DEST) ) ) @constraints( model, begin [i in 1:length(ORIG)], sum(trans[i, :]) == supply[i] [j in 1:length(DEST)], sum(trans[:, j]) == demand[j] end ) optimize!(model) if termination_status(model) == MOI.OPTIMAL println("transp ",solver_name(model)," ", solve_time(model)) else println("transp ",solver_name(model)," failed") end return end example_transp(with_optimizer(Cbc.Optimizer, logLevel = 0))
This outputs:
Presolve 10 (0) rows, 21 (0) columns and 42 (0) elements 0 Obj 0 Primal inf 13800 (10) 13 Obj 196200 Optimal - objective value 196200 Optimal objective 196200 - 13 iterations time 0.002 transp COIN Branch-and-Cut (Cbc) 0.000453948974609375
when i only expected the last line.
The text was updated successfully, but these errors were encountered:
Closing as duplicate of #168
Sorry, something went wrong.
No branches or pull requests
Dependencies:
Code
This outputs:
when i only expected the last line.
The text was updated successfully, but these errors were encountered: