drvinceknight / amwoss

Applied mathematics problems with Open Source Software: Operational Research with Python and R.
MIT License
117 stars 10 forks source link

Exam scheduling r #43

Closed geraintpalmer closed 3 years ago

geraintpalmer commented 4 years ago

@drvinceknight

Please could you review this code.

The lpSolve model works whemn there are no binary constraints. It runs forever (I crash it after 5 hours) for binary constraints required. At the bottom I plug in a solution from PuLP to chekc this is not infeasible, and it seems fine.

drvinceknight commented 4 years ago

The lpSolve model works whemn there are no binary constraints. It runs forever (I crash it after 5 hours) for binary constraints required.

Yeah this is hanging for me also... :(

Ran no problem with:

sol <- lp("min", f.obj, f.con, f.dir, f.rhs, all.bin = FALSE)  # Notice all.bin = FALSE. We need this to be TRUE, but it takes forever.

but as soon as I ran:

sol <- lp("min", f.obj, f.con, f.dir, f.rhs, all.bin = TRUE)  # Notice all.bin = FALSE. We need this to be TRUE, but it takes forever.

I haven't looked too closely at the code itself but have you managed to get a smaller version of the problem working with all.bin=TRUE? (Even nonsensically small?)

Worth us having a chat perhaps to see what we can do...

Don't worry we'll figure it out :)

geraintpalmer commented 3 years ago

Closing this as we're now using ROI for linear programming in R not lpSolve.