emadehsan / csp

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

Multithreaded Computation or slow CPU #6

Open TheDammedSon opened 3 years ago

TheDammedSon commented 3 years ago

Hi,

I'm really like this approach to the problem.

The thing is when I use big sets of small rolls (typically around 70 units) it's freezes. My question is my computer slow ( i5-4460 with 8 Gb of RAM) or is this computation single-threaded?

How can I work is around?

Thank you in advance

emadehsan commented 3 years ago

Hi @TheDammedSon,

This code is actually expansion of Serge Kruk's code: cutting_stock.py, the code accompanying his book Practical Python AI Projects. Which is meant for learning rather than production usage.

In Optimization Problems like Cutting Stock Problem, the time to solve the problem (as well as problem space) increases exponentially with the increase in input size.

I think your machine is good. This implementation is not optimized for higher inputs or multi-threads.

The work around is to either use some production ready Cutting Stock Solver or learn OR-Tools and optimize this Cutting Stock Solver.

Helpful links:

emadehsan commented 3 years ago

@TheDammedSon if you successfully increase the speed of this algorithm, please feel free to create a Pull request.