Algorithm Search⌘K

Modeladvanced

Double-cross calculus

Also called Freksa double cross.

Locates a point relative to an oriented segment by which side of it and of the two perpendiculars at its ends the point lies on. Its consistency problem is NP-hard even for base relations.

The double-cross calculus of Freksa (1992) describes the relative orientation of three points: where a point cc lies as seen by someone who walks from aa to bb. The line through aa and bb tells left from right, and the two lines perpendicular to it at aa and at bb tell behind, beside and ahead. These three lines form a double cross, and they split the plane into 15 positions for cc. The calculus was made for navigation, where an agent knows the way it is facing but not distances. Its relations are ternary, and Scivos and Nebel (2001) showed that deciding the consistency of a set of base relations is NP-hard.

The machine

Let a≠ba \ne b be points of R2\mathbb{R}^2 and let cc be a third point. Write d=b−ad = b - a. The relation of cc to the oriented segment (a,b)(a, b) is a pair (side, position):

  • side: the sign of the cross product d×(c−a)d \times (c - a), which is left if positive, straight (on the line) if zero, and right if negative; this is the orientation test;
  • position: from the dot products p=d⋅(c−a)p = d \cdot (c - a) and q=d⋅(c−b)q = d \cdot (c - b), it is back if p<0p < 0, at aa if p=0p = 0, between if p>0p > 0 and q<0q < 0, at bb if q=0q = 0, and front if q>0q > 0.

This gives 3×5=153 \times 5 = 15 base relations for a≠ba \ne b. Two of them are single points: straight and at aa means c=ac = a, and straight and at bb means c=bc = b. The others are open regions, open rays or open segments of lines. Later formalizations add base relations for the cases in which a=ba = b, so that every triple of points has exactly one relation.

Freksa built the double cross from two single crosses, one at aa and one at bb, each made of the line through aa and bb and the perpendicular at that point. Each single cross alone describes the position of cc relative to one end.

Example. Let a=(0,0)a = (0, 0) and b=(4,0)b = (4, 0), so d=(4,0)d = (4, 0).

cc cross product pp qq relation
(2,1)(2, 1) 44 88 −8-8 left, between
(5,−1)(5, -1) −4-4 2020 44 right, front
(−1,0)(-1, 0) 00 −4-4 −20-20 straight, back
(0,3)(0, 3) 1212 00 −16-16 left, at aa
(4,−2)(4, -2) −8-8 1616 00 right, at bb

With integer coordinates all three values are exact, so the relation is computed in O(1)O(1) time with no rounding error.

What it counts

An input is a set of nn point variables and a set of ternary constraints, each saying that a triple (a,b,c)(a, b, c) is in one base relation or in a set of them. The question is consistency: are there points in the plane that meet every constraint? Cost is counted in nn and in the number of constraints.

The constraints are sign conditions on polynomials of degree 2 in the coordinates, so consistency is a question in the existential theory of the reals, and it is decidable, for example by cylindrical algebraic decomposition. Hardness lies in the other direction: Scivos and Nebel (2001) show that the problem is NP-hard even when every constraint is a base relation.

Reasoning with tables. Freksa (1992) reasoned with tables: for the permutations of the three points, and for combining two relations that share two points into a relation on a new triple, in the manner of a composition table. Scivos and Nebel (2001) show that the calculus is not closed under composition, so such tables can only give a relation that contains the true one, and local propagation with them does not decide consistency.

Relation to other models

  • Cardinal directions. The cardinal direction calculus uses a fixed frame, the axes of the plane, and binary relations. The double cross uses a frame defined by two of the points, so its relations are ternary and invariant under rotation, translation and scaling.
  • Other ternary calculi. The LR calculus keeps only the line through aa and bb, and the OPRA calculi of Moratz relate points that carry their own orientation. They share the use of the orientation test.
  • Binary calculi. For binary calculi such as RCC8, a qualitative constraint network of base relations is often decided by algebraic closure in polynomial time. The double cross is an example in which this fails already for base relations.

Known results in the model

problem result source
relation of a given triple O(1)O(1) arithmetic operations Freksa 1992, with the formulas above
consistency, base relations only NP-hard Scivos and Nebel 2001
consistency, any constraints decidable, through the existential theory of the reals Scivos and Nebel 2001
closure under composition no Scivos and Nebel 2001

The tables of Freksa (1992) give a sound method: a contradiction that they find is real. By the hardness result, unless P = NP, no polynomial propagation with them finds every inconsistent network of base relations.

References

  1. Christian Freksa, Using orientation information for qualitative spatial reasoning, Theories and Methods of Spatio-Temporal Reasoning in Geographic Space, Lecture Notes in Computer Science 639, Springer, 1992, pages 162 to 178 (the single cross and the double cross, the 15 positions of a point relative to an oriented segment, and reasoning with them)
  2. Alexander Scivos and Bernhard Nebel, Double-crossing, decidability and computational complexity of a qualitative calculus for navigation, COSIT 2001, Lecture Notes in Computer Science 2205, Springer, 2001, pages 431 to 446 (NP-hardness of consistency for networks of base relations, and that the calculus is not closed under composition)
  3. 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 double-cross calculus among the ternary 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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/W56YNG/text.yaml