GetNoticed DEV#7: 82% Not bad…

Hi there!
As promised in my previous dev post: I have performed series of test how efficient the algorithm is and the results are satisfactory – average of 82% utilisation.

To measure the efficiency I ran 10 iterations of randomly generated set of rectangles. The size of the panel was fixed to 1500×3000 as this is standard size of sheet and most commonly used – at least that is my experience. Exact size of items was generated randomly, however there were some constraints to make the test more life-like. The list below illustrates that:

  • 15 items of size 50 to 60% panel size
  • 20 items of size 30 to 40% panel size
  • 30 items of size 20 to 30% panel size
  • 50 items of size 5 to 20% panel size

The number of panels was limited to 10 – this is to avoid having last panel filled only in quarter or half; the test is to check how densely the algorithm can pack items. In real application it is common to that the last panel is used only in fraction.

To perform the test I used xUnit. I wrote a unit test which doesn’t assert anything, just print the output string.

As written at the very beginning the average utilisation is around 82%. I find that value satisfactory. Here’s quick extract from the report with most important figures:
Overall average utilisation: 0.8226
Overall max utilisation: 0.838
Overall min utilisation: 0.807
Single panel max utilisation: 0.911
Single panel min utilisation: 0.694

The algorithm performs sufficiently well. At this point I won’t look for further improvements.

Thanks, Michal

Report in xlsx
SheetMetalArranger on GitHub