Skip to main content

All Questions

0 votes
1 answer
28 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 ...
Trev's user avatar
  • 23
0 votes
1 answer
86 views

How to define multiple indices for Gurobi with Python API where indices are of different data types and depend on each other?

I'm quite new to Gurobi and Python and I came across a following problem. Given are sets: import pandas as pd I = pd.DataFrame(index = ['i0', 'i1', 'i2', 'i3', 'i4']) L = [('k0', 'j2'), ('k0', 'j3'),...
Aleksandra Petrenko's user avatar
0 votes
1 answer
45 views

Trying to Optimize Process Using Linear Programming. Getting error about: IndexError: index 1 is out of bounds for axis 0 with size 1

I am trying to optimize worker's schedules, based on the following dataframe. Time Windows Shift 1 Shift 2 Shift 3 Shift 4 Workers Required 0 6:00 - 9:00 1 0 0 1 ...
ASH's user avatar
  • 20.4k
-1 votes
1 answer
216 views

Gurobi implementing a constraint with the sum of the multiplication of sums with python [closed]

I am using gurobi with gurobipy to implement a linear programm. While implementing the following constraint, I get a failur. With and and as indices sets. My minimal example looks like import ...
Mike's user avatar
  • 13
0 votes
0 answers
56 views

How to add non-linear objective function in or-solver

Here is the scenario: There are n boxes with various capacity at the beginning of each box before assigning. I want to fit x parcels into the boxes, letting the capacity after assigning for each boxes ...
hkisthebest's user avatar
0 votes
0 answers
58 views

Python: Linear Programming using Pyscipopt

I am optimizing a transportation problem where I want to determine which warehouse to service which customer. Is there a way to set up the constraints so that a customer's demand can only be ...
Jessica Wen's user avatar
0 votes
1 answer
348 views

Optimization Pyomo Python - 'SumExpression is not iterable'

I am new to Python and I cannot seem to solve the problem I am having, even after going through similar problems posted on the forum. My problem is that I get the ''SumExpression' object is not ...
mcj123's user avatar
  • 3
5 votes
1 answer
2k views

Non-optimal result from MIP program in Google OR Tools

I was working on a sample MIP program, a selection of a coed sports team starting lineup, and found a small example that comes up with a non-optimal result in Google OR-tools. The basics: Choose 5 ...
Leonard Armstrong's user avatar
1 vote
1 answer
227 views

Python Constraint Optimization Issue

I am working on a Fantasy Football program and having an issue with a constraint. A fantasy team is made up of 1QB, 2RBs 3WRs 1TE, 1DEF and 1FLEX (which can be a RB, WR or TE) My output is duplicating ...
RedbirdFan23's user avatar
0 votes
1 answer
155 views

How to introduce a variable in pulp environment of Python

I have two sets. S = Sources = {S1, S2, S3} D = Desinations = {D1, D2, D3} I have to minimize the total transportation cost subject to some constraints. I am using the pulp in Python. How can I ...
Manglu's user avatar
  • 266
2 votes
1 answer
3k views

Receiving AttributeError: 'NoneType' object has no attribute 'actualSolve' when using pulp

I'm getting this error when I'm trying to plot linear programming equations on Jupyter Notebook using Pulp. AttributeError: 'NoneType' object has no attribute 'actualSolve' Context:
user avatar
0 votes
1 answer
176 views

Constrained optimization over a grid while maintaining proportions

Suppose I have a user/item grid like this: item_1 item_2 user_1 v_11 v_12 user_2 v_21 v_22 user_3 v_31 v_32 Where each user/item pair has a value, as captured in the grid. ...
Rohan Kadakia's user avatar
0 votes
1 answer
275 views

FileNotFoundError while using PuLP in Python

I am trying to solve Linear Programing Problem through PuLP in pyhthon. I have declared the problem (by name prob) without any error: MAXIMIZE 20*x1 + 30*x2 + 0 SUBJECT TO _C1: x1 + 2 x2 <= 100 ...
Single Handed Sailor's user avatar
0 votes
1 answer
97 views

How can I maximize a function?

How i can maximize an objective function? I have a list of customers and each of them can be "activated" in three different ways. n= 1000 df = pd.DataFrame(list(range(0,n)), columns = ['Customer_ID']...
Gianluca Brunetti's user avatar
0 votes
0 answers
87 views

How to call numpy solver to minimize a obj_func with constraints

I'm trying to solve a linear equation problem with constraints but I have no idea of how to call the solver. I'm using a function that I wrote called covariancia but there's no problem with it, so I'...
Thomas Leick's user avatar

15 30 50 per page