emadehsan / csp

Algorithm for Cutting Stock Problem using Google OR-Tools. Link to the tool:
https://emadehsan.com/csp/
MIT License
132 stars 38 forks source link

Adding optional variable to the model solver #18

Open Tyler0Akers opened 2 years ago

Tyler0Akers commented 2 years ago

Hello Emad,

Thank you for putting this together - and introducing me to Serge Kruk's book, it's been extremely helpful on a current project.

One question I'm exploring, is how to add optional variable inputs (optional constraints) to the solver, i.e., a second input list of Size(s), setting these to optional, and letting the solver increase the quantity until a certain condition is met?

For example, add rolls of a size to minimize waste up to a set maximum # of rolls? I have a rough idea, but wondering if this has already been thought out.

emadehsan commented 1 year ago

@Tyler0Akers sorry for late response. I did do experiements and tried to extend it to 2D but could not come up with a perfect plan for 2D CSP (in my case).

I would really recommend the ortools guide, it is more explanatory than I expected when I was learning ortools. Asking your question (ideally with some code) on StackOverflow sometimes attracts the author of ortools to answer