swasun / cuttingstockproblem Goto Github PK
View Code? Open in Web Editor NEWA simple program that computes the Cutting Stock Problem using the glpk library
License: MIT License
A simple program that computes the Cutting Stock Problem using the glpk library
License: MIT License
I tried making use of this project to cut stock in a real world application but realized that it returns pattern counts with fractions. This is not really practical for what I try to use it.
E.g. the Wikipedia example:
$ cat wikipedia.txt
5600
1380 22
1520 25
1560 12
1710 14
1820 18
1880 18
1930 20
2000 10
2050 12
2100 14
2140 16
2150 18
2200 20
$./bin/cutting_stock wikipedia.txt
Execution of the algorithm in 0.020760s.
Pattern { 4x1380 } x 0.250000
Pattern { 3x1820 } x 0.666667
Pattern { 1x1380 2x2100 } x 7.000000
Pattern { 1x1560 1x1880 1x2140 } x 7.000000
Pattern { 2x1710 1x2140 } x 3.000000
Pattern { 1x1380 1x2050 1x2150 } x 4.000000
Pattern { 1x1380 1x2000 1x2200} x 10.000000
Pattern { 1x1520 1x1930 1x2140 } x 6.000000
Pattern { 1x1820 2x1880 } x 3.000000
Pattern { 1x1710 1x1820 1x2050 } x 8.000000
Pattern { 1x1520 1x1880 1x2200} x 5.000000
Pattern { 1x1520 1x1930 1x2150 } x 14.000000
Pattern { 1x1560 1x1820 1x2200} x 5.000000
Objective value : 72.916667
The first two pattern return a fractional count. In this case they actually can be combined and lead to a pretty good optimization nonetheless, but this is not always the case.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.