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
17
votes
1 answer

Speeding up package load in Julia

I wrote a program to solve a linear program in Julia using GLPKMathProgInterface and JuMP. The Julia code is being called by python program which runs multiple instances of the Juila code through multiple command line calls. While I'm extremely…
Ryan F
  • 181
  • 1
  • 5
8
votes
1 answer

Fitting two curves with linear/non-linear regression

I need to fit two curves(which both should belong to cubic functions) into a set of points with JuMP. I've done fitting one curve, but I'm struggling at fitting 2 curves into same dataset. I thought that if I can distribute points to curves - so if…
8
votes
1 answer

How to ask for second best solution to a MIP using JuMP

I have a Mixed Integer Programming problem. I can use JuMP to find the optimal solution. But how can I find the second best solution? Or the third-best etc. This potentially might be another equally optimal solution, or it might be a worse…
7
votes
3 answers

Linear Programming: Find all optimal vertices

I was wondering if there is a nice way (preferably using JuMP) to get all optimal solutions of a linear program (in case there are multiple optimal solutions). An example minimize the statistical distance (Kolmogorov distance) between two…
balletpiraat
  • 206
  • 1
  • 11
7
votes
1 answer

Matlab to Julia Optimization: Function in JuMP @SetNLObjective

I am trying to rewrite a Matlab fmincon optimization function in Julia. Here is the Matlab code: function [x,fval] = example3() x0 = [0; 0; 0; 0; 0; 0; 0; 0]; A = []; b = []; Ae = [1000 1000 1000 1000 -1000 -1000…
kulsuri
  • 143
  • 8
6
votes
0 answers

Julia JuMP Infeasible problem - How to get insight into which constraints render the problem infeasible?

using JuMP, Cbc model = Model(with_optimizer(Cbc.Optimizer, seconds= (20 * 60), ratioGap = 0.10)); @variable(model, x[1:5], Bin); @constraint(model, c1[i in 1:4], x[i] == 0 ) @constraint(model, c2[i in 4:5], x[i] == 1 ) @objective(model, Min,…
Timothée HENRY
  • 14,294
  • 21
  • 96
  • 136
5
votes
2 answers

Julia Jump : Getting all feasible solutions to mip

I would like to have instead of only the vector of optimal solution to a mip , all the feasible (suboptimal) vectors. I found some old questions here, but I am not sure how they work. First of all, is there any new library tool/way to do that…
5
votes
2 answers

User-defined (nonlinear) objective with vectorized variables in JuMP

Is it possible to use vectorized variables with user-defined objective functions in JuMP for Julia? Like so, model = Model(GLPK.Optimizer) A = [ 1 1 9 5 3 5 0 8 2 0 6 13 ] b = [7; 3; 5] c = [1; 3; 5; 2] @variable(model, x[1:4] >=…
Kevin
  • 281
  • 2
  • 5
5
votes
1 answer

Using indicator constraints in Julia

JuMP provides a special syntax for creating indicator constraints.So, Which one is better, linearizing the indicator constraints and then write a code or using this feature? In order to constrain the constraint x + y <= 2 to hold when z binary…
Python.py
  • 71
  • 3
5
votes
1 answer

Create JuMP model with multi-threading in Julia

I have an optimization model which turns to be very difficult to build. This model has many if-else conditions and many loops as well. So I was thinking of using multi-threading for building this single JuMP model object. A very simplified version…
5
votes
1 answer

MethodError: objects of type Module are not callable

I am trying to duplicate a code in Julia using Jupyter Notebook. and getting the error MethodError: objects of type Module are not callable What am i missing here? using JuMP, Clp m=Model(solver=Clp()) @variable(m, 0 >= x >= 9) @variable(m, 0 >=…
Prashant
  • 51
  • 1
  • 2
5
votes
1 answer

JuMP with sparse matrices?

How do I deal with sparse matrices in JuMP? For example, suppose I want to impose a constrain of the form: A * x == 0 where A is a sparse matrix and x a vector of variables. I assume that the sparsity of A could be exploited to make the…
a06e
  • 18,594
  • 33
  • 93
  • 169
5
votes
3 answers

How to define JuMP variables using for loop in Julia?

I am new to Julia, and I am trying to define an optimization problem with JuMP. I have a lot of variables (x1,x2,x3....) that I am trying to define using a for loop. I want to have the code: @variable(m, x1>=0) @variable(m, x2>=0) ... However I…
Cam
  • 421
  • 2
  • 8
  • 18
5
votes
1 answer

Non-linear system of equations Julia

I'm trying to solve a large number (50) of non-linear simultaneous equations in Julia. For the moment I'm just trying to make this work with 2 equations to get the syntax right etc. However, I've tried a variety of packages/tools - NLsolve, nsolve…
4
votes
2 answers

Define a correct constraint, like outside a 2-D rectangle in Julia with JuMP

I would like to define a constraint in an optimization problem as follows: (x,y) not in {(x,y)|1.0 < x < 2.0, 3.0 < y < 4.0}. what I tried is @constraint(model, (1.0 < x < 2.0 + 3.0 < y < 4.0)!=2), but failed. It seems that boolen operation is not…
Quinn Xie
  • 41
  • 3
1
2 3
24 25