gurobi

Microsoft Solver Foundation for semi-integer

隐身守侯 提交于 2019-12-12 09:47:32
问题 Is it possible to use the MSF api to specify a variable as semi-integer ( V = 0 , or a <= V <= b )? The following is an example in LP_Solve that uses the "sec" and "int" keywords to indicate the variables are semi-continuous and integer. max: 0.5 Q1 + 0.55 Q2 ; Q1 >= 5; Q1 <= 10 ; Q2 >= 5; Q2 <= 10; Q1 + Q2 <= 10; sec Q1,Q2 ; int Q1,Q2 ; Something similar in MSF would be nice. I note that it is possible to call a Gurobi Plugin DLL within MSF however I cannot find any place in that api to be

Gurobi with Java without objective function

妖精的绣舞 提交于 2019-12-12 04:36:37
问题 I'm using the solver Gurobi with Java; I read all the Gurobi's Reference Manual, but I still have a few question it's possible to optimize a model without a objective function or I have to put one? it's possible to add a constraint like "x=0 if c>a" where x is a decision variable and c and a are known? Someone can help me? Thanks. 回答1: You don't need to have an objective function, but if you don't Gurobi will consider any feasible solution as good as the next, even one that is obviously (to

Solution not Feasible in Linear Programming in Python Gurobi

自闭症网瘾萝莉.ら 提交于 2019-12-11 14:58:50
问题 This is continuation of this thread. I am coding MILP using Gurobi in Python where the objective is to maximize the rewards while ensuring the distance constraint is not violated. I am however getting solution is infeasible. I tried the IIS but it still didnt help because it only shows the constraint that is being violated but not the solution. import random import gurobipy as grb import math n = 4 Distance = 50000000 def distance(points, i, j): dx = points[i][0] - points[j][0] dy = points[i]

Solve Gurobi model repeatedly in Python

强颜欢笑 提交于 2019-12-11 13:26:36
问题 I need to solve a gurobi model repeatedly (with different variable values each iteration). Rather than rebuild the model each iteration, I have tried setting up the model, then looping through repeated optimizations, but the variable values do not update. Here is a simple example. n = Model("Test") a = n.addVar(lb=0,name = "a") b = n.addVar(lb=0,name = "b") a=1 b=1 x = n.addVar(lb=0,name = "x") y = n.addVar(lb=0,name = "y") n.update() n.setObjective(a*x + b*y,GRB.MAXIMIZE) n.addConstr(x + y <

Error in Gurobi for optimization?

萝らか妹 提交于 2019-12-11 12:45:13
问题 sw: ampl ampl: include Availability1.ampl Gurobi 5.5.0: mipgap = 0.00000000000000000000000001 outlev = 1 Optimize a model with 68298 rows, 1934 columns and 28751 nonzeros Presolve removed 1934 rows and 68298 columns Presolve time: 0.02s Presolve: All rows and columns removed Iteration Objective Primal Inf. Dual Inf. Time 0 9.9948451e-01 0.000000e+00 0.000000e+00 0s 179 9.9948451e-01 0.000000e+00 0.000000e+00 0s Solved in 179 iterations and 0.06 seconds Optimal objective 9.994845101e-01 Gurobi

How can I make Gurobi (Using R) show all solutions

♀尐吖头ヾ 提交于 2019-12-11 10:13:48
问题 As the question states: I know there are several solutions (see output of GA and check that value and constraints are correct), but I can't get them out of Gurobi. Edit after @Paleo13's answer : As he states, his answer is a good workround. However I would also love to see, if there is a more efficient option. Therefore, I added a bounty. See here and here for what I know. Reproducible example: my_fun <- function(x) { f <- sum(model$obj * x) penalty <- sum(abs(model$A %*% x - model$rhs))

Gurobi UnsatisfiedLinkError

被刻印的时光 ゝ 提交于 2019-12-11 06:41:12
问题 I am trying to install Gurobi under Academic Licence on Ubuntu 14.04. I have read the following post about the UnsatisfiedLinkError : stackoverflow.com/questions/.... But that didnt help me. I have extracted the zip in my opt folder. I have placed the licence file in /opt/gurobi600/linux64/lib/gurobi.lic . I am trying to run the Callback.java example in Eclipse. I have as Java VM argument: -Djava.library.path=/opt/gurobi600/linux64/lib/ . I have as program argument: /opt/gurobi600/linux64

Exception in thread “main” java.lang.UnsatisfiedLinkError: no GurobiJni56 in java.library.path

瘦欲@ 提交于 2019-12-11 05:19:32
问题 First of all, I am new to Java programming and please excuse me for any wrong use of terms or for overseeing obvious mistakes. I am using OS X Yosemite on a MacBook Pro, and are coding Java in Eclipse. I encounter the exception given in the title when I'm trying to run my program. Here, Gurobi is a solver for optimization problems and is downloaded from http://www.gurobi.com/. The weird thing is that my program was working the other day, but then it suddenly ceased to work. Any regular

Quadratically constrained MIQP with julia and gurobi

偶尔善良 提交于 2019-12-11 04:57:23
问题 This is an attempt to answer the following question: https://matheducators.stackexchange.com/questions/11757/small-data-sets-with-integral-sample-standard-deviations So the intent of the following code is to find examples of small datasets with integer standard deviation. That can be formulated as a quadratically constrained mixed integer quadratic program, so I try to use Gurobin from Julia. Following is my code: using JuMP using Gurobi m = Model(solver = GurobiSolver() ) @variable(m, 0<= x

Gurobi reports unbounded model despite mathematical impossibility

廉价感情. 提交于 2019-12-11 04:15:44
问题 I'm using Julia's wonderful JuMP package to solve a linear program with Gurobi 6.0.4 as a solver. The objective function is a sum of decision variables, clearly defined as nonnegative, and the problem requires it to be minimized. For some reason, Gurobi thinks the model is unbounded. Here is the definition of the variables and the objective: @defVar(model, delta2[i=irange,j=pair[i]] >= 0) @setObjective(model, Min, sum{delta2[i,j], i=irange, j=pair[i]}) Strange observation #1: although this is