I have a number of rectangular, I want to find the smallest rectangular which can cover all small ones. no rotation is allowed.
Using brute force I want to find my answer. I am trying to code it in java. I know I should check all permutation of my n items and find the least area. And in order to make it easier first I tried to find min possible area. Then I used a 2 dimensional array with Boolean values to check if each cell is occupied or not. But I could not figure it out (code it).
How to check if my items can be placed in my limited area? For example I located my first item in x[0][0]
to x[10][1]
and make all cell in this range true, but I don't know how to tell my program to check other cell for next item. Can you tell me about steps which my algorithm need to implement?