# Tag Info

### How do I access the value of a variable in PuLP?

To get the value of the decision variable, you need to use the varValue property of the LpVariable, so: ...
• 13.1k
Accepted

### Complicated constraint with logical operators in PuLP

Suppose your two arrays are indexed by $I$ and $J$, and let $x_i$ be the binary variable. zero or one elements may be selected from first array: $$\sum_{i\in I} x_i \le 1 \tag1$$ zero, one, or many ...
• 33.1k

### "Out of the box" Mixed Integer Programming Heuristics

You can solve your model via the NEOS server which provides Gurobi, Cplex, and other solvers for free if it is the matter of not having a solver. I am not familiar with PuLP but I know it is easy to ...
• 8,677

### Change coefficient in PuLP

If the model in PuLP is: ...
• 1,355
Accepted

### How to call HiGHS solver from python PuLP MIP?

PuLP has an API for HiGHS but that version is not sent to pip yet. For the time being, you should pip install PuLP from Github. See the command taken from their readme below. (ps. You might need to ...
• 351
Accepted

### Read an LP/MPS file in the PuLP

According to PuLP's documentation, it seems that load_file function in PuLP's Amply class can only handle AMPL files with a ...
• 512
Accepted

### Find the list with the fewest elements whose cumulative sum reaches threshold

Your model basically reads as \begin{align*} \min \quad n \quad \text{s.t.} \quad \sum_{k = 0}^{n} l_{i,k} \geq b_i \cdot \epsilon, \quad \sum_{i \in L} b_i = 1, \end{align*} where $l_{i,k}$ is ...
• 1,572
Accepted

### How to set these constraints in a linear optimization problem (PuLP)?

The rule "works on Saturday implies works on Sunday" can be expressed as $$(D_{i,6} \lor N_{i,6}) \implies (D_{i,7} \lor N_{i,7}),$$ which can be rewritten in conjunctive normal form as follows: \...
• 33.1k
Accepted

• 33.1k
Accepted

### How to generate multiple solutions to linear program in Python?

When I understand your question correctly you are not interested in the full solution space. In that case you can generate alternative optimal solutions by first solving your problem to optimality. ...
• 701
Accepted

### Python Pulp - LpMinimize Not Returning Expected Output - Scheduling Problem

First, it is confusing when you say The final solution does not satisfy the workforce requirements for the various time windows, it's substantially short. Only 5 shifts are filled in total. You do ...
• 13.6k

### Designing a multi-commodity network flow optimizer

Question 1 You could simply use the priority function as the cost function on the arcs. This way, it is for example cheaper to ship a commodity to $D_1$ from $W_2$ ($1$ unit of cost per unit of flow) ...
• 13.6k
Accepted

### Subtour elimination implementation (DFJ) using Python (PULP). While loop never exits

In constraint ...
• 2,643

### Any Idea why PuLP is ignoring binary variables?

You need to capitalize the first letter in the cat option: ...
• 1,716

### How to generate multiple solutions to linear program in Python?

Your problem does not have any objective function, so you do not have to use software to solve linear programs here. It is just a system of linear inequalities. (Of course, you still can use LP tools ...
• 566