Fact-checked by Grok 2 weeks ago

Minimum bounding rectangle

The minimum bounding rectangle (MBR), also known as the smallest enclosing rectangle, is the rectangle of minimum area that fully encloses a given set of points or a in the . In , it is fundamentally defined for the of the input points, as the optimal rectangle bounds the hull rather than individual points. A defining property of the MBR is that its minimum-area configuration has at least one side collinear with an edge of the , a established in early work on geometric optimization. Computing the MBR involves first obtaining the in O(n log n) time, followed by the algorithm, which identifies the optimal orientation in linear O(n) time relative to the hull's vertices. This method, introduced by in 1983, exploits antipodal pairs of hull edges to efficiently evaluate candidate rectangles. The MBR finds broad applications in fields such as for object , spatial databases for indexing via approximations like axis-aligned variants, and for estimating form errors in manufactured parts. While exact algorithms suffice for small inputs, approximations are used for large-scale or higher-dimensional extensions to balance computational efficiency with near-optimal enclosure.

Definition and Fundamentals

Definition

The minimum bounding rectangle (MBR), also known as the smallest enclosing rectangle, of a set of points P = \{(x_i, y_i) \mid i = 1, \dots, n\} in the is the of smallest area that contains all points in P. Equivalently, among all enclosing P, it is the one that minimizes the product of its width and height. In the special case of an axis-aligned minimum bounding rectangle (where the sides are parallel to the coordinate axes), the MBR can be computed directly from the extrema of the coordinates as follows: \begin{align*} \min_x &= \min_i x_i, \\ \max_x &= \max_i x_i, \\ \min_y &= \min_i y_i, \\ \max_y &= \max_i y_i, \end{align*} with area A = (\max_x - \min_x) \times (\max_y - \min_y). This formulation provides the tightest axis-aligned enclosure but may not yield the global minimum area if rotation is permitted. For more complex objects such as polygons or general shapes, the MBR is defined as the smallest rectangle enclosing the entire boundary and interior of the object; for simple polygons (convex or concave), this is equivalent to the MBR of the vertex set, as the enclosure must cover all extremal points. The concept of the minimum bounding rectangle originated in the literature of the , building on earlier bounding box ideas from in the 1960s and .

Geometric Properties

The minimum bounding rectangle (MBR) for a of points in the is defined as the rectangle of minimal area that encloses all the points, with its boundary supported by points from the of the set. For convex polygons, an MBR of minimal area has at least one side collinear with an edge of the polygon, ensuring optimality by aligning the rectangle with the extremal features of the shape. This property holds because any smaller rectangle would fail to enclose the polygon if none of its sides coincide with a hull edge, as established through the of supporting lines. The dimensions of the MBR correspond to the widths of the point set measured along two orthogonal s, where the width in a given is the distance between parallel supporting lines perpendicular to that —known as the caliper . The area of the MBR is the product of these orthogonal widths, and the minimal-area selects the that minimizes this product. This relates the MBR to the of the set (the maximum caliper over all s) and the minimum width (the smallest caliper ), as the optimal MBR balances orthogonal caliper s to achieve the tightest enclosing fit without exceeding the set's extremal extents in any . Proofs of this minimization rely on the rotational invariance of caliper measurements and the convexity of the , showing that candidate s are limited to those aligned with edges. Degenerate cases arise when the point set lacks sufficient dimensionality. If all points are collinear, the is a , and the MBR collapses to that segment with zero area and perimeter $2 \times segment length. For a single point, the MBR is a degenerate of zero area and zero perimeter at that point's location. These cases are handled by the computation, which reduces to the extremal points.

Axis-Aligned Minimum Bounding Rectangle

The axis-aligned minimum bounding rectangle (AAMBR), also referred to as an axis-aligned bounding box () in two dimensions, is the smallest rectangle whose sides are parallel to the coordinate axes and that fully encloses a given set of points or a geometric object. Its edges are horizontal and vertical, aligning directly with the x- and y-axes of the , without any rotation required for computation. The AAMBR is determined solely by the extrema of the coordinates in the input set. Specifically, for a set of n points P = \{(x_1, y_1), \dots, (x_n, y_n)\}, the rectangle spans from \min_i x_i to \max_i x_i along the x-axis and from \min_i y_i to \max_i y_i along the y-axis: [\min_i x_i, \max_i x_i] \times [\min_i y_i, \max_i y_i] This formulation ensures the rectangle is the tightest possible under the axis-alignment constraint. The computation involves a single linear pass over the points to identify these minimum and maximum values, achieving O(n) time complexity. The following pseudocode illustrates a straightforward implementation for computing the AAMBR:
function computeAAMBR(points):
    if points is empty:
        return null
    min_x = +∞
    min_y = +∞
    max_x = -∞
    max_y = -∞
    for each point p in points:
        min_x = min(min_x, p.x)
        min_y = min(min_y, p.y)
        max_x = max(max_x, p.x)
        max_y = max(max_y, p.y)
    width = max_x - min_x
    height = max_y - min_y
    return [Rectangle](/page/Rectangle)(min_x, min_y, width, height)
This approach highlights the simplicity of the method, requiring only basic comparisons and no preprocessing like convex hull construction. A key advantage of the AAMBR is its computational efficiency and ease of implementation in systems using orthogonal coordinates, such as many graphics and spatial indexing applications, where rapid enclosure checks are prioritized over minimal area. However, it can be suboptimal for datasets exhibiting or elongation not aligned with the axes; for instance, a set of points forming a diagonal line from (0,0) to (1,1) results in a square AAMBR of side length 1 and area 1, enclosing significant empty space relative to the points' linear extent. Unlike the oriented minimum bounding rectangle, which permits rotation to achieve a potentially smaller enclosing area, the AAMBR remains fixed to the axes and may thus overestimate the spatial extent.

Oriented Minimum Bounding Rectangle

The oriented minimum bounding rectangle (O-MBR) is defined as the rectangle of smallest area that encloses a given set of points in the , where the rectangle's sides may be rotated by an arbitrary angle θ relative to the coordinate axes. Unlike fixed-orientation variants, this allows the rectangle to adapt to the of the points, potentially achieving a tighter for non-axis-aligned configurations. A key geometric insight is that the optimal orientation of the O-MBR aligns with the edges of the of the point set, as interior points do not influence the bounding rectangle. The area of the O-MBR is minimized by finding the rotation angle θ that minimizes the product of the width and height projections of the point set onto the rotated axes, where width(θ) and height(θ) represent the extents in the perpendicular directions. For a , the O-MBR is unique in the sense that at least one of its sides must be collinear with an edge of the . This property ensures that the minimal enclosure is "supported" by the hull's boundary, simplifying the search for the optimal rectangle among a of candidate orientations defined by the hull edges. As an illustrative example, consider a set of points forming rotated by degrees with side r; the axis-aligned minimum bounding rectangle in this case has an area of 2r², whereas the oriented minimum bounding rectangle aligns with the square's sides and has an area of r², demonstrating the potential area reduction through rotation. The axis-aligned minimum bounding rectangle represents a special case of the O-MBR when θ = 0.

Algorithms for Computation

Convex Hull-Based Methods

Convex hull-based methods for computing the minimum bounding rectangle (MBR) of a point set begin with preprocessing to compute the of the points, which can be done in O(n log n) time using the algorithm or in O(n h) time using the Jarvis march (), where n is the number of points and h is the number of vertices on the hull. These algorithms identify the smallest enclosing all points, typically resulting in h ≪ n for many distributions. A fundamental property is that the MBR of the original point set coincides with the MBR of its vertices, as the must enclose the extreme points defining the hull's boundary. This reduces the by focusing only on the h hull vertices. For the axis-aligned variant, the MBR is obtained by finding the minimum and maximum x- and y-coordinates among these h vertices, which takes O(h) time and yields a with width equal to the difference in x-extrema and height equal to the difference in y-extrema. For the oriented MBR, which allows rotation to minimize area, the approach exploits the theorem that the minimum-area rectangle enclosing a convex polygon has at least one side collinear with an edge of the polygon. Thus, candidate orientations are tested by considering each of the h hull edges as a potential side: for a given edge direction θ, the is rotated by θ, and the axis-aligned MBR is computed in the new system by projecting hull vertices onto the rotated axes to find extrema (O(h) per edge), yielding a total time of O(h²). The rectangle with the smallest area among these candidates is selected. This method can be optimized further using the technique to achieve O(h) time. As an example, when the input is already a convex polygon with h vertices, the hull computation is unnecessary, and directly applying the edge-testing procedure computes the oriented MBR in O(h²) time.

Rotating Calipers Algorithm

The rotating calipers algorithm computes the oriented minimum bounding rectangle (MBR) for a by maintaining four supporting lines—referred to as —that define the rectangle's boundaries and rotating them in a coordinated fashion to minimize the enclosed area. These consist of two pairs of , initially aligned with the axes at the polygon's extreme vertices (leftmost, rightmost, topmost, and bottommost). The exploits the that the optimal MBR has at least one side collinear with an of the convex hull, ensuring all candidate orientations are evaluated efficiently. Following the computation of the with h vertices (where h \leq n), the algorithm proceeds in the following steps:
  1. Initialize the to form the axis-aligned MBR by placing them at the extreme hull vertices and computing the initial width and height as the differences in x- and y-coordinates.
  2. Identify the next "rotation event" as the smallest angle required for any caliper to align with the subsequent edge of the , considering the antiparallel rotation of the pairs (one pair rotates , the other counterclockwise).
  3. Rotate both pairs of simultaneously by this angle, advancing the supporting to the new edge alignments; this occurs at O(h) discrete events, as each step processes at least one vertex transition.
  4. At each event, recompute the rectangle's dimensions: the width as the distance between one pair of parallel and the height between the other; calculate the area as their product and track the minimum across all configurations.
  5. Terminate after a 180-degree , as further rotation repeats the process due to the rectangle's symmetry.
The overall time complexity is O(n \log n), dominated by the O(n \log n) convex hull computation (e.g., via ), with the rotation phase requiring O(h) time for the O(h) events and O(1) work per event to update distances and areas. The algorithm's correctness relies on the fact that all local and global minima of the area function occur precisely when at least one caliper aligns with a edge; between these alignments, the area either increases monotonically or the minimum is not missed, as proven by the convexity of the and the continuous nature of the . This discrete-event approach captures the optimum without exhaustive search. The method builds on foundational results establishing edge-collinearity for the minimum-area . For illustration, consider the caliper rotation visually: starting with horizontal and vertical lines tangent to the at extremes, the lines "pivot" around contact points, maintaining parallelism within pairs while the pairs remain ; each pivot advances to the next hull edge, sweeping the until returning to the initial orientation. A outline is provided below, assuming counterclockwise-ordered hull vertices V[0 \dots h-1] and indices i_0, i_1, i_2, i_3 for initial bottom, right, top, and left supports:
min_area = infinity
current_angle = 0
// Initialize supports: i_bottom=0, i_right, i_top, i_left based on extremes
while current_angle < π:
    // Compute next rotation angle θ as min of angles to next edges from each support
    θ = min(angle_to_next(i_bottom), angle_to_next(i_right), angle_to_next(i_top), angle_to_next(i_left))
    // Rotate all supports by θ (advance indices accordingly)
    advance_supports(θ)
    // Compute distances
    width = distance_between_calipers(i_left, i_right)  // Parallel pair 1
    height = distance_between_calipers(i_bottom, i_top)  // Parallel pair 2
    area = width * height
    if area < min_area:
        min_area = area
        record_configuration()
    current_angle += θ
return min_area and corresponding orientation
Each advance_supports and distance computation is O(1), ensuring efficiency.

Applications and Uses

In

In , minimum bounding rectangles (MBRs) play a crucial role in spatial indexing structures, enabling efficient querying of multidimensional data. In R-trees, each node is associated with an MBR that encloses the spatial objects in its subtree, facilitating nearest-neighbor searches by pruning irrelevant branches through overlap tests between the query region and node MBRs. This hierarchical approximation reduces the search space significantly, allowing logarithmic-time access for typical queries in large datasets. Similarly, in k-d trees, MBRs of subtrees serve to bound point distributions, enabling rapid elimination of non-intersecting regions during range or nearest-neighbor operations, thus optimizing traversal in balanced binary search trees for spatial points. MBRs are also fundamental in algorithms, where they provide a fast for tests between geometric objects. By first checking if the MBRs of two objects overlap—via simple coordinate comparisons such as \max(x_{\min_1}, x_{\min_2}) \leq \min(x_{\max_1}, x_{\max_2}) and analogously for the y-coordinates, which can be performed in constant O(1) time—expensive exact computations are avoided unless necessary. This broad-phase filtering is essential in dynamic simulations, where it culls potential collisions from thousands of pairwise checks down to a manageable , improving overall in applications. For point location and spatial partitioning, MBRs integrate seamlessly with structures to support efficient searches. In point region (PR) quadtrees, each node's square region acts as an MBR for its enclosed points, allowing query rectangles to traverse only relevant subtrees by testing intersections with these bounds, thereby reporting all points within a specified area in logarithmic expected time relative to the data size. This partitioning approach decomposes the plane into adaptive cells, minimizing the number of nodes visited during searches for scattered point sets. A practical application arises in , where MBRs initialize the computational domain for by defining a rectangular around input vertices or curve segments, ensuring the initial triangulation covers the entire region before refinement steps improve element quality. In dynamic scenes, oriented MBRs can provide tighter bounds than axis-aligned variants, reducing false positives in indexing and detection tasks.

In Geographic Information Systems

In geographic information systems (GIS), the minimum bounding rectangle (MBR), often referred to as a or , serves as a fundamental spatial for representing the extent of geographic features, such as points, lines, or polygons, by enclosing them within the smallest possible axis-aligned or oriented rectangle. This approximation simplifies complex geometries for efficient storage, querying, and analysis of large datasets, where exact shape computations would be computationally expensive. A primary application of MBRs in GIS is spatial indexing, where structures like s and quadtrees use MBRs to partition and organize spatial data, enabling rapid retrieval for queries such as or . For instance, in indexing, each node stores an MBR that bounds its child entries, allowing the system to prune irrelevant branches during searches and reduce query times from linear to logarithmic complexity for multidimensional data. This approach is widely adopted in systems like PostGIS and Spatial for handling vector data in or . MBRs also facilitate map visualization and extent definition, where tools in software like generate MBRs to automatically set the display bounds for selected features, ensuring complete coverage without manual adjustment. In production mapping, oriented MBRs (rotated to minimize area) are used to create precise extents for charts or layouts representing clustered features, such as habitats or networks, improving cartographic accuracy and reducing visual clutter. Beyond indexing and , MBRs support topological and directional relation queries in GIS databases by approximating object interactions; for example, determining if one feature overlaps another via MBR tests before refining with exact . However, empirical studies highlight limitations, such as overestimation of extents for irregular shapes like coastlines, which can lead to false positives in queries and reduced efficiency in high-density datasets. Despite these, MBRs remain essential for scalable in applications ranging from routing to land-use .

References

  1. [1]
    [PDF] Efficiently Approximating the Minimum-Volume Bounding Box of a ...
    Jun 30, 2001 · We denote by Ropt(Q) the minimum-area bounding rectangle of Q and by Bopt(S) the minimum-volume bounding box of S.1 Let V be a set of ...
  2. [2]
    Estimation of minimum volume of bounding box for geometrical ...
    Oct 22, 2020 · They presented the following theorem, which is the basis for minimum bounding rectangle algorithms: The rectangle of minimum area enclosing a ...
  3. [3]
    [PDF] Computational Geometry −− Where Did it Come From, What is it ...
    Computational Geometry as a research discipline started in the early 1970's in the math programming, theory/algorithms and CAD communities. Earliest papers,.
  4. [4]
    [PDF] Solving Geometric Problems with the Rotating Calipers *
    Such problems include (1) finding the minimum-area rectangle enclosing a polygon,. (2) computing the maximum distance between two polygons, (3) performing the ...
  5. [5]
    [PDF] Minimum-Area Rectangle Containing a Set of Points - Geometric Tools
    May 17, 2015 · The minimum-area rectangle is found by computing the convex hull of the points, then iterating over its edges to find the smallest bounding ...Missing: seminal | Show results with:seminal
  6. [6]
    Aligned Bounding Box - an overview | ScienceDirect Topics
    An Axis-Aligned Bounding Box (AABB) is a rectangular parallelepiped with faces perpendicular to basis vectors, used in spatial subdivision tasks.
  7. [7]
    Determining the minimum-area encasing rectangle for an arbitrary ...
    This paper describes a method for finding the rectangle of minimum area in which a given arbitrary plane curve can be contained.
  8. [8]
    [PDF] Solving Geometric Problems with the Rotating Calipers *
    Theorem 2.1: The rectangle of minimum area enclosing a convex polygon has a side collinear with one of the edges of the polygon. The algorithm presented in ...Missing: properties | Show results with:properties
  9. [9]
    Minimum Bounding Geometry (Data Management)—ArcGIS Pro
    Rectangle by area—The rectangle of the smallest area enclosing an input feature. · Rectangle by width—The rectangle of the smallest width enclosing an input ...Missing: computational | Show results with:computational
  10. [10]
    Minimum Bounding Rectangle Definition | GIS Dictionary
    A rectangle, oriented to the x- and y-axes, that bounds a geographic feature or a geographic dataset. It is specified by two coordinate pairs: xmin, ...
  11. [11]
    Spatial relations, minimum bounding rectangles, and spatial data ...
    Aug 6, 2010 · This paper is concerned with the retrieval of topological and direction relations using spatial data structures based on Minimum Bounding ...<|control11|><|separator|>
  12. [12]
    Quadrant-Based Minimum Bounding Rectangle-Tree Indexing ... - NIH
    Sep 10, 2018 · In this paper, we propose a hierarchical indexing structure called a quadrant-based minimum bounding rectangle (QbMBR) tree for effective ...
  13. [13]
    Creating a minimum bounding rectangle—ArcMap | Documentation
    A minimum bounding rectangle can be used to create an extent for a map or chart based on the features selected. The Create Minimum Bounding Rectangle tool ...
  14. [14]
    An empirical study of the limitations of minimum bounding boxes for ...
    Abstract. A Minimum Bounding Box (MBB) is a rectangle which bounds a geographic feature or dataset. It is commonly used in spatial information systems as a ...<|separator|>
  15. [15]
    An efficient method for the retrieval of objects by topological ...
    The previous approach can process the retrieval of spatial objects by topological relations using R-tree structures based on minimum bounding rectangles.Missing: scholarly | Show results with:scholarly