I have a project in my University I think the problem should be resolved by knapsack algorithm.
We have quadratic area with size:
n x n.
The size is coming from the command line. In the input file we are storing in the lines real numbers. Every of the numer is diameter(called "d") of the circle which we are going to set in our area. In every case the n size is greater then diamater. The file is containing lots of numbers so we have lots of cases to choose.
We need to create method "pack()" and implement inside the method the code which will get any circles from the file then will put them inside the area in the way that the area will be occupied with as many circles as possible( We need to occupied the highest possible value for n-area with the circles ). That means we are looking for those of data(circles) whose will replace the biggest part of our area.
I was thinking about that problem but didn't find any solutions. From my perspecive I need to modify knapsack algorithm, but no idea how. In my option the most important part will be to choose the alogrithm .
Could you guys point me to the proper algorithm? Any tips will be very appreciate, cause I'm wasted in that problem.