Questions tagged [julia-jump]

JuMP is a domain-specific modeling language for mathematical programming embedded in the Julia language.

JuMP is a domain-specific modeling language for mathematical programming embedded in the Julia language.

https://github.com/JuliaOpt/JuMP.jl

362 questions
3
votes
1 answer

How to specify julia project to use different version of JuMP depending on the julia version

How can I specify in julia project's Project.toml that a different version of JuMP should be installed with specific julia versions. I would like to use JuMP 1.3.0 but for example julia 1.0 accepts JuMP versions up to 0.22.3. I would need to thus…
toubinaattori
  • 73
  • 1
  • 1
  • 7
3
votes
2 answers

Is it possible to create or access the gap history

In Julia JuMP, I am wondering whether it is possible to access an array, or similar, of the GAP history, the GAP improvements. I know that at the end of the optimization, I can access the final gap with relative_gap(m) with m of type Model and I…
JKHA
  • 1,800
  • 11
  • 28
3
votes
2 answers

JuMP nonlinear optimization constraints broken to O(1e-9)

I'm running nonlinear optimization using the Ipopt optimizer in JuMP. My objective/cost function relies on the constraints being adhered to strictly. However on some iterations the constraint are being broken. Specifically, my constraints are s.t.…
Kevin
  • 281
  • 2
  • 5
3
votes
1 answer

How to pass a SymPy expression supported by JuMP

I would like to convert a SymPy expression in order to use as an objetive function in JuMP. Suppose my variable involves two variables x = Sym("x") y = Sym("y") expr = x^2 + y fn = lambdify( expr ) and the model model = Model(Ipopt.Optimizer) l =…
Fam
  • 507
  • 2
  • 8
3
votes
1 answer

Obtaining Irreducible Inconsistent Subsystem (IIS) with JumP - Julia

I am trying to obtain the constraints that are included in the IIS, for example with the following infeasible problem using JuMP, Gurobi model = direct_model(Gurobi.Optimizer()) # defining variables @variable(model, z) @variable(model, x1[a=1:10,…
3
votes
2 answers

For loop with 2 iterators in Julia/JuMP

I need to implement the following pseudocode to JuMP/Julia: forall{i in M, j in Ni[i]}: x[i] <= y[j]; I imagine something like: for i in M and j in Ni[i] @constraint(model, x[i] <= y[j]) end How do I properly implement the 2 iterators in the…
3
votes
2 answers

"Not defined variable" in a 'while loop' in Julia

I am trying to do a sensitivity analysis in Julia using JuMP. Here is my code: using JuMP, Plots, Gurobi m=Model(with_optimizer(Gurobi.Optimizer)) @variable(m, x>=0) @variable(m, y>=0) @variable(m, k>=0) k = 0 while k<=1 φ(x,y,k)=3*x+k*y …
Yorgos
  • 183
  • 10
3
votes
0 answers

Seminar Scheduling Problem Modeling - Julia

I am trying to learn Julia with optimization problems. I tried to solve a scheduling problem. Here is the question that I want to solve with Cbc library. - There are 6 time periods, 10 seminar, 5 speaker, 15 audience, and 4 conference room. Which…
colss
  • 51
  • 9
3
votes
1 answer

How to linearize a combination of AND and OR constraints

I have a variable t, and I would like to have the following constraints: a <= t <= b and (c <= t <= d) or (e <= t <= f) Here is the code I used in Julia: using JuMP, Cbc, StatsBase import Random model =…
Timothée HENRY
  • 14,294
  • 21
  • 96
  • 136
3
votes
1 answer

Get branch and bound node count in JuMP/Gurobi

I am trying to get the branch and bound node count using the JuMP interface and the Gurobi solver in Julia. I tried getnodecount(m) as suggested on the JuMP website, but this came back as undefined. After doing more research, I read to…
3
votes
2 answers

all subset of a se in julia

would you please help me? How can I do a code which can find all subset of a set for example I want to code this constraint in Julia. It is a subtour constraint. But I don't know how I can find all subsets of S set. @constraint(ILRP, …
Soma
  • 743
  • 6
  • 19
3
votes
1 answer

How to evade precompile error using Julia when adding packages

I am trying to use three different packages with Julia programming (with Atom IDE, for what it's worth). I'm very new to Julia so pardon any ignorance! Here's what I've…
3
votes
1 answer

How to quickly solve a moderate scale QP formulation in Julia?

This is a newbie question. I am trying to minimize the following QP problem: x'Qx + b'x + c, for A.x >= lb where: x is a vector of coordinates, Q is a sparse, strongly diagonally dominant, symmetric matrix typically of size 500,000 x 500,000 to…
3
votes
1 answer

Minimize the maximum variable

I have a Mixed Integer Programming problem. The objective function is a minimization of the maximum variable value in the a vector. The variable is has an upper bound of 5. The problem is like this: m = Model(solver = GLPKSolverMIP()) @objective(m,…
Christian Bay
  • 33
  • 1
  • 5
3
votes
2 answers

Same code doesn't work consistently in Julia

I created a model to solve linear programs in Julia. I solved the linear program first time but the same code doesn't work for a modified program. Can you figure out what's going on? Thank you! The code that works fine: m = Model() @variable(m,…
1 2
3
24 25