CutSolver icon indicating copy to clipboard operation
CutSolver copied to clipboard

Weight equally good solutions by some metric

Open ModischFabrications opened this issue 10 months ago • 5 comments

There are often solutions with identical trimmings. Current code just picks one at random, but there could be a setting to prioritize based on secondary metrics.

  1. Most cuts of the same length in a row
  2. largest trimmings at once / largest distribution of trimmings
  3. ..?

ModischFabrications avatar Mar 30 '24 02:03 ModischFabrications

Only relevant for bruteforce! Other solvers won't look for other solutions

ModischFabrications avatar Mar 30 '24 02:03 ModischFabrications

For #52 : Could prioritize solutions that use less infinite material with equal trimmings

ModischFabrications avatar Apr 03 '24 16:04 ModischFabrications

#52: Sort by fewest leftovers, e.g. with a min_cutoff_length or similar.

ModischFabrications avatar Apr 07 '24 19:04 ModischFabrications

Side-effect of trimming only solvers, can't really be caught at the moment:

required = [500:1, 100:1] stocks = [900, 100:1]

A human would just pick the 100 stock and pass it on, but the solver is going to use 500+100 to minimize trimmings. This is mathematically more efficient because 300 trimmings with 1 stock is less than 400 trimmings on 2.

Future solvers could optimize for number of cuts and/or have adaptive weights based on {longest trimming, sum of trimmings, number of cuts, ...} instead, which would catch this, but could potentially leave more (but more usable) trimmings.

ModischFabrications avatar Apr 11 '24 21:04 ModischFabrications

nice to have: smarter ratings based on weights:

  1. Equal stocks higher than <10% trimmings difference
  2. the number of cuts
  3. infinite
  4. pattern reuse, ...
Bad solution

{
  "job": {
    "cut_width": 20,
    "stocks": [
      {
        "length": 2400,
        "name": "138200",
        "quantity": 1
      },
      {
        "length": 6000,
        "name": "138318",
        "quantity": 1
      }
    ],
    "required": [
      {
        "length": 1820,
        "quantity": 1
      },
      {
        "length": 666,
        "quantity": 3
      }
    ]
  },
  "solver_type": "bruteforce",
  "time_us": 473,
  "layout": [
    {
      "stock": {
        "length": 2400,
        "name": "138200"
      },
      "cuts": [
        {
          "length": 666
        }
      ],
      "trimming": 1714
    },
    {
      "stock": {
        "length": 6000,
        "name": "138318"
      },
      "cuts": [
        {
          "length": 1820
        },
        {
          "length": 666
        },
        {
          "length": 666
        }
      ],
      "trimming": 2788
    }
  ]
}

-> In the result both stock items are used, where it would be more efficient if all items were cut from the second stock item. It doesn't make a difference in waste, but a lot in handling.

ModischFabrications avatar Apr 27 '24 18:04 ModischFabrications