Questions tagged [pulp]

PuLP is a linear programming module for Python.

PuLP is a linear programming module, written in Python. PuLP supports multiple open-source (e.g. the Coin-OR suite) and commercial solvers (e.g. Gurobi, CPLEX).

The Coin-OR suite with the integer solver CBC is included with the Python package.

Further reading

913 questions
-1
votes
1 answer

Writing Constraints in PuLP

I'm trying to write the following constraints in PuLP. Choose between A and B; I can select atmost one and can't select both. There are a total of 10 variables A-J. Out of A-F, I have to select at least 3 in my solution. Can you please…
aseem puri
  • 61
  • 1
  • 7
-1
votes
1 answer

Tkinter entry arguments : takes 0 positional arguments but 7 were given

I'm trying to create a program using PuLP library that when you hit the button it solves a linear problem and outputs values. So this is what I get when I tried to optimize my input values: TypeError: problem() takes 0 positional arguments but 7…
M.Malah
  • 21
  • 2
-1
votes
1 answer

Python Constraint

I am looking to find the best replacement item for an old item. An old item can have several potential options for replacement items. I want to only choose one replacement item for each old item. So in data form lets say that the color is the old…
-1
votes
1 answer

How to create decision variables in R for linear programming?

How should i create a list of n variables indexed by nth index(string - key) For example X['one'] should be treated as decision variable with index value 'one'. After creating the decision variable - Assuming there are two decision variables X(list…
-1
votes
1 answer

PYTHON, if-statement meets only first condition. PuLP

I am trying to use PuLP to optimize a system, minimizing the cost of it. I am using multiple If's and the problem is that it always meets the first condition. Here is my code. I hope someone can help me, as I am just starting to learn about this…
-1
votes
1 answer

Getting error while solving LPP in python

The script I am using for solving LPP is following: Script: # Import PuLP modeler functions from pulp import * # Create the 'prob' variable to contain the problem data prob = LpProblem("The Whiskas Problem",LpMinimize) LpVariable("example", None,…
chunky
  • 75
  • 1
  • 2
  • 11
-2
votes
1 answer

How to save the report made by solver in pulp as a text file

I want to save the report( if you run it for example in vscode it shows a report in the terminal) made by a solver like CBC in python's pulp package as a text file automatically . Any ideas? Is it even possible? I've read the documentation but I…
Emad
  • 155
  • 1
  • 7
-2
votes
1 answer

How do i fix "invalid error" in python 3?

My programm show one error about syntax of the following line code: runfile('D:/Mon Amour/Codes HPP and Thermal/My World/codes of hydro/Gurobi_python_hydro_scheduling/Gurobi_Python_Hydro_Scheduling-master/SDDP_Model.py', wdir='D:/Mon Amour/Codes HPP…
-2
votes
1 answer

Scipy and pulp which will be better if using cplex solver

Which among python libraries like pulp and Scipy , has the capability to work with Cplex solver .If we have huge constraints and datasets for optimisation in supply chain .
-2
votes
1 answer

How solve this MILP problem with Pulp Python module?

I think I'm facing a Milp problem but I'm not sure. The problem in a simplified form is: There are 3 suppliers of materials (trucks) for 3 cities. The real problem is 30 Suppliers and 100 cities... Supliers capacity: a:1; b:2; c:3. Cities Demand:…
-2
votes
1 answer

Converting Julia JuMP to Python PuLP

I stumbled upon a piece of software that I'd like to convert from Julia to Python (don't have much experience with Julia). The main problem I'm having is I don't understand exactly what is going on in the section I've marked with comments #PROBLEM…
-3
votes
1 answer

Manufacturer cost optimization Python solver PuLP scipy

I have the following optimization problem: I want to minimize the cost of buying products from various suppliers. Prices of the products vary depending on supplier. Additionally, each supplier has their shipping cost. Shipping cost can be discounted…
Malcolm
  • 21
  • 3
1 2 3
60
61