Click here to Skip to main content
15,887,273 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have an irregular shape polygon in which I want to fit 'n' number of rectangle with known area of all the rectangle. The area of rectangle are not same. The other constraints is that sum of area of all the n rectangle is equal to the area of irregular polygon. How to do it in python and what should be the approach?

What I have tried:

I just got stucked, not getting any idea that what should be the approach.
Posted

1 solution

This is a mathematical problem, and needs to be addresses as such. See Knapsack problem - Wikipedia[^]
 
Share this answer
 
Comments
CPallini 11-Dec-23 5:41am    
5.
Andre Oosthuizen 11-Dec-23 13:52pm    
My 5 as well, sounds very close to a given task and not much info - back to basics.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900