question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cutting Stock and Unexpected Result

See original GitHub issue

The following model generates an unexpected result:

{
  "optimize": "cost",
  "opType": "min",
  "constraints": {
    "length": {
      "min": 25
    }
  },
  "variables": {
    "21": {
      "21": 1,
      "length": 21,
      "cost": 75
    },
    "26": {
      "26": 1,
      "length": 26,
      "cost": 90
    },
    "31": {
      "31": 1,
      "length": 31,
      "cost": 105
    },
    "36": {
      "36": 1,
      "length": 36,
      "cost": 120
    }
  },
  "ints": {
    "21": 1,
    "26": 1,
    "31": 1,
    "36": 1
  }
}

The result I get is:

{  
   "26":-0,
   "36":1,
   "feasible":true,
   "result":120,
   "bounded":true
}

What I’m trying to do is find the minimum number of panel lengths required to cover at least the minimum overall required length (the length of a building) while minimizing final cost of the panels. I believe this is a variation of of the cutting stock problem. In this case, the minimum required length is 25. I would expect the solver to return a result of “26”: 1 rather than “36”: 1. The cost in that case would be 90 rather than 120.

I’m assuming I constructed the model incorrectly somehow. Is it possible to achieve my intended result with a modification to the model?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lvenerosycommented, May 22, 2017

This is a problem with the MIR cuts. Inside src/Model.js in the constructor Model, you can change this.useMIRCuts = true; to false. I am not sure of when I will be able to patch it though.

0reactions
JWallycommented, Oct 3, 2019

I’m think I got this cleaned up and am going to close. Feel free to re-open if I missed something.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Biggest Tree i've cut in a while, unexpected result - YouTube
this big rotten cedar tree was a little challenging to keep in lay . but an unexpected gift showed up .
Read more >
Mathematical models for the two-dimensional variable-sized ...
According to Wäscher, Haußner, & Schumann (2007), the addressed problem is a Cutting Stock Problem (CSP), as the demand for each item is...
Read more >
Why Would a Company Drastically Cut Its Dividend?
Companies usually make drastic dividend cuts because of financial challenges like declining earnings or mounting debts. Sometimes companies may cut dividend ...
Read more >
(PDF) Cutting Stock Problems - ResearchGate
This paper describes an attempt to solve the one-dimensional cutting stock problem exactly, using column generation and branch-and-bound. A new ...
Read more >
Solving 2D cutting stock problems with genetic algorithms (AI)
The cutting stock problem is the problem of cutting certain pieces of stock material into pieces of specified sizes while minimizing the material...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found