Skip to main content

All Questions

1 vote
2 answers
177 views

Using linear optimisation, how do I minimize the Total Cost in a dataframe [closed]

I have a Pandas dataframe with 3 columns (Product, Weight, Total Cost) as follows (expanded to make it clearer): df = { 'Product': ['Product 1', 'Product 2', 'Product 3', 'Product 4', ...
t24opb's user avatar
  • 21
0 votes
1 answer
224 views

How can I write a pyomo constraint/rule with conditions checked against boolean values within the model data?

I'm attempting to solve a battery problem using Pyomo. I'm attempting to tell the model that the battery can only discharge during certain hours of the year. I've implemented this by create a boolean ...
masebee's user avatar
  • 25
0 votes
1 answer
128 views

How to - finding solution for variables in many matrices with multiple constraints using Python w/ Gekko?

this is my first post here. I have a real-life financial Budgeting problem. Having a total Budget values for BusinessUnit per each of 30 countries in my scope plus 4 quarters, I need to distribute (...
JS_DA's user avatar
  • 21
1 vote
1 answer
5k views

PulpSolverError Pulp: Error while executing

I am trying to solve a Linear programming problem by using the PuLP library. After defining the problem correctly, when I run the solver (CBC) I get a very strange error. PulpSolverError: Pulp: Error ...
Key's user avatar
  • 45
0 votes
1 answer
137 views

Efficient allocation of limited resources (max profit, all possible combinations list)

I want to find the allocation combinations of resources that are the most profitable through limited resource allocation, and make a list of possible combinations. In other words, I want to find the ...
user17276678's user avatar
0 votes
0 answers
72 views

Python Slotting/Sorting

I have below sample data. What i want to do is sort the dataframe such that: Each category under P1,P2,P3 are split equally between 1H and 2H. Where it cannot split equally - keep the higher portion ...
Manny's user avatar
  • 63
1 vote
0 answers
127 views

How to implement 2D interval scheduling in Python?

I have a problem that is similar to the conventional interval scheduling algorithm but it's two dimensional, so I have another metric (length) to take into account. My dataset format: Cars with the ...
Notme lex's user avatar
0 votes
1 answer
343 views

Solve linear programming python problem using Pulp

basically i'm trying to make each destination have only one origin all destinations must have only one source and not all origins necessarily have to be used I hope someone could help me, I know that ...
Felipe Lucio's user avatar
2 votes
1 answer
747 views

Python Pulp - Number of Unique Teams Constraint

I am new to Pulp and therefore have been encountering a problem when trying to make a conditional constraint. I have made a fantasy football optimizer that picks the optimal selection of 9 players, my ...
gasbaitlad's user avatar
7 votes
2 answers
1k views

Linear Programing- Max value optimization

I'm trying to find the best possible combination that will maximize my sum value, but it has to be under 2 specific constraints, therefore I am assuming Linear programming will be the best fit. The ...
Galgo's user avatar
  • 71
0 votes
1 answer
2k views

Python PuLP Optimization problem for Fantasy Football, how to add Certain Conditional Constraints?

It is currently my first time using the PuLP library in python. The purpose of diving into this library was to make a fantasy football solver in python. I have successfully made the solver but cant ...
gasbaitlad's user avatar
0 votes
1 answer
107 views

Select optimal columns that sum up to a value while minimizing another

I have a grid of predictions from a machine-learning model. I would like to select the optimal set of predictions that follow 3 criteria. The id column cannot be repeated The sum of column x needs to ...
David's user avatar
  • 2,697
2 votes
2 answers
309 views

Allocation wrapper in python

I am new in python and have output of simple LP problem. In this problem, several PART's make a House and several house make a society. There are house and society level target on delivery. If the ...
Rocky's user avatar
  • 105
1 vote
1 answer
284 views

Automate shift times whilst accounting for constraints

I have a script that produces automated shift times based on availability and various constraints. These being: At any given time period, you must meet the minimum staffing requirements A person has ...
jonboy's user avatar
  • 392
0 votes
2 answers
3k views

How to fix constraints for allocation optimisation in PuLP python

Background: I am trying to allocate customers Ci to financial advisers Pj. Each customer has a policy value xi. I'm assuming that the number of customers (n) allocated to each adviser is the same, ...
James 's user avatar
  • 368

15 30 50 per page