cplex

UnsatisfiedLinkError, despite setting Djava.library.path variable

不羁的心 提交于 2019-12-02 06:17:35
I am trying to integrate IBM's CPLEX library with my java application. For now, i'm just trying to create an IloCplex object. I added Cplex.jar, and it compiles fine, but when I run this: public class cplexTest{ public static void main(String[] args){ try{ IloCplex cplex = new IloCplex(); }catch (Exception e){ e.printStackTrace(); } } Cplex prints this message before throwing an exception: java.lang.UnsatisfiedLinkError: no cplex124 in java.library.path java.library.path must point to the directory containing the CPLEX shared library try invoking java with java -Djava.library.path=... I pass

Cplex c++ multidimensional decision variable

寵の児 提交于 2019-12-02 05:04:37
I'm new using cplex and I try to find some information on internet but didn't find clear stuff to help me in my problem. I have P[k] k will be equal to 1 to 4 and I have a decision variable x[i][k] must be equal to 0 or 1 (also p[k]) the i is between 1 to 5 For now I do like this IloEnv env; IloModel model(env); IloNumVarArray p(env); p.add(IloNumVar(env, 0, 1)); p.add(IloNumVar(env, 0, 1)); p.add(IloNumVar(env, 0, 1)); IloIntVar x(env, 0, 1); model.add(IloMaximize(env, 1000 * p[1] + 2000 * p[2] + 500 * p[3] + 1500 * p[4])); for(int k = 1; k <= 4; k++){ for(int i = 1; i <= 5; i++){ model.add(x

How can I export dual model from Cplex using java?

只愿长相守 提交于 2019-12-02 04:41:48
I know that we can export the model formulation from cplex in java using exportmodel. But can we do the same for dual formulation? Thanks. Using the interactive , you can export to the DUA file format (Note that this is not possible using the exportModel method in the Java API). Here is the pertinent information: format, governed by MPS conventions, writes the dual formulation of a problem currently in memory so that the MPS file can later be read back in and the dual formulation can then be optimized explicitly. This file format is largely obsolete now since you can use the command set

Maximizing linear objective subject to quadratic constraints

社会主义新天地 提交于 2019-12-02 04:27:41
I have a programming formulation from a paper and want to give it a tool for solving specific problems. The authors stated it as an linear programming (LP) instance, however I am not sure. Formulation is somewhat like as follows: max x1+x2+x3... s.t. x1.x3+x4.x5 <= 10 x2.x5+x3.x7+x1.x9 <=10 ... I tried to program it through cplexqcp function (due to quadratic constraints, however constraints do not include any x_i^2 variable). However I receive CPLEX Error 5002: Q in %s is not positive semi-definite error . Is this an instance of non-linear programming with non-convex constraints? Can I solve

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)

Passing CPLEX Parameters to CVXPY

寵の児 提交于 2019-11-29 17:01:38
How do i pass tolerances and other parameters through CVXPY when using the CPLEX solver? from cvxpy import Problem, Minimize from cvxpy.settings import CPLEX costs = ... constraints = ... prob = Problem(Minimize(costs), constraints) prob.solve(solver=CPLEX, ...) I see a page of CPLEX Parameters though it is unclear which ones apply to my quadratic problem. Also, the CVXPY documentation has pass through options for other solvers but not CPLEX. This will change in the future (see this pull request), but with cvxpy 1.0.6, you can do the following (NOTE: this is undocumented behavior; see below

R interface with CPLEX

可紊 提交于 2019-11-29 16:43:30
I am trying to link R, version 3.2.0, with CPLEX. I have used the following commands to install "cplexAPI" package: 1- install.Rtools() 2- install.packages("cplexAPI") I have installed Rtools successfully but I am getting an error saying "ilcplex/cplex.h: No such file or directory" in "cplexAPI" installation. Could you please help me out here? You can install cplexAPI manually: R CMD INSTALL --configure-args=" \ --with-cplex-include=/path/to/cplex_include/dir \ --with-cplex-lib=/path/to/cplex_lib/dir" cplexAPI_x.x.x.tar.gz Few other options can be found here . You can also add Cplex /include

error: iostream.h due to including cplex

。_饼干妹妹 提交于 2019-11-29 07:40:21
I am trying to use cplex in eclipse in Ubuntu 12.04 but when I include ilocplex.h I get the following error /opt/ibm/ILOG/CPLEX_Studio124/concert/include/ilconcert/ilosys.h:360:22: fatal error: iostream.h: No such file or directory The only two includes are written as follows: #include <ilcplex/ilocplex.h> #include <iostream> I would appreciate if anyone could help me with this. David Nehme At the time ILOG's Concert library was first released, the older iostream.h headers were still common in C++ compilers, but it supports the standard iostream libraries. To use the standard headers and

knapsack optimization with dynamic variables

有些话、适合烂在心里 提交于 2019-11-28 02:25:06
I am trying to solve an optimization problem, that it's very similar to the knapsack problem but it can not be solved using the dynamic programming. The problem I want to solve is very similar to this problem: Alex Fleischer indeed you may solve this with CPLEX. Let me show you that in OPL. The model (.mod) {string} categories=...; {string} groups[categories]=...; {string} allGroups=union (c in categories) groups[c]; {string} products[allGroups]=...; {string} allProducts=union (g in allGroups) products[g]; float prices[allProducts]=...; int Uc[categories]=...; float Ug[allGroups]=...; float