Modeladvanced
Cardinal direction calculus
Also called cardinal direction relations.
Qualitative relations such as north and southwest between points or regions, defined by projections on the axes or by the 3x3 grid around the bounding box of the reference object.
The cardinal direction calculus describes where one object lies with respect to another in terms of the compass: north, northeast, east and so on. For points it is the product of two copies of the point algebra, one per axis, with nine base relations (Frank 1991, Ligozat 1998). For extended regions, the plane is cut into nine tiles by the bounding box of the reference region, and the relation is the set of tiles that the other region occupies (Goyal and Egenhofer, Skiadopoulos and Koubarakis). It is used in geographic information systems and in spatial queries such as "find the lakes north of the city".
The machine
Points. Let and be points of . The base relation of to is the pair of point relations with each , so there are base relations:
| NW | N | NE | |
| W | Eq | E | |
| SW | S | SE |
These are the projection-based directions of Frank (1991). The nine relations are jointly exhaustive and pairwise disjoint, and a relation is a set of them, so there are relations. The converse swaps N and S, E and W, and so on. Composition of base relations works axis by axis: if and , then and satisfy , with the point algebra composition. For example, N composed with E is NE, and NE composed with SW is the set of all nine relations.
Frank also gave a cone-based version, in which the plane around is cut into four or eight cones of equal angle. It is closer to how people use the words, but it is not a product of axis relations.
Regions. Let be a bounded region with bounding box . The four lines , , and cut the plane into nine tiles, named B (the box itself), N, NE, E, SE, S, SW, W and NW. The relation of a region to is the set of tiles in which has a part of positive area, written for example when lies above the box and reaches past its right side. Goyal and Egenhofer write this set as a matrix of bits, the direction-relation matrix.
Any non-empty set of tiles can be the relation of a region that may have several pieces, so there are basic relations. For connected regions without holes, the set of tiles must be connected through shared tile edges, and Skiadopoulos and Koubarakis (2004) count 218 basic relations. A direct count agrees: of the 511 non-empty subsets of the grid, exactly 218 are connected through shared edges.
What it counts
An input is a qualitative constraint network on objects with direction relations as labels. The questions are consistency, a solution, and the minimal labels. Cost is counted in .
Points. A network of base relations is consistent if and only if each of its two axis networks is consistent, since the axes are independent. Each axis network is a network of the point algebra, so the check takes time for a complete network, for example by merging the points that must be equal and testing the order for a cycle.
Example. The points , , are inconsistent, since the axis needs . The network , , is consistent: , , .
Regions. Computing the relation of two polygons takes time linear in their sizes: one pass over finds its bounding box, and clipping against the four lines finds the tiles with positive area. The relations between regions are not closed under converse: from the relation of to can be S, S:SW, S:SE and others, depending on the widths, so the converse of a basic relation is in general a disjunction.
Relation to other models
- Point algebra. Each axis of the point calculus is the point algebra, and the point calculus is their product.
- Rectangle algebra. The rectangle algebra applies the same product idea to intervals, with Allen's 13 relations on each axis. The region relation of to depends only on and the bounding box of , so it is coarser than the rectangle relation of the two boxes in some cases and finer in others.
- Topology. RCC8 says whether regions touch or overlap and has no notion of direction; combinations of RCC8 and cardinal directions have been studied for this reason.
- Relative orientation. Cardinal directions use a fixed frame. The double-cross calculus and other relative calculi describe a point with respect to the direction defined by two other points.
Known results in the model
| problem | result | source |
|---|---|---|
| points, base relations | polynomial, axis by axis | Ligozat 1998 |
| points, preconvex relations | algebraic closure decides; maximal tractable | Ligozat 1998 |
| points, all 512 relations | NP-complete | Ligozat 1998 |
| regions, composition of basic relations | computed; the result can be a relation that is not basic | Skiadopoulos and Koubarakis 2004 |
| regions, basic constraints, regions may be disconnected | Skiadopoulos and Koubarakis 2005 | |
| regions, disjunctive constraints | NP-complete | Skiadopoulos and Koubarakis 2005 |
Preconvexity. As for the interval algebra, a point relation is convex if it is an interval in the lattice of base relations ordered axis by axis, and preconvex if it becomes convex when relations of lower dimension, those with an on some axis, are added. For networks of preconvex relations, algebraic closure decides consistency (Ligozat 1998).
Composition for regions. Skiadopoulos and Koubarakis (2004) give an algorithm for the composition of two basic region relations. The result is in general a disjunction of basic relations, and because a region relation uses only the bounding box of the reference region, the composition must be computed with care: the box of does not fix where the parts of lie inside it.
References
- Andrew U. Frank, Qualitative spatial reasoning with cardinal directions, 7th Austrian Conference on Artificial Intelligence, Informatik-Fachberichte 287, Springer, 1991, pages 157 to 167 (cone-based and projection-based cardinal directions between points, and their composition)
- Gérard Ligozat, Reasoning about cardinal directions, Journal of Visual Languages and Computing 9(1), 1998, pages 23 to 44 (the nine base relations between points, the 512 relations, and the preconvex relations as a maximal tractable subset)
- Spiros Skiadopoulos and Manolis Koubarakis, Composing cardinal direction relations, Artificial Intelligence 152(2), 2004, pages 143 to 171 (the relations between extended regions, the 218 basic relations for connected regions, and their composition)
- Spiros Skiadopoulos and Manolis Koubarakis, On the consistency of cardinal direction constraints, Artificial Intelligence 163(1), 2005, pages 91 to 135 (an O(n^5) consistency check for basic constraints, and NP-completeness for disjunctive ones)
- Roop K. Goyal and Max J. Egenhofer, Similarity of cardinal directions, SSTD 2001, Lecture Notes in Computer Science 2121, Springer, 2001, the direction-relation matrix of a target region with respect to the bounding box of a reference region
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 SKAWD9 Edit this page History Report an error Markdown