title: The search for a set of points with a minimum sum of lengths to rectangles. What is the algorithm?
body: <p>Good day.</p>
  
  <p>I have the task of finding the set of points in 2D space for which the sum of the distances to the rectangles is minimal. For example, for two rectangles, the result will be the next area (<a href="https://i.ibb.co/7jS8K7F/rects.png" rel="nofollow noreferrer">picture</a>). Any point in this area has the minimum sum of lengths to A and B rectangles.
  Which algorithm is suitable for finding a <strong>region</strong>, all points of which have the minimum sum of lengths? The number of rectangles can be different, they are randomly located. They can even overlap each other. The sides of the rectangles are parallel to the coordinate axes and cannot be rotated. The <strong>region</strong> must be either a rectangle or a line or a point.</p>