pulp

Is pulp.lpDot(a,n) not equivalent to pulp.lpSum([a[i] * n[i] for i in range(N)])?

Is pulp.lpDot(a,n) not equivalent to pulp.lpSum([a[i] * n[i] for i in range(N)])? Question: I have a decision variable vector n, and a is a constant vector. What confuses me is why lpDot(a,n) is not equivalent to lpSum([a[i] * n[i] for i in range(N)]) in a constraint? Here is the code: import pulp import numpy as …

Total answers: 1

How do I enforce mutual exclusivity for an LP problem using PuLP?

How do I enforce mutual exclusivity for an LP problem using PuLP? Question: I made the following LP problem formulation in PuLP. We have an objective function with 5 decision variables, each with bounds. We also have 5 binary variables for each decision variable, in order to enforce mutual exclusivity between the first 3, and …

Total answers: 1

Python Linear Programming Binary exclusive or choose only one group

Python Linear Programming Binary exclusive or choose only one group Question: I am trying to identify the designers with best cost to finish the complete dress. The Conditions: Need to get complete dress Either Paul1 or Paul2 can be selected but not both even though the combination of these two could be the best cost. …

Total answers: 2

PuLP Conditional Sum based on key of the loop

PuLP Conditional Sum based on key of the loop Question: I am trying to use this conditional sum in Pulp’s objective function. For the second lpSum, I am trying to calculate the costs of when we don’t have enough chassis’ to cover the demand and will need pool chassis’ with a higher costs. Of course, …

Total answers: 1

PuLP linear programming problem is infeasible

PuLP linear programming problem is infeasible Question: I am writing a Linear Programming problem to help generate daily fantasy lineups. The goal is: Maximize Fpts projection The constraints are: Salary (Maximum 50,000) Positionality (Have to have 1 PG, 1 SG, 1 SF, 1 PF, 1 C, 1 G, 1 F and 1 UTIL player) where …

Total answers: 1

PuLP Optimization Problem: fitting items into crates with restrictions

PuLP Optimization Problem: fitting items into crates with restrictions Question: I would like some assistance with an optimization problem in Python.. Here is some background: Objective is to minimize the number of Crates (c) needed while satisfying Unit_ids (u) needed. Each crate contains any number (from 0-inf) number of different types of Units, with varying …

Total answers: 1

Creating a conditional constraint for a specific Python Pulp Maximization problem

Creating a conditional constraint for a specific Python Pulp Maximization problem Question: I can’t manage to find a way to create a constraint that sounds like this: for example I have 2 variables, one is a regular product and the other one is a super rare product. In order to have a super rare product, …

Total answers: 1

Pulp Python problem setting constraints when summing values in a column

Pulp Python problem setting constraints when summing values in a column Question: Hi this is my first question here so go easy on me if I format things incorrectly. I’m trying to model a table where each value is either 1 or 0. I’d like to determine whether the sum of a column is 0 …

Total answers: 2