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
4
votes
2 answers

Optimisation Variable with two indices and different index length in JULIA JUMP

I want to solve an optimization problem in Julia. I am trying to define a binary variable x_{r,i} Thereby, the length of the sets of both indices is not the same. Let's say there is r_a and r_b, but for r_a there are i_1 and i_2 whereas for r_b…
tofri
  • 43
  • 5
4
votes
1 answer

how to write "then" as IP constraint in Julia

Hello fellows, i am learning Julia and integer programing but i am stuck at one point How to model "then" in julia-jump for integer programing leanring. Stuck here here #Define the variables of the model @variable(mo, x[1:N,1:S],…
4
votes
1 answer

Retrieve constraints matrix from Gurobi or MOI or JuMP in Julia

I want to retrieve an LP model in matrix form from Gurobi. I am using package JuMP in Julia. I can print all the constraints using MathOptInterface but not in matrix form. I have no idea how to print the problem matrix from Gurobi. Could anyone help…
Hongyu
  • 183
  • 5
4
votes
1 answer

Jump simple graph path problem, why is it looping?

I want to have x vehicle which goes on a graph going from vertex 1 and ending in the same all vertices as to be seen one time by one and only one vehicle (for those who know, i'm interesting in a PDPTW problem, but i'm stuck at this point) using…
victor roy
  • 51
  • 1
4
votes
2 answers

Julia: ctrl+c does not interrupt

I'm using REPL inside VScode and trying to fix a code that gets stuck inside a certain package. I want to figure out which process is taking time by looking at the stack trace but cannot interrupt because REPL does not respond to ctrl+c. I pressed…
user15988
  • 143
  • 2
  • 8
4
votes
1 answer

How to specify a variable in JuMP that can only be 0 or 1?

What is the syntax for specifying a variable in a JuMP optimization problem that can only be 0 or 1? I am using the following code: @variable(mod, X == 1 || 0) but it is not working.
rmae19
  • 77
  • 3
4
votes
1 answer

Dimension mismatch in Julia

I created a matrix A, which is 300x4 array. And in the objective, i should minimize A*x, where x is a 1x4 vector. and my code is the following: k = 3 m = length(u) n = k + 1 A = zeros(m,k+1) for i = 1:m for j = 1:k+1 A[i,j] =…
4
votes
2 answers

To strictly define a column vector (matrix with one column) in Julia

I am wondering about the simple way to strictly define a column vector in Julia, for example, I want a 3-row column vector B: julia> columnVectorB 3×1 Array{Float64,2}: 1.0 2.0 3.0 While I think the normal way is: julia> columnVectorB = [1.; 2.;…
Edward
  • 554
  • 8
  • 15
4
votes
1 answer

How to get constraints in matrix format from Gurobi/JuMP?

I have built an LP model in JuMP/Julia using Gurobi solver. I wish to visualize the constraints for checking the overall correctness of my model. In python, we can define a function help to visualize the constraints. Please follow the link below for…
NIT_GUP
  • 97
  • 1
  • 5
4
votes
1 answer

Julia+JuMP: variable number of arguments to function

I'm trying to use JuMP to solve a non-linear problem, where the number of variables are decided by the user - that is, not known at compile time. To accomplish this, the @NLobjective line looks like this: @eval @JuMP.NLobjective(m, Min,…
Daniel R. Livingston
  • 1,227
  • 14
  • 36
4
votes
1 answer

JuMP: How to get multiple solutions from getvalue(x)

I'm solving this Multi-Objective problem f1(x,y) = x f2(x,y) = (2.0-exp(-((y-0.2)/0.004)^2)-0.8*exp(-((y-0.6)/0.4)^2) )/x isdefined(:f1) || JuMP.register(:f1, 2, f1, autodiff=true) isdefined(:f2) || JuMP.register(:f2, 2, f2,…
sparkle
  • 7,530
  • 22
  • 69
  • 131
4
votes
1 answer

Create local variables programmatically from a dictionary in Julia

Consider the following function: function func(vars::Dict{Symbol, Any}) end I want to create local variables in a func's scope, where: variable names are each the key of the vars and variable values are values in a vars corresponding to the given…
aberdysh
  • 1,634
  • 2
  • 13
  • 34
4
votes
1 answer

How to do "for all" in sum notation in Julia/JuMP

I am trying to add constraints to a linear optimization problem in Julia using JuMP. I am using the sum{} function however, I am having trouble with some of the constraints. Does anyone know how to write "for all" in JuMP (the upside down A)? Here…
Cam
  • 421
  • 2
  • 8
  • 18
3
votes
1 answer

How does one elegantly initialize start values or parameter values when creating a julia JuMP parameter or variable container?

Was hoping a Julia or JuMP expert could help me on how to do the following (apologies as I am new to the language and tried all resources but cannot find a solution to this problem) I am trying to initialize the start values of all variables when…
Adam
  • 313
  • 1
  • 3
  • 11
3
votes
2 answers

UndefVarError in Optimization Using JuMP

I'm trying to code an optimization problem in Julia using JuMP. The objective function has two matrix multiplications. First, multiply the vector of w with size (10) by the matrix of arr_C with size (20, 10). So the w should be transposed to size…
Shayan
  • 5,165
  • 4
  • 16
  • 45
1
2
3
24 25