Weekend Programming Challenge – Week #32 PCB panelization



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.

10 Comments (+add yours?)

  1. Hans Franke
    Nov 08, 2013 @ 20:26:27

    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


    • Dylan
      Nov 08, 2013 @ 21:41:50

      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.


    • OLIMEX Ltd
      Nov 08, 2013 @ 23:21:28

      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


      • Hans Franke
        Nov 09, 2013 @ 17:06:08

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

      • OLIMEX Ltd
        Nov 10, 2013 @ 10:28:52

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

      • John
        Nov 10, 2013 @ 00:37:45

        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.


      • OLIMEX Ltd
        Nov 10, 2013 @ 10:27:21

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

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


  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


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: