This problem parallels that of the minimum area enclosing rectangle closely. It is interesting to note that very often the two rectangles minimizing the perimeter and the area happen to coincide. One can ask if this is always the case. Now, given a direction, the extreme points for P can be computed, in order to determine an enclosing rectangle.
P has a side collinear with an edge of the polygon.
This result restricts the range of possible rectangles to consider to those coinciding with one of the polygon's edges. Because of the similarities with its area counterpart, this problem can be solved with a similar algorithm based on the Rotating Calipers. The input for the following algorithm is assumed to be a convex polygon with n vertices given in clockwise order. Compute all four extreme points for the polygon, and call them xminP , xmaxP , yminP ymaxP . Construct four lines of support for P through all four points.