@ganeshgatkul1 wrote:
if 600 width is not fitted then it pick from any width which is early mention
....
I'm afraid that criterion is too loose. It would be possible with a random number generator to pick "any width" that will fit, but the choice could be any of them, including the narrowest. It may be possible to restrict it to choose at random from only those that come sooner in the list, but how many of them should be allowed?
And I assume you want the result to include only those widths in a way that adds up to the overall width exactly, if possible. If what is left after some 600-wide rectangles is 335 units as in your lower example, I assume you would not want it to put in a 300-unit width and have only 35 units remaining. Rather you would want to use 200+135 as shown there, or some other combination that adds up exactly. There are a lot of them -- 225+110, 195+140, 190+145, 185+150, 180+155, 175+160, 170+165, 135+100+100, 125+110+100, 120+115+100, 115+115+105 -- but which combination should it use?
How it would find a combination with the correct total is also a challenge. That would be much easier if the intervals between numbers in the list were regular in some way, but they vary all over the map, and not in any regular way -- 100, 50, 50, 40, 10, 50, 20, 5, 15, 10, 10, 15, 25, 5 [and the rest are all 5].
It would be much easier if you can give some criteria that are specific.
Kent Cooper, AIA