bintprog intermittent error: "x0 is not dual feasible"

I have a "simulation" put together in MatLab that randomly generates some project profiles and resource requirements. The end of each iteration has a call to bintprog to do a classic knapsack problem and find the set of projects with the greatest overall value that fit within some resource constraints. The simulation iterates through a design of different distribution parameters, and runs a bunch of iterations at each design point. It worked fine when I was running 30 iterations at each design point. I later increased to running 100 iterations at each design point, and ever since then I encounter the subject error: "x0 is not dual feasible". There is no pattern to when it occurs...sometimes after a few hundred total iterations, sometimes after several thousand. I tried specifying a starting point of all zeroes which would by definition be feasible since there are no equality constraints, but still I encounter this error. I'm at a loss for how to proceed....
Here's the relevant code snippet
a = [inventory(:,2) inventory(:,1)]';
b = [5000 100];
values = -1*inventory(:,7);
x0=zeros(1,length(values));
x = bintprog(values, a, b,[],[],x0);

1 Comment

i have the same issue.
did you got an answer how to solve it ?

Answers (0)

This question is closed.

Asked:

on 5 Apr 2012

Closed:

on 20 Aug 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!