PuLP: Check whether the solution satisfies the constraints
<p>So I ran CBC through pulp for 5 seconds and it gave out a solution but I am not sure it satisfies all the constraints. The value for each variable
is stored in <code>prob.variables()</code>. Is there a way I could run a similar code as the one below to check if the solutions satisfy the constraints given in <code>prob.constraints</code> - i.e. the solution is feasible ?</p>

<pre><code>prob.solve(PULP_CBC_CMD(maxSeconds=5))

print 'Optimization status: %s' % LpStatus[prob.status]

for v in prob.variables():
    test whether 'v' satisfies prob.constraints 
</code></pre>

<p>The setup of the problem and the constraints are very similar to the one given here: <a href="https://github.com/coin-or/pulp/blob/master/examples/BeerDistributionProblem.py" rel="nofollow">github_code</a></p>

<p>Cheers.</p>