Skip to content

Slow solution of large LPs w/o direct model #392

@pkienscherf

Description

@pkienscherf

As discussed here: https://discourse.julialang.org/t/jump-optimize-used-two-much-time-and-memory-to-solve-a-cplex-model-do-anyone-knows-why/77966/9 I have an issue with long solution times when not using a direct model. The original problem that I cannot show here takes roughly 600s to solve as a regular model vs roughly 1.1s as a direct model. I have observed similar behavior (60s vs. 1.7s) in the following MWE (even if not for the same reason, I suppose it's still interesting):

using JuMP
using CPLEX

A = 1:100
T = 1:1000

m = Model(CPLEX.Optimizer)

@variables m begin
    0 <= x[A, T] <= 2
end

@constraints m begin
    [a in A[2:end], t in T], x[a ,t] >= 0.5 * x[a-1, t]
    [a in A, t in T[2:end]], x[a, t] - x[a, t-1] >= -1
    [a in A, t in T[2:end]], - x[a, t] + x[a, t-1] <= 1
end

@objective(m, Min, sum(x))

@time optimize!(m)

My setup is as follows:

Julia Version 1.7.2
Commit bf53498635 (2022-02-06 15:21 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin19.5.0)
  CPU: Intel(R) Core(TM) i5-5350U CPU @ 1.80GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-12.0.1 (ORCJIT, broadwell)
  [6e4b80f9] BenchmarkTools v1.3.1
  [a076750e] CPLEX v0.9.1
  [a93c6f00] DataFrames v1.3.2
  [31c24e10] Distributions v0.25.53
  [2e9cd046] Gurobi v0.11.0
  [7073ff75] IJulia v1.23.2
  [b6b21f68] Ipopt v1.0.2
  [4076af6c] JuMP v1.0.0
  [8314cec4] PGFPlotsX v1.4.1
  [91a5bcdd] Plots v1.27.4
  [014a38d5] QuadraticToBinary v0.4.0
  [295af30f] Revise v3.3.3
  [f3b207a7] StatsPlots v0.14.33
  [0c5d862f] Symbolics v4.3.1
  [fdbf4ff8] XLSX v0.7.9
  [e88e6eb3] Zygote v0.6.37
  [10745b16] Statistics

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions