Tagged Questions
Solving systems of linear equations where variables are integers.
0
votes
1answer
28 views
If condition in linear Programming
I am solving an integer programming problem with the condition
if a=0 then b=0 else b=1
where a is integer while b is binary
I looked on previous question similar to this but could not find ...
1
vote
1answer
39 views
Mixed Integer Program with Varying Interest Rates
I'm currently stuck with a MIP program where the interest rate, i, is based on the number of units produced for Housing Plan A. If the number of plan A houses sold is the highest among all four types ...
-1
votes
0answers
23 views
Linear and Integer Program Expression (MPS) File Format
I am new to mathematical modelling and exact solving so the following question might be silly.
Is it possible to represent the following inequality in the MPS format, and if so, in what way?
\sum_{...
0
votes
0answers
12 views
Branch and Bound Method: Using CVXPY
I am trying to solve a non-linear integer programming problem using CVXPY with branch and bound algorithm. This problem takes different x values which are constrained to be integers. The code I ...
-4
votes
0answers
33 views
Balas Additive Algorithm implementation [closed]
I am trying to implement Basal Additive Algorithm in C++. On smaller problem size it seems to be working fine (I've even checked intermediate steps), but I get Segmentation Fault on bigger datasets. ...
5
votes
1answer
132 views
+100
How to implement a constraint solver for 2-D geometry?
I have a set of metallic sliding pieces which are constrained to the x and y axis in following way:
I would need to maximize the horizontal distance among all pieces constrained by the same slider ...
1
vote
1answer
46 views
R lpSolve package does not find optimal solution
I'm trying to solve the following optimization problem with R lpSolve package:
1.007825*x1 +12.000000*x2 +15.99492*x3 +14.00307*x4 +31.97207*x5 +30.97376*x6 >= 10
1.007825*x1 +12.000000*x2 +15....
0
votes
2answers
66 views
Constraint in Linear Programming
I am trying to write a constraint for the problem:
if a=>0, and b=>0, then a=b.
So far, I have written,
Let
u >= a-b
u >= b-a
Now, I need to make sure that u = 0 if both a>0 and b>0, but ...
1
vote
1answer
50 views
Assignment optimization / Set covering
I have the following task and didn't find any working solution.
I need to find a optimal solution for network node placement. The objective is to minimize the digging cost for connecting cables. Some ...
0
votes
1answer
67 views
Gurobi 7.0-How to Find the n Best Solutions to MILP?
I am using Gurobi 7.0 through Matlab. Based on the documentation, in order to find the n best solutions you need to set the parameters:
PoolSearchMode=2, to find alternative optimal solutions in a ...
1
vote
0answers
69 views
Gurobi with python : how to construct conditional function in objective expression?
I'm solving an integer programming problem using Gurobi in python, in which the objective expression includes some conditional functions.
Explicitly, the problem is modeled as follow:
max [sum(f(x_i,...
1
vote
1answer
38 views
How to create two dimensional set objects under pyomo.environ module
I tried to create a LP model by using pyomo.environ. However, I'm having a hard time on creating sets. For my problem, I have to create two sets. One set is from a bunch of nodes, and the other one is ...
1
vote
1answer
131 views
How to set MIP start (initial solution) with Gurobi solver from PuLP?
I'm using the PuLP module in Python to formulate a mixed integer program. I am trying to work out how to set a MIP start (i.e. a feasible solution for the program to start from) via the PuLP interface....
2
votes
0answers
58 views
Suggesting a lower bound for an ILP solver
I have an integer linear programming problem that takes very long to solve by the solvers I've tried (CPLEX, CBC), even though they find the optimal solution early on. They just take forever to fully ...
1
vote
0answers
33 views
CPLEX obtain reduced costs of a MIP?
I am solving a MIP problem using CPLEX. After solving it, I want to get the reduced costs. I am aware of the fact that reduced costs don't exist for the MIP, so I did the following:
int type = ...
3
votes
5answers
150 views
Minimizing the sum of 3 variables subject to equality and integrality constraints
I am working on a programming (using Python) problem where I have to solve the following type of linear equation in 3 variables:
x, y, z are all integers.
Equation example: 2x + 5y + 8z = 14
...
-1
votes
1answer
41 views
IF THEN CONSTRAINTS
I have the next two if-then constraints
1.- IF x1+y2-n >= 0 THEN m2=0, ELSE m2=1
Where x1, x2 are discrete, n is a constant and m2 is a binary variable.
IF 2x1 - y1 >= 0 THEN m1=0, ELSE m1=1
...
0
votes
1answer
41 views
PuLP-OR: Can you delete variables already created?
My question is very simple. Is it possible to delete a variable that I have already created?
Or my only hope is to not create the variable to begin with?
I guess if you can print a variable then ...
0
votes
1answer
38 views
What weights to use in special ordered sets?
I am currently working on a MIP problem, where I can take advantage of the special ordered sets of type 2 (SOS2).
My problem is, that I have not fully understood such sets. The reason for this, is ...
0
votes
2answers
51 views
If Then Constraints in non-linear programming
I have several constrains in a No linear problem.
For example:
In m(x+y-n)^2
If x+y-n>=0 Then m=0,
Else m=1.
How can I write this conditional constraint as linear or non-linear constraint?...
0
votes
0answers
43 views
lp_solve all optimal solutions
I am using the lp_solve java wrapper to find an optimal solution to an IP. Is there an easy way to find all solutions? Or do I have to add new constraints to rule out the current solution and re-solve?...
0
votes
1answer
48 views
Python cvxopt glpk ilp return first feasible solution
I am using cvxopt.glpk.ilp to solve a very complicated Mixed Integer Program. I was wondering if there is a way to get the program to terminate after finding the first solution? It takes too long and ...
0
votes
0answers
73 views
Decision support system for supplier selection and order allocation
I wrote a small program to solve a problem i have but having trouble to scale it and could need some points/help.
There are 3 matrices for data
1) Price of an item
price = [
[11.5, 12.5, 10.75, ...
0
votes
1answer
39 views
CPLEX not substituting equality correctly?
I am quite new to CPLEX and I am writing a very simple model that CPLEX does not want to satisfy. I know my model is "verbose" as I have variables that simply equal other variables, but it is my first ...
1
vote
0answers
33 views
Sets in Lingo Programming
I need help on Lingo programming.I have a mixed integer programming to solve it using sets in Lingo.One of the constraints is:
S(i,k,w) >= m(i,j) * X(i,t), for i=1,...,I; j=1,...,J; t=1,..,T; k=t+...
0
votes
1answer
69 views
CPLEX using LP file format: indicator constraints with boolean operators
I am completely new to CPLEX and far from an expert in MIP but I am trying to solve a problem with this technology (CPLEX 12.4).
I ahve decided to create the MIP models in an .lp file and give it to ...
0
votes
0answers
71 views
Linear Programming Summation Constraint
I am creating a linear programming problem, and I am using constraints from a research paper, but am having issued understanding one of them.
Essentially I am creating a roster of people that are ...
1
vote
1answer
31 views
Creating a tridimensional IloIntVarArray in Cplex with c++
I'm using some integers variables in cplex with c++, like:
alpha = IloIntVarArray (env, numArcs,0 ,N);
alpha is unidimensional array with range 0 - N...
But my problem is, I'd like to create a x[...
1
vote
1answer
52 views
CPLEX in C++: Converting a LP to MIP
I am a beginner in using CPLEX in c++. I know how to solve a simple LP using CPLEX.
I am wondering if setting variables as integer (as follows), causes CPLEX use the branch and bound method to solve ...
1
vote
1answer
65 views
Is it possible to solve a NP-hard problm using both heuristic and mathematical programming?
I have a Genetic Algorithym and mixed-integer programming model of a parallel machine scheduling problem. But mathematical model takes too much time to solve the problem and unlikely genetic ...
0
votes
1answer
84 views
Python pulp optimizer with min absolute value
I'm using pulp (https://pythonhosted.org/PuLP/) for optimization purposes and get issue. I need to use constraint like abs(x) > MIN and I found solution here http://lpsolve.sourceforge.net/5.5/...
3
votes
0answers
162 views
finding integer solutions (diophantine) to linear systems with numpy/sympy
I need to solve a system of linear diophantine equations with either numpy or sympy.
Is there any way to constrain numpy's linalg.solve/linalg.lstsq method to return only integer solutions? (probably ...
0
votes
3answers
86 views
how to find all integer solutions to sum(xi) =b, with linear constraints
Suppose sum(xi) = 10, 0<= xi <= 2, i = 1, 2, ..., 10. How to find all integer solutions for xi. thank you. I have read about Euclidean algorithm, but it looks like just for two unknown variables....
1
vote
1answer
150 views
Two Dimensional Bin Packing
I am using the following Integer Programming Model for solving the Two Dimensional Bin Packing Problem. The following model illustrates the one dimensional version. The code I have written ...
0
votes
0answers
35 views
What are pseudo reduced costs?
Currently I am looking into Cplex and I found the parameter variable selection (VarSel) which can be set to use pseudo reduced costs. Well, I heard of pseudo costs and I heard of reduced costs but I ...
1
vote
1answer
201 views
How do I specify multiple variable constraints using Integer Programming in PuLP?
I am trying to solve the Bin Packing Problem using the Integer Programming Formulation in Python PuLP. The model for the problem is as follows:
I have written the following Python Code using the PuLP ...
1
vote
1answer
407 views
How many decision variables can be solved for Mixed Integer Programming?
I have a Mixed Integer Programming problem(binary integer variables), how many variables can I solve, i.e, upper limit and what would be time taken?
The problem would have a utmost 5 constraints and ...
0
votes
0answers
32 views
In branch-and-price, how to handle variables that have a cost with an offset?
I am implementing a branch-and-price (or column-generation) algorithm. The variables (or columns) I generate during optimization have a cost with an offset. For example, if I want to introduce a new ...
1
vote
0answers
63 views
Solve Linear integer programming for petri nets in Java
Summary of my issue:
I have system of linear equations out of a petri net like this (ILP):
int[][] a = {
{-1, 0, 0, 0},
{1, -1, 0, 0},
{1, 0, -1, 0},
{0, 1, 0, -1},
...
1
vote
1answer
108 views
Gurobi Optimizer: determining feasibility without optimizing the model
In Gurobi, is it possible to see if a group of constraints and variables are feasible without actually optimizing the problem? It seems if the objective is a constant, Gurobi still does a lot of heavy ...
1
vote
2answers
146 views
Why using linear integer programming (ILP) though it is NP-Complete?
The question may be stupid but it really confuses me for a long time.
I read a lot of papers in wireless sensor network. Many researchers model their problems into the form of ILP. However, ILP is NP-...
0
votes
1answer
33 views
Cplex.IntParam.WorkDir property has incorrect value when calling Cplex from C# in Visual Studio 2015 and not creating Node Files
I'm calling cplex from C# in Visual Studio 2015.
Cplex cplex = new Cplex();
I check the value of Cplex.IntParam.WorkDir (using cplex.GetParam(Cplex.IntParam.WorkDir)), and it gives me the following ...
0
votes
2answers
181 views
Solving Mixed Integer Linear Programs in Java
I would like to solve so-called Mixed Integer Linear Programs in Java (by some kind of Branch-and-Bound/Cut method). I do not want to use commercial libraries (CPLEX, Gurobi, SCIP) which are expensive ...
2
votes
4answers
198 views
How to solve this ILP/CP matrix puzzle
I'm studying about algorithms and recently found the interesting challenge.
It will give us some row/column, and our mission is to fill table with integer 1~N which displays only once and their row ...
1
vote
2answers
102 views
Sympy relational symbol in set
I have a FiniteSet and a symbol with which I want to associate a Relation such that the symbol is in the FiniteSet, is it possible with sympy? symbol in FiniteSet does not return an expression, but ...
1
vote
1answer
65 views
Get formatted equations from LP/MPS file
When solving problems with many (changing) constraints or objective components it is pretty hard to create documentation in form of formatted equations for it.
Is there an easy way to automatically ...
0
votes
1answer
207 views
Python - The integer linear programming (ILP) function in CVXOPT is not generating correct results
I'm trying to solve the simple example found in https://en.wikipedia.org/wiki/Integer_programming#Example using the CVXOPT library on Python 2.7 ; The optimal answers are either (1,2) or (2,2). I'm ...
0
votes
0answers
27 views
Resource Allocation in a Wireless Network
What deterministic algorithm is suitable for the following resource allocation/scheduling problem?
Consider a set of players: P1, P2, P3 and P4. Each player receives data from a cell tower (e.g. in ...
2
votes
1answer
51 views
Minimize image area while preserving a certain metric
I have a picture and I want to find the crop with the minimal area that at the same time retains a certain percentage of the edge energy.
My take on this was to formulate this as a optimization ...
0
votes
1answer
148 views
Using max/min in mixed integer programming model
I building a mixed integer programming model, and I want to define the minimum and mzximum of a decision variable.
for example lets say the C={19, 20, 30}
I want to define C_early as 19 and C_late ...