Git Product home page Git Product logo

cuttingstockproblem's People

Contributors

swasun avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

agners

cuttingstockproblem's Issues

Fractions in pattern counts

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.