Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fractions in pattern counts #1

Open
agners opened this issue Jan 3, 2020 · 0 comments
Open

Fractions in pattern counts #1

agners opened this issue Jan 3, 2020 · 0 comments

Comments

@agners
Copy link

agners commented Jan 3, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant