Closed alhambra1 closed 5 years ago
Are you looking for a subset of mixed-integer-LPs or just plain LP's?
At the moment, I'm using it with integers only.
On Mon, 28 Oct 2019, 9:54 pm Justin Wolcott, notifications@github.com wrote:
Are you looking for a subset of mixed-integer-LPs or just plain LP's?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JWally/jsLPSolver/issues/93?email_source=notifications&email_token=AANRFJPGLA3PUSH7SN6LLETQQ6JUXA5CNFSM4JAFS4GKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECO62AI#issuecomment-547220737, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANRFJJ2AGYSLANQQOV6KMLQQ6JUXANCNFSM4JAFS4GA .
This if block, between 161 and 175 is where the MILP has a valid solution. You could add the following bit of code there:
//
//
//
//
//
//
var nowSolution = (this.model.tableau.getSolution());
var store = nowSolution.generateSolutionSet();
store.result = nowSolution.evaluation;
if(!this.model.solutions){
this.model.solutions = [];
}
this.model.solutions.push(store);
//
//
//
//
//
//
//
and access them like this:
var a = solver.Solve(model,1e-8,true);
console.log(a._tableau.model.solutions);
Thank you so much. I really appreciate it!
On Wed, 30 Oct 2019 at 15:43, Justin Wolcott notifications@github.com wrote:
This if block, between 161 and 175 is where the MILP has a valid solution. You could add the following bit of code there:
// // // // // // var nowSolution = (this.model.tableau.getSolution()); var store = nowSolution.generateSolutionSet(); store.result = nowSolution.evaluation; if(!this.model.solutions){ this.model.solutions = []; } this.model.solutions.push(store); // // // // // // //
and access them like this:
var a = solver.Solve(model,1e-8,true); console.log(a._tableau.model.solutions);
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JWally/jsLPSolver/issues/93?email_source=notifications&email_token=AANRFJM5M7K5ZE4VCAIU2UDQRHPVHA5CNFSM4JAFS4GKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECVQYUI#issuecomment-548080721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AANRFJLLTUBJNMYCEWM4H7TQRHPVHANCNFSM4JAFS4GA .
FWIW, it doesn't seem to slow down the solver too much; so its an option you can get at through:
{
"options": {
"keep_solutions": true
}
}
which puts the solutions on _tableau.model.solutions.
Next update I send, it'll be in there :-)
Hope it helps!
Hi,
Is there a way to retrieve a subset of optimal solutions rather than just one? If you could even point me towards where to look to possibly tweak to accomplish that, that would be great.
Sincerely,