// Find the most negative coefficient in the objective function (ignoring
// the non-pivotable dummy variables). If all coefficients are positive
// we're done
terms.escapingEach(function(v, c) {
if (v.isPivotable && c < objectiveCoeff) {
objectiveCoeff = c;
entryVar = v;
// Break on success
return { brk: 1 };
}
}, this);
Unless I'm misreading the code, this find the first negative coefficient and then breaks, not the most negative coefficient.
Lines 758-768 of SimplexSolver.js read like this:
Unless I'm misreading the code, this find the first negative coefficient and then breaks, not the most negative coefficient.