I have a list of rectangles, they are in a certain order in 2D at the beginning. The task is to move them to get the boundary (rectangular) of the minimal area. It's OK to push off the dotted border as long as the area is minimal.

The starting state may look similar to this (top view):

enter image description here

Any reinforcement learning approaches to this problem? I'm thinking of some actions called 'rotate 90 degs', 'push east', 'push west', 'push south', 'push north', but these actions are still not clear how to be applied, which to push, how far to push.

The 2D state can be mapped to a grid of zeros (free) and ones (occupied) to utilize conv2D layers. Before feeding to conv2D, all rectangle coords should be translated to make the ($x_{min}$,$y_{min}$) be at the origin.

  • 1
    $\begingroup$ Why do you need to use reinforcement learning and CNNs specifically for this? This is the 2D stock cutting problem with rectangles, which can be solved using metaheuristics and an objective function (to minimise) that is proportional to the maximum height of the structure. $\endgroup$
    – Mike NZ
    Apr 14, 2021 at 8:09
  • 1
    $\begingroup$ i know it can be solved near perfect with regular algorithms, just wanna try RL for this problem $\endgroup$
    – Dan D.
    Apr 14, 2021 at 8:18


You must log in to answer this question.