## Problem:

Let have N PCBs with rectangular form with size X Y. Make code which inputs the Number of PCBs and their size Xn Yn and the minimal space between the PCB borders on the panel m in millimeters, then arrange the PCBs on panel with minimal area.

## The rules:

You can code the solution in any programming language during the weekend and have to submit it to info@olimex.com latest on Sunday November 10th.

On Monday we will upload the solutions on GitHub https://github.com/OLIMEX/WPC

You can play with your real name or with nick if you want to be anonymous, we will not disclosure your personal info if you do not want to.

1. Thats not a challenge, thats a trick question, right? Without a given size for the outer PCB (where the other have to fit) there is only one simple solution – make one large PCB with all sub PCB side by side, connected at min(X,Y). Waste total will be (num(boards) -1) * min(X,Y) * m

• I agree, there has to be some sort of second constraint, perhaps the width is fixed/parameterized or there is a maximum to the ratio between the dimensions of the main board. Alternatively, as the photo suggests, the individual boards all have different (rectangular) dimensions Xn Yn (as also per sentence 2), but that kind of packing is non-trivial.

• the goal is minimal area size of the panel, if the boards which have to be put inside have big difference in dimensions your approach will lead to big waste

• Lets make it simple:
I do not understand the task the way it has been described. Please add a clear description in plain english.

• what exactly you cant understand? try to put N different rectangles in panel with minimal size

• Minimize area of rectangle panel (dimensions: A and B) needed to contain N different types of PCBs, Xn and Yn describes dimensions of corresponding PCB. So you can have 100 PCBs of the same type or 100 PCBs of two types (for example 50 of the first type and 50 of the another) and so on.

I hope I got it right, because minimizing area required for N PCBs of the same type makes no sense.

Some genetic algorithm might be a good try. Sadly I don’t have time for this quite interesting problem. I would love to see solutions.

.

• definitely PCBs wth random sizes or it’s just simple step and repeat 🙂

2. ultimateohm
Nov 10, 2013 @ 16:14:44

• good find!

3. Nigel Mollett
Nov 10, 2013 @ 20:48:10

That was a bit harder than the usual challenge but solution submitted and learned a lot! Nigel