Get multiple solutions for 0/1-Knapsack MILP with lpSolveAPI
Reproducable Example: I described a simple 0/1-Knapsack problem with lpSolveAPI in R , which should return 2 solutions: library(lpSolveAPI) lp_model= make.lp(0, 3) set.objfn(lp_model, c(100, 100, 200)) add.constraint(lp_model, c(100,100,200), "<=", 350) lp.control(lp_model, sense= "max") set.type(lp_model, 1:3, "binary") lp_model solve(lp_model) get.variables(lp_model) get.objective(lp_model) get.constr.value((lp_model)) get.total.iter(lp_model) get.solutioncount(lp_model) Problem: But get.solutioncount(lp_model) shows that there's just 1 solution found: > lp_model Model name: C1 C2 C3