gurobi

java.lang.UnsatisfiedLinkError: no GurobiJni / Tomcat

谁说我不能喝 提交于 2019-12-02 12:16:20
问题 We are trying to run Gurobi through a Java web application with Tomcat server in a CentOS. System variables are defined: declare -x GRB_LICENSE_FILE="/home/suporte/gurobi.lic" declare -x GUROBI_HOME="/opt/gurobi752/linux64" declare -x LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:\${GUROBI_HOME}/lib" declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:\$JAVA_HOME/bin:\$GUROBI_HOME/bin" Gurobi and Java work fine. Application works fine as well in Tomcat, but when it calls

java.lang.UnsatisfiedLinkError: no GurobiJni / Tomcat

一笑奈何 提交于 2019-12-02 05:14:34
We are trying to run Gurobi through a Java web application with Tomcat server in a CentOS. System variables are defined: declare -x GRB_LICENSE_FILE="/home/suporte/gurobi.lic" declare -x GUROBI_HOME="/opt/gurobi752/linux64" declare -x LD_LIBRARY_PATH="\${LD_LIBRARY_PATH}:\${GUROBI_HOME}/lib" declare -x PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:\$JAVA_HOME/bin:\$GUROBI_HOME/bin" Gurobi and Java work fine. Application works fine as well in Tomcat, but when it calls Gurobi, we get the exception: "java.lang.UnsatisfiedLinkError: no GurobiJni75 in java.library.path".

Graph coloring with intervals Gurobi constraints

穿精又带淫゛_ 提交于 2019-12-02 04:17:50
I'm trying to fix some constraints for the Graph coloring problem using networkx and gurobi. For each i ∈ V, we define the following set of intervals. Each interval [l,u] ∈ Ii represents a possible pair of minimum color l and maximum color u for the set of edges incident to vertex i. Also, for each k∈K , we represent the set of intervals for vertex i ∈ V which include color k by : Intervals variable This is all the code that i wrote: import networkx as nx import gurobi as gb from itertools import combinations, chain import pygraphviz as pygv import os import matplotlib.pyplot as plt from

What happens when I modified the RHS of a constraint (GLPK)?

亡梦爱人 提交于 2019-12-01 13:20:58
I am increasing the RHS of less-than-or-equal constraint of a MIP problem with GLPK. However, sometimes, after re-optimizing, GLPK cannot find any feasible solution within the time limit. So I am guessing it does not check if the previous solution was feasible. Does anybody have any experience with that? Or can point me to a document that is not the source code itself? Also, I would like to know what is the workflow after I add a constraint for any other solver (e.g. Gurobi, Cplex, SCIP, CBC) so any information is helpful. Cheers! After changing something in the model, all solving information

What happens when I modified the RHS of a constraint (GLPK)?

社会主义新天地 提交于 2019-12-01 11:49:25
问题 I am increasing the RHS of less-than-or-equal constraint of a MIP problem with GLPK. However, sometimes, after re-optimizing, GLPK cannot find any feasible solution within the time limit. So I am guessing it does not check if the previous solution was feasible. Does anybody have any experience with that? Or can point me to a document that is not the source code itself? Also, I would like to know what is the workflow after I add a constraint for any other solver (e.g. Gurobi, Cplex, SCIP, CBC)

gurobi - Error code = 10004 Unable to retrieve attribute 'X'

不想你离开。 提交于 2019-12-01 06:04:22
I am getting an error in my c++/gurobi file: Error code = 10004 Unable to retrieve attribute 'X' I read that this might have something to do with labels? But I don't see how there is a problem. It works for some input files, but not for others. So I have created a toy file, t5.txt in attachment. This file does not work, but removing the last column and setting 8 to 7 fixes it. I am puzzled... Below is the output of model.write. Everything seems to make sense, any Ideas what I am doing wrong? Whenever I do a model.write(test.sol), the program stops, so there seems to be something wrong with the

gurobi - Error code = 10004 Unable to retrieve attribute 'X'

巧了我就是萌 提交于 2019-12-01 03:03:50
问题 I am getting an error in my c++/gurobi file: Error code = 10004 Unable to retrieve attribute 'X' I read that this might have something to do with labels? But I don't see how there is a problem. It works for some input files, but not for others. So I have created a toy file, t5.txt in attachment. This file does not work, but removing the last column and setting 8 to 7 fixes it. I am puzzled... Below is the output of model.write. Everything seems to make sense, any Ideas what I am doing wrong?

Gurobi Python: how to write nested sum in a constraint

让人想犯罪 __ 提交于 2019-11-30 21:01:31
I have an optimization problem and I'm using Python and Gurobi to optimize it. In my problem formulation there is a constraint that has a nested sum. constraint I've recently started learning python and I searched in gurobi documentation and example codes and I couldn't find any example of nested sum. I was wondering if anyone could help me solve this problem. Thanks in advance! Use two for statements inside the quicksum() function and two for statements in the generator expression: mycts = m.addConstrs((quicksum(x[i,f,p]*y[i,f,p,t] for i in I for p in P[i,f]) <= z[f,t] for f in F for t in T),

Gurobi Python: how to write nested sum in a constraint

孤街浪徒 提交于 2019-11-30 17:05:00
问题 I have an optimization problem and I'm using Python and Gurobi to optimize it. In my problem formulation there is a constraint that has a nested sum. constraint I've recently started learning python and I searched in gurobi documentation and example codes and I couldn't find any example of nested sum. I was wondering if anyone could help me solve this problem. Thanks in advance! 回答1: Use two for statements inside the quicksum() function and two for statements in the generator expression:

Get constraints in matrix format from gurobipy

♀尐吖头ヾ 提交于 2019-11-30 04:02:58
I coded my model in gurobipy and I want to get the matrix of constraints and vector of cost. Is there any way to access those? From the python API, there's no single function to get the matrix coefficients from a Gurobi model, but it's not to hard to write one yourself. It is convenient to have lists of your variables and constraints. If you have a gurobi model in variable m dvars = m.getVars() constrs = m.getConstrs() will give you the list of variables and constraints. You can then use m.getAttr to retrieve attributes related to the variables. To obtain the objective function coefficients,