I will start by giving the data that I have available. I have a list of rectangles of all different sizes, some small, medium, and large. I also have different sizes of glass that these rectangles must be cut out of. I am trying to use as much of the glass as possible, for the highest yield. First, there is one factor that must be taken care of. There must be a single line that runs either horizontal or vertical, all across the glass. after this factor is met, the remaining area is filled with the remaining rectangles. Then once there are no more rectangles that will fit, we see what the yield is and try another combination of rectangles, and then compare the yields, going with the highest yield. I am looking to have several different combinations, but I do not know how to go about creating them, or how I could re-create them once the one with the largest yield is found. Could anyone please help me?? Thanks.
For example, let's say I have 80 rectangles 40 small, 27 medium, and 13 large. All of the small are not the same size, but are "small" in comparison. I would like to avoid having all of the small rectangles on one sheet and we will say that one sheet can hold about 20 medium, 30 small, or 10 large. I am looking to use either the x, or y dimension to first create this straight line, either horizontal or vertical. Then fill in the remaining area. I hope that this makes sense, and that I can get some help. Any help would be greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.