Modeladvanced
Rectangle algebra
Also called rectangle calculus.
The qualitative calculus of axis-parallel rectangles, with one Allen relation per axis. It has 169 base relations, 2^169 relations, and NP-complete consistency.
The rectangle algebra describes how two rectangles with sides parallel to the axes lie relative to each other, by giving one relation of Allen's interval algebra for their projections on the axis and one for their projections on the axis. "A is left of B and overlaps it vertically" is the base relation . It is the standard qualitative constraint calculus for layouts, maps and documents, where objects are often summarised by their minimum bounding rectangles. This page treats it as a model: what a problem in it may say, what is counted, and what is known about its complexity.
The machine
The domain is the set of rectangles , where and are intervals with and . The base relations are the pairs of interval base relations, with
There are base relations, and they are jointly exhaustive and pairwise disjoint because the interval relations are. A relation is any set of base relations, so there are relations. The identity is . Converse and composition work axis by axis:
so the composition table is read off the interval table and never stored. Composition is strong, because it is strong on each axis and the axes are independent.
A relation of the form , with and interval relations, is a product relation; there are of them, counting the empty relation. Most relations are not products: "A is left of B or above B" is , a union that no product equals.
What it counts
An input is a qualitative constraint network on rectangles. The questions are the usual ones: consistency, a solution (rectangles with real or integer coordinates), and minimal labels. Cost is measured in . A label is a set of up to 169 base relations, so a word-RAM implementation stores it as 169 bits, or as a pair of 13-bit masks when it is a product.
Relation to other models
- Interval algebra. Each axis is an interval network. A network whose labels are all products is consistent exactly when the network with labels and the network with labels are both consistent, since the two axes do not interact.
- Block algebra. The same construction in dimensions has base relations (Balbiani, Condotta and Fariñas del Cerro 1999, 2002).
- Cardinal directions. The cardinal direction calculus for points is the same product idea with the point algebra on each axis, base relations.
- Topology. RCC8 describes contact and containment of arbitrary regions. For rectangles, each RCC8 relation is a union of rectangle relations; for example, two closed rectangles are disconnected exactly when their projections are in the interval relation or on at least one axis.
- Spatial indexes. An R-tree query such as "all boxes that intersect B" is a rectangle relation: the base relations whose projections intersect on both axes.
Known results in the model
| problem | result | source |
|---|---|---|
| consistency, all relations | NP-complete | by embedding the interval algebra |
| product relations with , in a tractable interval class | polynomial, axis by axis | follows from the interval results |
| product relations with , ORD-Horn | algebraic closure decides, | Nebel and Bürckert 1995 on each axis |
| strongly preconvex relations (not only products) | algebraic closure decides | Balbiani, Condotta and Fariñas del Cerro 1999 |
| block algebra, dimensions | analogous tractable subclasses | Balbiani, Condotta and Fariñas del Cerro 2002 |
Hardness. Membership in NP: guess the order of the endpoints on each axis, then check each label. Hardness: map an interval network with labels to the rectangle network with labels . All rectangles then have the same projection, and a solution of one network gives a solution of the other. So consistency is at least as hard as for intervals, which is NP-complete.
Products of ORD-Horn relations. If every label is with , in the ORD-Horn subclass, algebraic closure of the rectangle network keeps product labels, since intersection, converse and composition of products are products. If the closure has no empty label, then on each axis, so each axis network is closed, and by the Nebel-Bürckert theorem each is consistent. So closure decides these networks in time.
Beyond products. Balbiani, Condotta and Fariñas del Cerro (1999) defined the strongly preconvex rectangle relations, a class that contains relations that are not products, and showed that algebraic closure decides consistency for it.
References
- Philippe Balbiani, Jean-François Condotta and Luis Fariñas del Cerro, A new tractable subclass of the rectangle algebra, Proceedings of IJCAI-99, Morgan Kaufmann, 1999, pages 442 to 447, the rectangle algebra as a product of two interval algebras, its consistency problem, and a tractable subclass beyond products of tractable interval relations
- Philippe Balbiani, Jean-François Condotta and Luis Fariñas del Cerro, A tractable subclass of the block algebra, constraint propagation and preconvex relations, EPIA 1999, Lecture Notes in Computer Science, Springer, 1999, pages 75 to 89 (the block algebra in n dimensions and its preconvex relations)
- Philippe Balbiani, Jean-François Condotta and Luis Fariñas del Cerro, Tractability results in the block algebra, Journal of Logic and Computation 12(5), 2002, pages 885 to 909 (tractable subclasses of the block algebra, where path consistency decides consistency)
- James F. Allen, Maintaining knowledge about temporal intervals, Communications of the ACM 26(11), 1983, pages 832 to 843 (the interval relations used on each axis)
- Frank Dylla and others, A survey of qualitative spatial and temporal calculi, algebraic and computational properties, ACM Computing Surveys 50(1), 2017, pages 1 to 39 (the rectangle and block algebras among the surveyed calculi)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag M531Q4 Edit this page History Report an error Markdown