2,638 questions
Tooling
0
votes
0
replies
33
views
Good packages for bounded Linear Quantile Regression?
I'm looking for a good package to train a linear quantile regression model, i.e. $\hat y = \sum_{i=1}^n w_i \cdot X_i$. With $x_i$ are the input features, and $w_i$ are the bounded trainable weights. ...
0
votes
1
answer
132
views
Why doesn't scipy.optimize.milp respect the time_limit parameter?
I'm running an optimization problem using scipy MILP function. I get to the point where the solving report pops up, either through time limit or solution (see below). When the solving report pops up, ...
3
votes
2
answers
111
views
lpSolve issue with no feasible solution
I'm trying to select 5 values in the first row, 1 value in rows 2-9, and maximize the objective function. The only thing I can't figure out how to embed in the problem is that I can only choose a ...
1
vote
1
answer
133
views
Python raw material inventory optimizer
I want to build a function that can look at the raw material on hand information I provide, then come up with combinations of inputs to achieve a desired number of finished products.
on_hand_inventory ...
0
votes
2
answers
134
views
New(ish) to Pyomo - How Do I Structure This Model? [closed]
I'm relatively new to both Python and Pyomo. I'm building an optimization script as one of my first projects. ChatGPT is hallucinating and I cannot find an example of how to properly set up the model ...
2
votes
1
answer
85
views
Suggestion needed for enhancing problem formulation for constraint programming
I'm trying to formulize a constraint programming solution for item allocation on shelf. The goal is simple items belonging to same brand should be kept as close as possible and should maintain a ...
1
vote
2
answers
132
views
Linear Programming with `good_lp`: Define a tolerance gap like in PuLP
I have the following example of a small example of a linear program in Rust:
use good_lp::{variables, variable, default_solver, SolverModel, Solution, constraint};
fn main() {
// Declaring binary ...
1
vote
1
answer
71
views
Find the linear combination of vectors to find a vector obeying constraints
I have a set of 3 complex vectors, I want to a find a linear combination of these vectors that would amount to an offset (y = c) - like an array with all elements equal to each other, within a ...
0
votes
1
answer
235
views
Python script for picking a randomly selected point that satisfies some linear inequalities
I want to make a python script, which takes in a list of inequalities as input.
Each inequality is a list:
[c0, c1, ..., cn]
which represents the following:
c0 + c1x1 + c2x2 + ...+ cnxn ≤ 0
I ...
0
votes
1
answer
42
views
Docplex use for timeseries based variables
I am trying to model an optimisation problem where each item in a list is essentially power generated at that hour. I am trying to minimise the amount of energy stored while still getting the same ...
2
votes
1
answer
214
views
Getting Infeasibility while solving constraint programming for shelf space allocation problem
I'm trying to allocate shelf space to items on planogram using constraint programming. It is a big problem and I'm trying to implement piece by piece. At first we're just trying to place items on ...
0
votes
1
answer
55
views
How it is possible to solve one LP (Simplex) per thread in parallel?
I need to solve one LP per thread at the same time.
I'm coding in Matlab and using gurobi as a solver. Since gurobi is an API that actually run calculations in C++, I'm unable to use several threads ...
0
votes
0
answers
72
views
Constraint.Feasible does not return callable constraints
I am currently working with an LP-problem and Pyomo. There I am generating different constraints based on some input parameters. The structure of the constraint generation is the following:
The ...
2
votes
3
answers
125
views
Problem with a Lineup Optimizer due to players having multiple Positions
i have a list of Hitters in python with their name,projection and Positions
juan-soto 30.3773 ['OF']
kyle-tucker 44.0626 ['OF']
...
yordan-alvarez 32.510200000000005 ['CI', 'OF']
william-contreras 26....
1
vote
1
answer
79
views
Constraint-based optimizing the decision threshold of a prediction model
I am working on optimizing the decision threshold of a trained decision model for a binary case (targets 0 and 1). I want to optimize the decision threshold of the model, i.e. the point at which the ...
0
votes
1
answer
57
views
Reduced Costs in IBM ILOG CPLEX Optimization Studio
In this Stack Overflow post, they give the code to find the solution duals (shadow prices).
execute
{
writeln(ctMaxTotal.dual);
writeln(ctMaxTotal2.dual);
writeln(ctMaxChloride.dual);
}
What is the ...
0
votes
1
answer
360
views
PuLP Solvers Not Available
I am running an LP using pulp but getting the error AttributeError: 'NoneType' object has no attribute 'actualSolve'. So I found this post on determining the solvers that are available. This directed ...
0
votes
1
answer
81
views
GLPK.js : How to add a constraint which set incompatible upper and lower bounds?
I'm working on an app which aims to give an optimized weekly planning considering multiple constraints ( Hours per week, availabilities of each person, etc... ). My app is built entirely with node js, ...
0
votes
0
answers
161
views
How to linearize the product of two continuous variables?
I'm trying to solve a MILP problem in Matlab Optimization Toolbox. I'm encountering with problems with the product of two decision variable of my problem which are bounded.
0<= x <= 60
0 <= ...
0
votes
1
answer
73
views
Python Pulp LP leaving rooms unassigned and penalties/constraints not preventing that
I am having difficulty getting all classrooms to be assigned to a class for a room assignment problem. I am using a grid calculated based on class capacity & room capacity (values 0-1). ...
0
votes
1
answer
199
views
VRP in CP-SAT (or tools) using all available vehicles, when a smaller number could have sufficed
I am solving a simple capacitated VRP with CP-SAT solver with 6 vehicles and 17 nodes. The issue that is happening is that the solution ends up using all 6 vehicles, when clearly a smaller number of ...
0
votes
0
answers
18
views
What does this GLPK output with a hashtag/pound sign mean?
I created a linear programming model using Pyomo, which I'm trying to solve via GPLK. If it matters, it's a spreadsheet assignment problem, where every variable is a binary variable representing ...
0
votes
0
answers
190
views
Adding custom variables to PyPSA objective function without requiring a change to optimize.py in base pypsa code?
I am modelling a network in pypsa with constraints that have statistically calculated RHS, meaning that there is always a chance of an infeasible solution (e.g. X > 10 & X < 9)
To get around ...
0
votes
1
answer
59
views
How to solve an infeasible column error in a linear optimization problem?
While trying to solve a linear optimization problem (say Scenario A) with CPLEX, I am getting
Infeasible Column ys.IM...G....044 error as shown below:
[![enter image description here][1]][1]
The ...
14
votes
8
answers
762
views
Finding solutions to linear system of equations with integer constraint in scipy
I have a system of equations where each equation is a linear equation with boolean constraints. For example:
x1 + x2 + x3 = 2
x1 + x4 = 1
x2 + x1 = 1
And each x_i is either 0 or 1. Sometimes there ...
-2
votes
1
answer
127
views
How to restrict float arithmetics in pulp or pyomo to specifically use float32
I need pulp or pyomo to do ALL arithmetic operations exclusively using float32.
It seems that the default they use is float64.
The following are 2 examples from both pulp and pyomo for the sum ...
0
votes
0
answers
105
views
pycddlib for finding all vertices in a polytope, python
I attempted to use **pycddlib ** to find vertices in a polytope with Python. I followed the code in this post.
Polytope, Python - find extreme points
import numpy as np
import cdd as pcdd
A = np....
1
vote
1
answer
87
views
Need hints for tuning scipy .linprog/.milp
I have a task to optimize the cost of a product, for example, by finding the optimal combination of cans of paint of different volumes and prices for coloring a given square.
The simplest example is:
...
0
votes
0
answers
34
views
GLPK LP solver called via cvxopt runs indefinitely
I'm using cvxopt.solvers.lp to solve a linear programs using the glpk solver. For the most part this works reliably, but every once in a while the solver seems to get stuck and run indefinitely. The ...
1
vote
1
answer
202
views
Working with large parameters in an integer linear program using pulp
In pulp's documentation https://coin-or.github.io/pulp/guides/how_to_debug.html, it says that
Check the precision of the numbers. If you have very big numbers (with a high precision), this generally ...
4
votes
2
answers
149
views
Numpy Matrix tiling and multiplication combination
I'm looking for a function capable of taking a m x n array, which repeats each row n times over a identity-like grid of m size.
For demo:
input = [[a1, b1, c1],
[a2, b2, c2]]
output = [[a1, ...
0
votes
0
answers
73
views
Cycling of Lexicographic simplex method
I am studying the cycling of simplex method. I know that there is a lexicographic rule to prevent looping of the simplex method, and I also know that this rule should be applied to a lexicographically ...
-1
votes
1
answer
81
views
Why am I getting this syntax error in AMPL? (beginner)
I am learning AMPL for a university project and i don't understand why i'm getting a syntax error, my code:
model:
set FOODS;
param calories;
param proteins;
param calcium;
param vitaminA;
param cost;
...
0
votes
1
answer
81
views
Why does lp() linear solver in R find a better solution when given a smaller subset of options?
Given a set of 140 options, my goal is to select the set of options that minimize the objective function and acheive a constraint that weight must be > 5584 units.
Criteria 1 is the objective ...
3
votes
2
answers
70
views
GEKKO Bin Balancing Optimization
I have a work-related problem that I am trying to solve using an optimization package like GEKKO. I am attempting to balance 3 bins of integers so that their sums are as close to each other as ...
1
vote
1
answer
93
views
Using Excel, return 1 for all values >0 WITHOUT using an IF
Working on a covering problem using solver in Excel. I have a matrix of adjacent cells, and a set of binary decision variables. I can use sumproduct() across the decision variables and each row of ...
2
votes
1
answer
149
views
Bottleneck transportation problem in a grid with pairing of two adjacent cells
While working on a personal project I stumbled into a problem that can be formulated as follows:
You have a grid with N rows and M columns. The table contains some red and some green cells. The goal ...
-2
votes
1
answer
134
views
Python Pulp Query - allocate task within timerange to achieve objective to minimize number of resource
Objective
Minimize the number of resource to handle all requirements
The input that we have is list of requirements which needs to be allocated to any one of the resource from list of resource that ...
1
vote
2
answers
436
views
Use more than 1 core when solving with mathopt (or tools) - HiGHS solver
I am interested in leveraging more number of physical cores when solving a MIP problem with mathopt.
Parallelization was easy with CP-SAT by setting the number of search workers
solver.parameters....
2
votes
1
answer
64
views
Gekko : Error in Resource Optimisation problem
I am working on a optimisation problem and I am using Gekko to solve it. Consider the scenario where there are 2 machines and 5 users and each machines has 2 resources to distribute to users. The user ...
0
votes
2
answers
203
views
LP Solver; Setting up model constraints for large number of chained dependency variables is slow
Creating the model is too slow. Solving it is not the problem here.
I have looked at a few similar questions before, but they don't have the problem from the size that I am giving it.
The constraint ...
0
votes
0
answers
102
views
Gurobi Pool Search Mode outputs same Solutions multiple times
I am currently working on lineplanning problems (linear progamming), f.e. described in https://www.researchgate.net/publication/225218930_Models_for_Line_Planning_in_Public_Transport.
I tried to ...
2
votes
1
answer
328
views
How to pickel (save model object) a Google or-tool's mathopt model object
I am building a model using mathopt library of or tools, and I want to save the model object as a pickle file (or any other suitable alternative). The use case for doing this is - underlying data ...
0
votes
1
answer
77
views
Integer Solver vs ExpressionsBasedModel.minimise()
I am trying to implement an integer solver using Ojalgo across time series data, with only first-order constraints and a linear first-order objective function. All my variables are integers. I am ...
0
votes
1
answer
90
views
Linear Programming Problem using lpSolveAPI
I am trying to create a linear programming model that will find the optimal mix of bonds to sell that maximizes book yield, exceed a certain market value, do not fall below a certain gain/loss amount, ...
0
votes
1
answer
171
views
How to create a binary on-off switch for 2 variables using glpk linear programming?
I have created a contrived example of my problem in an example here. It involves 2 water pipes which lead from a dam to a town. I want only 1 pipe to carry water over each timestamp, t.
I have created ...
1
vote
1
answer
89
views
Linear modeling issue using Scipy
I am trying to design a linear model with three features: the weekly prices of three different elements. And I need to combine these prices to get the cheapest combination for each week.
I used Scipy, ...
1
vote
1
answer
90
views
genetic optimizer using pulp library
Is it possible to solve a linear problem using the pulp library to create decision variables and write fitness functions and penalties using the Pypi genetic algorithm library? I have done this, but ...
0
votes
1
answer
85
views
Linear optimization - VBA - Count elements in Array
I am currently working on the following problem :
I have an array of j + 1 columns and i row with a first column serving to identify them (important for using this problem later on)
In each subsequent ...
0
votes
0
answers
43
views
Pulp. lpSum value dependencies in objective function
I am trying to select the best cable paths connecting each household (node "HH_") to the container (node "Cont_0") via pillar points (node "PP_"), that result in the ...