Skip to content

Instantly share code, notes, and snippets.

@yeesian
Created March 20, 2018 22:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yeesian/63a25a84fd48da041d653a6f95935347 to your computer and use it in GitHub Desktop.
Save yeesian/63a25a84fd48da041d653a6f95935347 to your computer and use it in GitHub Desktop.
Mitsubishi Report LP versus IP experiment
using Base.Test, SchedulingModels, JuMP, Gurobi
np = SchedulingModels.readnetwork("config/multiline-arrivals3.json")
# Integer Optimization based on Arrival Model
model = arrivalmodel(np, ScheduleOptions(), solver=Gurobi.GurobiSolver(TimeLimit=1000))
@time status = JuMP.solve(model.model)
# ...
# 1368 1076 151569.952 38 315 199238.000 151569.952 23.9% 97.3 984s
# 1370 1077 181092.352 210 319 199238.000 151578.308 23.9% 97.1 985s
# H 1374 1016 199193.00000 151595.802 23.9% 96.8 994s
# 1377 1018 151600.349 85 316 199193.000 151600.349 23.9% 96.6 995s
# Cutting planes:
# Gomory: 7
# MIR: 1868
# Flow cover: 1881
# Explored 1382 nodes (374250 simplex iterations) in 1000.03 seconds
# Thread count was 4 (of 4 available processors)
# Solution count 10: 199193 199238 199643 ... 212865
# Time limit reached
# Best objective 1.991930000000e+05, best bound 1.516027781081e+05, gap 23.8915%
# WARNING: Not solved to optimality, status: UserLimit
# 1000.125847 seconds (220 allocations: 32.567 MiB, 0.01% gc time)
# :UserLimit
scheduleIP = SchedulingModels.schedule(model)
# julia> sum(scheduleIP, 2)
# 6×1 Array{Int64,2}:
# 4
# 4
# 7
# 2
# 6
# 7
# Linear Optimization based on Network Model
lpmodel = networkmodel(np, ScheduleOptions(kind=:rate), solver=Gurobi.GurobiSolver())
@time lpstatus = JuMP.solve(lpmodel.model)
# Solved with barrier
# Solved in 106029 iterations and 284.07 seconds
# Optimal objective 3.649595545e+04
# 290.170663 seconds (171 allocations: 1.048 GiB, 1.23% gc time)
# :Optimal
scheduleLP = SchedulingModels.schedule(lpmodel)
# julia> round(Int, sum(scheduleLP,2))
# 6×1 Array{Int64,2}:
# 5
# 3
# 8
# 2
# 6
# 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment