Introduction

Motivation

The question of connectivity between spatial regions is crucial in the query, analysis and manipulation of spatial data, but at present there is considerable variation in the approaches taken by different software suppliers [1, 2]. This is exacerbated by the fact that often the definitions used rely on the assumption of real number arithmetic, leaving the interpretation within the finite computational arithmetic and storage undefined. In rare but significant cases, the use of finite arithmetic causes the breakdown of the fundamental algebra of space, leading to gross changes of the value of a predicate. For example in Fig. 1, A connected to B should imply that A is connected to BC.

Fig. 1
figure 1

Connectivity is not necessarily conserved in calculations. Here A is strongly connected to B, but due to limited accuracy of calculations (shown exaggerated), A is not connected to BC

The topological relationships between spatial objects is considered to be of fundamental importance to spatial information environments, but these rely on precise definitions of set membership, and of the relationships between sets and adjoining sets. The finite nature of the computational arithmetic raises the need to manage potential problems such as that pictured in Fig. 1, and various approaches have been tried over the years (with some described in Section 1.2). It is clear that the implementation of a mathematical theory of space, based on real number arithmetic, on a computer using a finite approximation to that arithmetic (such as floating point) is not a trivial exercise.

A construct, referred to as a Regular Polytope and described herein, has been researched to resolve issues of the mismatch between the mathematical theory and its implementation in a finite digital computer [3], and in particular, to study the issue of connectivity. It has been shown [4] that a fully rigorous algebra can be supported without the assumption of infinite precision by the Regular Polytope approach, and that a useful toolkit of predicates and functions can be provided. These tools can be used with confidence in any combination, with no possibility of failure caused by overflow, underflow or co-incidence of values.

Note that the word “Regular” in this context is used in the topological sense—of a set which is equal to the interior of its closure (in the case of open-regular) or equal to the closure of its interior (in the case of closed-regular). In effect, it means that the set has no singularities—spikes or gaps. The term should not be confused with the geometric term “regular polytope” meaning a polyhedral object with identical faces, generalised into n dimensons.

The research

This paper explores issues raised by the question of connectivity, using the concept of “domain-restricted rational number” calculations—which are computable on current hardware, and do not suffer the problem of unconstrained precision requirements, as do implementations requiring true rational numbers [5]. It is shown that the full set of functions of the region connection calculus (RCC) [6] can be satisfied. The RCC has been chosen as a basis for reviewing the logic because it provides a consistent and useful set of predicates for the investigation of connectivity, without the complications caused by defining a boundary as a (finite) point set.

The conventional approach to this issue is the use of topological encoding of regions and networks [79], combined with a form of normalisation to prevent situations arising where imprecise calculations can cause difficulties [10]. This normalisation is often combined with the validation process, but may in itself lead to breakdown of the spatial algebra. That is to say, once the data has been validated and normalised (the process described as topologically cleaning the data), a rigorous logic applies, but the cleaning process is not well understood [11].

An alternative approach is based on the use of rational numbers. This recognises that the most common operation to cause imprecision is division. By representing numbers as a pair of integers I, J, interpreted as I/J, the actual division operation is avoided [12]. An appealing variant of this is the concept of homogeneous integer coordinates [13] as used in the LEDA library [14]. It must be born in mind that this approach requires that the size of the integers is not constrained. That is to say that it is mandated that overflow cannot occur in any arithmetic operation. It has been shown that the sizes of integers that can be generated in a sequence of calculations tend to become very large indeed (see Section 5.1), and so a database built on such a structure will grow and slow with time [15].

The “Realms” approach handles the imprecision problem directly, by constraining lines to remain within an envelope based on the grid size of the integer representation [16]. While this is shown to support a rigorous algebra (ROSE), it is not a trivial exercise to extend to three dimensions [15]. The “Dual Grid” [17] approach addresses the issue of finite precision calculations using what are, in effect, domain-restricted rational numbers equivalent to those defined in Section 2.1. In 2D, the dual grid has much to recommend it (including support for the ROSE algebra), but the extension to 3D is far from obvious, and may have significant difficulties.

The remainder of the paper is structured as follows. Section 2 contains a summary of the definition of the regular polytope, based on Thompson (2005) [3]. Section 3 explores some desiderata in the definition of connectivity. The derivation of a computable definition of connectivity is addressed in Section 4, along with a discussion of the algebras supported. Section 5 contains the conclusions, a comparison with alternate approaches, and a brief description of a “proof of concept” implementation.

The regular polytope

A regular polytope representation of spatial objects is defined as the union of a finite set of (possibly overlapping) “convex polytopes”, which are in turn defined as the intersection of a finite set of half spaces (in 3D, half planes in 2D). These half spaces (planes) are defined by finite precision integer parameters (3 values in 2D, 4 values in 3D etc.). Although the definitions of the half spaces use integral coordinates, the points within them (and therefore the point sets defined by regular polytopes) are interpreted as domain-restricted rational points.

No notational distinction is made in this paper between computational operations +, −, ., =, etc, and the mathematical operations they implement, since the integer and rational number arithmetic available in computers is exact within its domain. There is however, a distinction to be made (for example, it must be remembered that A+B as a computational operation can result in overflow). By contrast, floating point is not exact, and it cannot be asserted that following the operations a := b*c; (a multiplication and assignment) then a = bc (as a mathematical equation).

Domain-restricted rational numbers

In order to exactly calculate and represent the vertices of any convex polytope the concept of dr-rational numbers was introduced. Given two large positive integers N′ and N″, a dr-rational number r can be defined as an ordered pair of computational integers (–N″IN″, 0 < JN′), interpreted as having a value of I/J. (The meanings and values of N″ and N′ are given in section 2.4). The reason for the name “domain-restricted rational” (dr-rational) is that the values of I and J are constrained to a finite range of possible values. Like floating point numbers, dr-rational numbers do not form a field (in contrast to the true rational numbers) [18], and therefore, by definition, cannot span a vector space. There are a number of other counter-intuitive properties of dr-rational numbers, for example that the sum of two dr-rational numbers may not be a dr-rational number. In the following discussion, the requirement J > 0 is not explicitly addressed in every case. It is assumed that in any operation that leads to a rational number r = (I/J) with J < 0 will be converted to a valid dr-rational number (-I/-J).

In 3D, a dr-rational point is defined in terms of integral homogenous coordinates, as an ordered 4-tuple of integers p = (X, Y, Z, Q), Q ≠ 0. This point could also be represented as a triple of dr-rational numbers p = (x, y, z) with x = X/Q, y = Y/Q and z = Z/Q. The homogenous coordinate form is to be preferred as it highlights the common denominator Q. Note that there are also counter-intuitive properties possessed by dr-rational points—e.g. it cannot be assumed that the mid-point between two dr-rational points is a dr-rational point. The advantage possessed by the dr-rational representation is that it is directly implementable in computer hardware, and does not lead to a system that slows with age (as a potentially infinite rational representation will) [11, 15].

Half space definition

In 3D a half space H(A, B, C, D) is defined as the set of all dr-rational points p = (X, Y, Z, Q): Q > 0, -M X/Q, Y/Q, Z/Q < M Footnote 1 for which computational evaluation of the following inequalities yields these results:

$$ \begin{array}{*{20}c} {\left( {AX + BY + CZ + DQ} \right) > 0\,{\text{or}}} \hfill \\ {\left[ {\left( {AX + BY + CZ + DQ} \right) = 0\,{\text{and}}\,A > 0} \right]\,{\text{or}}} \hfill \\ {\left[ {\left( {BY + CZ + DQ} \right) = 0\,{\text{and}}\,A = 0\,{\text{and}}\,B > 0} \right]\,{\text{or}}} \hfill \\ {[\left( {CZ + DQ} \right) = 0\,{\text{and}}\,A = 0,\,B = 0\,{\text{and}}\,C > 0]} \hfill \\ \end{array} $$
(def1)

where M is the limit of values allowed for point representations, and A, B, C and D are integers. We place the restrictions that:

  • M < A, B, C < M, -3M 2 < D < 3M 2 in 3D applications,

  • M < A, B < M, -2M 2 < D < 2M 2 in 2D (C is not required in 2D).

The complement of a half space is defined as:

$$ \bar{H} =_{\text{def}} \left( { - A, - B, - C, - D} \right),\,where\,H = \left( {A,B,C,D} \right). $$
(def2)

The form of the definition of a half space, with four parts rather than just (AX + BY + CZ + DQ) > 0, is chosen so as to ensure a clean definition of complement, in effect ensuring that no points will test as “on the boundary”. That is \( H \cap \bar{H} \) is empty, thus eliminating the special cases that arise with boundary points. This is further discussed in Sections 2.4 and 2.6.

Equality of half spaces is defined as:

$$ H_{\text{1}} = H_{\text{2}} =_{\text{def}} p \in H_1 \Leftrightarrow p \in H_2 . $$
(def3)

Two special half spaces are defined,

$$ H_{\emptyset } = H\left( {0,0,0, - 1} \right)\left( {\prime empty\prime \,i.e.\,points\,{\text{for}}\,{\text{which}}\,D > 0,\,{\text{where}}\,D = - 1} \right) $$
(def4)
$$ H_{\infty } = H\left( {0,0,0,1} \right)\left( {\prime {\text{everything}}\prime \,i.e.\,points\,{\text{for}}\,{\text{which}}\,D > 0,\,{\text{where}}\,D = 1} \right) $$
(def5)

H(0, 0, 0, 0) is not a permitted half space.

Regular polytope definition

Figure 2 shows how a region (known as a “convex polytope”) can be defined as the intersection of a number of half spaces. Formally, C = {H i : i = 1..n}, notated as \( C = \mathop \cap \limits_{{i = 1..n}} H_i \).

Fig. 2
figure 2

A convex region defined by a set of half spaces (in 3D)

A regular polytope O is defined as the union of a finite set of (possibly overlapping) non empty convex polytopes, O = {C j : j = 1..m}, notated as \( O = \mathop \cup \limits_{{j = 1..m}} C_j \). See Fig. 3, in which C 1 and C 2 are 2D convex polytopes which are in turn defined as the intersection of half spaces H 1a to H 1d and H 2a to H 2d [3]. A regular polytope may consist of disconnected parts, and parts may overlap. Points coincident with the boundaries shown as dashed in Figs. 2 and 3 do not belong to the regions they define. In Figure 3, \( H_{{2a}} = \bar{H}_{{1d}} \), and points that lie along the common boundary are within C 2 but not C 1 (and therefore are within the regular polytope O).

Fig. 3
figure 3

Regular polytope O defined as the union of two convex polytopes C 1 and C 2. This and other figures are drawn as 2D cases for the ease of presentation where there is an obvious extension to 3D. By contrast, the text and mathematics are generally expressed in 3D

The natural definitions of the union, intersection, and complement of regular polytopes are used, so that the meanings are exactly equivalent to the point set interpretations. For example: for O 1 = {C j : j = 1..m} and O 2 = {C′ k , k = 1..l}:

$$ O_{\text{1}} \cup O_2 =_{\text{def}} \left\{ {C_j :j = {\text{ 1}}..m,C\prime_k, k = {\text{1}}..l} \right\}. $$
(def6)

Which leads to: ∀ p: pO 1O 2pO 1pO 2.

DR_rational point-set interpretation of the regular polytope

The half space H(A, B, C, D) can be interpreted as the set of dr-rational points (X, Y, Z, Q), –MQX, Y, Z < MQ that satisfy the relations (def1). By this interpretation the set of all dr-rational points in any regular polytope is finite. Note that since A, B, C, D and X, Y, Z, Q are integers, (def1) can be rewritten, using small perturbations after the style of “Simulation of Simplicity” [19] (to prevent the degenerate cases) as:

$$ A\left( {X + \varepsilon_a } \right) + B\left( {Y + \varepsilon_b } \right) + C\left( {Z + \varepsilon_c } \right) + DQ > 0 $$
(def1a)

where ε a , ε b and ε c are small numbers, such that: 1/M 2 < ε a < 1/M, 1/M 3 < ε b < 1/M 2, 0 < ε c < 1/M 3. These coefficients can be used in place of the four part definition (def1) to ensure that no dr-rational point (X, Y, Z, Q) can ever fall exactly on the plane of the half space. They would not actually be used in the computation.

In 3D, the point of intersection of three planes defined by A 1 x + B 1 y + C 1 z + D 1 = 0, A 2 x + B 2 y + C 2 z + D 2 = 0, A 3 x + B 3 y + C 3 z + D 3  = 0, can be shown to be at point P = (X, Y, Z, Q) where:

$$ \begin{gathered} Q = \left| {\begin{array}{*{20}c} {A_1 } \hfill & {A_2 } \hfill & {A_3 } \hfill \\ {B_1} \hfill & {B_2 } \hfill & {B_3 } \hfill \\ {C_1 } \hfill & {C_2 } \hfill & {C_3 } \hfill \\ \end{array} } \right|,\;X = \left| {\begin{array}{*{20}c} { - D_1 } \hfill & { - D_2 } \hfill & { - D_3 } \hfill \\ {B_1 } \hfill & {B_2 } \hfill & {B_3 } \hfill \\ {C_1 } \hfill & {C_2 } \hfill & {C_3 } \hfill \\ \end{array} } \right|,\;Y = \left| {\begin{array}{*{20}c} {A_1 } \hfill & {A_2 } \hfill & {A_3 } \hfill \\ { - D_1 } \hfill & { - D_2 } \hfill & { - D_3 } \hfill \\ {C_1 } \hfill & {C_2 } \hfill & {C_3 } \hfill \\ \end{array} } \right|, \hfill \\ \quad \quad \quad \quad \quad \quad \quad \quad Z = \left| {\begin{array}{*{20}c} {A_1 } \hfill & {A_2 } \hfill & {A_3 } \hfill \\ {B_1 } \hfill & {B_2 } \hfill & {B_3 } \hfill \\ { - D_1 } \hfill & { - D_2 } \hfill & { - D_3 } \hfill \\ \end{array} } \right|. \hfill \\ \end{gathered} $$

For a valid half space |A i |, |B i |, |C i | < M, |D i | < 3M 2 (where |A| is the absolute value of A), therefore, |Q| < 6M 3, and |X|, |Y|, |Z|< 18M 4. Therefore 3D applications use for the domain of the dr-rational numbers:

$$ N\prime = {\text{6}}M^{\text{3}}, N\prime \prime = {\text{18}}M^{\text{4}} . $$
(1)

Similarly, 2D applications use:

$$ N\prime = {\text{2}}M^{\text{2}}, \,{\text{N}}\prime \prime = {\text{4}}M^{\text{3}} . $$
(2)

It follows from the above that any three valid half spaces which intersect do so at a point with homogeneous coordinates (X, Y, Z, Q), and that if –MQX, Y, Z < MQ, then (X, Y, Z, Q) will be a valid dr-rational point. That is to say, a regular polytope can be considered to be a set of dr-rational points, with no dr-rational boundary points. It is assumed that integer arithmetic is available, and is accurate within its range of validity.

Properties of the regular polytope

It is relatively simple to show that the space O spanned by the regular polytopes is a topology [4, 15] based on the definition of regular polytope as an open set. It is also a non Euclidean metric space. The set of n-tuples of real numbers (x 1, x 2, … x n ), denoted R n, defines a Euclidean space, however although the points spanned by the regular polytopes can be described by a tuple of numbers, these are not real numbers but a finite representation, and the space is not Euclidean. (This is true of any finite representation, whether the point coordinates be stored as integers, floating point or dr-rational numbers).

It is readily apparent that for any regular polytope O, \( \forall p,p \in O \Leftrightarrow p \notin \overline{O} \), and that: \( O \cup \overline{O} = O_{\infty } \) and \( O \cap \overline{O} = O_{\emptyset } \), where O and O are the empty and universal regular polytopes respectively. Thus no points exist between \( \overline{O} \) and O, in contrast with most conventional approaches where (in the mathematical model) space is partitioned into a region’s interior R°, exterior \( \overline{R} \) and boundary δR, with ∀p, \( p \in R^\circ \; \vee \) \( p \in \overline{R} \; \vee \) pδR. A further consequence is that the axioms of a Boolean algebra [20] are satisfied (leading to the development of the concept of a Boolean connection calculus—see section 4.7).

Note—there are conceptual differences between conventional polyhedra and polytopes. The latter may be unbounded, and a polytope partitions space into two sets (interior and exterior) rather than three (interior, boundary and exterior). For example, in Fig. 4, both examples are not fully bounded, and points coincident with the boundaries shown as dashed do not belong to the regions.

Fig. 4
figure 4

Convex polytopes, not fully bounded (left 2D, right 3D)

The regular polytope as a closed and open set

The space O, spanned by the regular polytopes is a finite point set. Thus all regular polytopes are both open and closed, and therefore fit the definition of a “regular set” as described by Lemon & Pratt [5]. This is not to be confused with the partially open region (or closed-open region) often referred to in topology texts. By contrast, the regular polytope is fully open and fully closed, and is thus considered to be a boundary-free representation. This is possible because 1. The definition of half space does not admit any boundary point set to exist (as described in Section 2.4) and 2. The finite nature of the point-sets ensures that the set reaches its limit points along the edges.

In Fig. 5, note that all points are either inside or outside the regular polytope, and no distinction for points lying on the boundary lines is necessary. An alternate view of the boundary-free nature of the regular polytope is to consider the definition of a boundary in a metric space. In a metric space, an open set may possess a boundary, but the boundary points do not belong to the set. A closed set contains its boundaries. For example, in the one dimensional case, a closed interval I = [0, 1], and an adjacent open interval J = (1, 2) share a common boundary, but it belongs to the closed interval only. The upper bound of I is defined as min{r: riiI}, while the lower bound of J is defined as max{s: sjjJ}. Clearly these bounds are both equal to 1.

Fig. 5
figure 5

Point set definition of a regular polytope (as an open and closed region)

If the same intervals are considered in dr-rational numbers, the upper boundary of I is still 1, but the greatest lower boundary of J, by this definition is 1+γ where γ is the minimum representable interval. Thus the interval J is closed, and does not share a common boundary with I. Similarly in Fig. 5, it is possible to define an eastern (and northern) boundary for the set depicted, which contains some points that belong to the set, but this boundary does not match the half spaces shown (dotted lines).

Regular polytope overlap

Two regular polytopes are defined to overlap if their intersection is not empty:

$$ {\text{OV}}\left( {O_{\text{1}}, O_{\text{2}} } \right) =_{\text{def}} O_{\text{1}} \cap O_{\text{2}} \ne {\text{O}}_{\emptyset } $$
(def7)

The inequality test in this definition is problematic because equality of two regular polytopes is defined in point-set terms (O = O′ = def pOpO′), and is therefore difficult to implement. Rather than the more general “equals” (or not_equals) relation, it is more convenient to implement a specialized “Empty” function, re-stating (def7) as: for \( O_1 = \bigcup\limits_{{i = 1..n_1 }} {C_{{1i}} } \), \( O_2 = \bigcup\limits_{{j = 1..n_2 }} {C_{{2j}} } \), OV can be defined as:

$$ {\text{OV}}\left( {O_{\text{1}}, O_{\text{2}} } \right) =_{\text{def}} \exists C_{{{\text{1}}i}} \in O_{\text{1}}, C_{{{\text{2}}j}} \in O_{\text{2}} :\neg {\text{Empty}}\left( {C_{{{\text{1}}i}} \cap C_{{{\text{2}}j}} } \right). $$
(def8)

Since the intersection of two convex polytopes is itself a convex polytope, the computability of overlap depends on the definition of a convex polytope “Empty” test. It has been shown that this test is computable using dr-rational numbers [15].

The definition of overlap can be used to define further computable predicates—as follows:

$$ {\text{PartOf}}:\quad \quad {\text{P}}\left( {O_{\text{1}}, O_{\text{2}} } \right) =_{\text{def}} \neg {\text{OV}}\left( {{\text{O}}_{\text{1}}, \overline{O}_2 } \right). $$
(def9)
$$ {\text{Equals}}:\quad \quad {\text{EQ}}\left( {O_{\text{1}}, O_{\text{2}} } \right) =_{\text{def}} {\text{P}}\left( {O_{\text{1}}, O_{\text{2}} } \right){\text{and}}\,{\text{P}}\left( {O_{\text{2}}, O_{\text{1}} } \right). $$
(def10)

These can be readily verified to correspond to the usual point set definitions—e.g.:

$$ {\text{OV}}\left( {O_{\text{1}}, O_{\text{2}} } \right) \Leftrightarrow \exists \,p \in O_{\text{1}} \cap O_{\text{2}} $$
(3)
$$ {\text{P}}\left( {O_{\text{1}}, O_{\text{2}} } \right) \Leftrightarrow \forall p,p \in O_{\text{1}} \Rightarrow p \in O_{\text{2}} $$
(4)
$$ {\text{EQ}}\left( {O_{\text{1}}, O_{\text{2}} } \right) \Leftrightarrow \forall p,p \in O_{\text{1}} \Leftrightarrow p \in O_{\text{2}} $$
(5)

The regular polytopes can be shown to span a topological space [4, 15].

Connectivity of geometric objects

One of the more important properties of geometric objects is that of connectivity. Intuitively, this can be thought of as the property that a geometric object has if it is “in one piece”; see Fig. 6. It is the aim of this research to formalise this definition for regular polytopes in order to support robust determination of connectivity.

Fig. 6
figure 6

Examples of connected polygons

In the polygon representation, as defined by standards such as ISO 19107 [21], the connectivity of a polygon is mandated by requiring one (or zero) outer boundary, with zero or more inner boundaries. This does require further qualification to cover cases of tangential connectivity. A fuller discussion can be found in [1] with the following condition recommended for a valid polygon: “any point inside or on the boundary of the polygon can be reached through the interior of the polygon from any other point inside or on the boundary of the polygon, that is, it defines one connected area” (assuming Euclidean space). The polygons in Fig. 6 are connected, but more problematic examples can be seen in Figs. 7 and 9.

Fig. 7
figure 7

Discontinuous regions with single outer boundaries. (The circled points are supposed to co-inside exactly, but have been drawn slightly separated for clarity)

Frequently, where more than one outer boundary can exist, the geometry is known as a “multi-polygon” [2]. The regions in Fig. 7 would not normally be considered continuous—or at least their interiors are not continuous, but they are each defined using a single outer boundary. Egenhofer et al. [22] discuss the type of geometry, where a hole is strongly connected to the outer boundary (Fig. 7, left region), and do consider it to be connected.

It is clear that the connected region alone cannot provide a basis for a topological space, because the union or intersection of two connected regions need not be connected. That is to say the operations of union and intersection are not closed because, for example, the union of two connected regions need not be a connected region—see Fig. 8.

Fig. 8
figure 8

Non-closure of union and intersection

Alternative definitions of connectivity

The topological definition of connectivity is: “A connected set is a set that cannot be partitioned into two nonempty subsets which are open in the relative topology induced on the set. Equivalently, it is a set which cannot be partitioned into two nonempty subsets such that each subset has no points in common with the set closure of the other” [23]. This is not a useful definition in the context of the finite digital computer for which the regular polytope is designed, since any half space that cuts a regular polytope, by definition cuts it into two non-overlapping, open regions, each equal to its closure (see section 4.1).

In order to provide a rigorous and useful definition of connectivity in the realm of regular polytopes, it is important first to decide what we wish to mean by “connected”. It is suggested, following the OGC Simple Feature Specification [2] usage, that regions such as those pictured in Fig. 7 should not be considered to be connected, but note that these regions are not regular in the topological sense (see Section 4). A more difficult issue is whether shapes such as those in Fig. 9, where the contact occurs through a region of lower dimensionality, should be considered to be connected.

Fig. 9
figure 9

Marginal ‘connectivity’

Cohn and Varzi [24] identify twelve varieties of connection, based on two criteria. The first criterion is determined by whether the interiors of the regions connect, the closures of the regions, or the regions themselves. This is not an issue with the Regular Polytope representation, since a regular polytope has no boundary points. Thus only the second criterion needs to be considered, reducing the varieties of connection to four, represented as Ca, Cb, Cc and Cd in Fig. 10.

Fig. 10
figure 10

Connection relations Ca to Cd [21], with overlap (OV) depicted

The regions used in Fig. 10 to illustrate Ca to Cd do not themselves overlap, (i.e. in the Cc and Cd cases, y has a hole the exact size of x). The definitions can be expressed loosely as:

  • Ca if the regions touch (at one or more points).

  • Cb if the regions touch at a surface in 3D (line in 2D). (See also Fig. 11)

  • Cc if the regions touch at the entire boundary of one region (in this case x completely fills a hole in y).

  • Cd if one region completely surrounds the other (x completely fills a hole in y and the inner and outer boundaries of y do not touch).

  • OV if one region completely or partially overlaps the other.

Fig. 11
figure 11

Modes of Connectivity in 3D

The Cc and Cd varieties of connection are clearly too strong for most practical uses. These would normally be characterized by the word “enclosure” rather than “connection”. The Cb form of connection is clearly useful, and can be called “strong connection”; it is the Ca form (“weak connection”) which is more problematic. Borgo et al. [25] use the concept of strong connection (Cb) to restrict the definition to what is intuitively a “physical connection” rather than mere contact. The analogy used is that a worm should be able to pass from one region to the other without exposing itself to the outside world. This is the form suggested by van Oosterom, Quak and Tijssen [1].

Connectivity may also be described in terms of the dimensionality of the region of contact [26], i.e. whether the region of contact is a point, line, surface or solid. In 3D, point and line connectivity are cases of Ca, surface connectivity is Cb while solid “contact” is overlap. The interrelation of these approaches in shown in Fig. 11.

Commercial GIS and spatial DBMS products, ISO 19107 [21] and the OGC Simple Feature Specification [2] are at considerable variance in their approaches to this question, and indeed, are often internally inconsistent (e.g. allowing contact between points on inner rings but not outer boundaries) [1]. Ultimately, the decision as to what variety of connectivity should be supported should be based on the “usefulness” of the result, with both forms being useful in different contexts.

In this paper, Ca and Cb are taken to be implied by overlap. Thus:

  • Ca if the regions touch (at least at one point) or overlap.

  • Cb if the regions touch at a surface (line in 2D) or overlap.

  • Therefore: OV ⇒ Cb ⇒ Ca.

Arguments for weak connectivity—Ca

In the Cadastral information domain, connectivity of type Ca is argued for on the basis that any change in the definition of a parcel will affect all neighbours, including the “corner” neighbours.

The fact that a parcel is defined by a point which also is part of the definition of another parcel, could be taken as a reason to assert that the parcels are connected. In Fig. 12, the point p participates in the definition of parcels A, B, C and D, therefore its re-definition by a resurvey will affect all these parcels. (A and C, and B and D are weakly Ca connected).

Fig. 12
figure 12

Cadastral parcels. A resurvey of parcel A could affect parcel C as well as B, D and E

Difficulties with weak connectivity

Although counter-intuitive, it is possible for two Ca connected regions to cross each other without their interiors intersecting—for example, see Fig. 13. This seems to be an undesirable property.

Fig. 13
figure 13

Two Ca connected regions crossing without intersecting

Returning to Fig. 12, a property consisting of the amalgamation of parcels A and C would be Ca connected, as would the amalgamation of B and D, and these two properties would cross without overlapping.

It is clear that neither Ca nor Cb provides the complete answer in all cases, so the algebra should be explored using both forms. As a result, two complementary, but different connection algebras are discussed in this paper. The subscript will be used to make this distinction. In Fig. 12, the weak connection between B and D is notated as Ca(B, D) while the strong connection between A and D is notated as Cb(A, D).

Defining connectivity in the regular polytope

In order to remove arbitrary distinctions between regions, based on concepts that have no real-world importance, “… it is nonsense to ask whether a physical object occupies an open or a closed region of space, or who owns the mathematical line along a property frontier” (Lemon & Pratt page 10) [5], Lemon & Pratt invoke the concept of a “regular set”. A regular set is readily shown to be equal to the interior of its closure. In particular, the interior of the closure of any set is a regular set (possibly empty or disconnected).

The process of forming a regular region in this way removes some kinds of pathological connection such as those in Fig. 7. See the result of these two cases in Fig. 14. However this operation (‘make regular’) does not solve the point wise tangentiality issues in Fig. 6(c) and the polygons in Fig. 9.

Fig. 14
figure 14

The shapes from Figs. 7 and 9 regularised

The critical question with regular polytopes is whether a rigorous definition of connectivity can be formed.

Half space connectivity issues

In defining connectivity, it is essential that if a connected region is bisected by a half space (and its complement), then the two regions so created are connected to one another.

For example, in Fig. 15, if O is a regular polytope, and is divided by a half space H, then if \( O_H = O \cap H \), and \( O_{{\bar{H}}} = O \cap \bar{H} \) ,

Fig. 15
figure 15

A regular polytope bisected by a half space and its complement

$$ \begin{array}{*{20}c} {O_H \cup O_{{\overline{H} }} = (O \cap H) \cup \left( {O \cap \overline{H} } \right)} \hfill \\ { = O \cap \left( {H \cup \overline{H} } \right)} \hfill \\ { = O\,\,\,\,\left( {{\text{by}}\,{\text{the}}\,{\text{definition}}\,{\text{of}}\,{\text{complement}}\,{\text{of}}\,{\text{a}}\,{\text{half}}\,{\text{space}}} \right)} \hfill \\ \end{array} $$

Thus any definition of connectivity must require that \( {\text{C}}(O) \Leftrightarrow {\text{C}}\left( {O_H \cup O_{{\overline{H} }} } \right) \) Note that, since no point can belong to a half space and its complement, it must be possible for convex polytopes to be connected without overlapping.

Regular polytope definition of Ca

The concept of a domain-restricted rational point set interpretation of a regular polytope allows the definition of “pseudo-closure” of a regular polytope. The pseudo-closure of a half-space, H(A, B, C, D), H pc, is defined as the set of all dr-rational points (X, Y , Z, Q), –MQX, Y, ZMQ (extending the range which was –MQX, Y, Z < MQ) such that point (X, Y , Z, Q) ∈ H pc if AX + BY + CZ + DQ ≥ 0. (Note the equal sign, which includes all boundaries). The pseudo-boundary of a half space H(A, B, C, D) is the set of all dr_rational points (X, Y , Z, Q) such that AX + BY + CZ + DQ = 0.

The pseudo-closure C pc of a convex polytope C is defined as:

$$ C^{{pc}} = \mathop \cap \limits_{{i = 1..n}} H_i^{{pc}} \,where\,C = \mathop \cap \limits_{{i = 1..n}} H_i . $$
(def11)

The pseudo-closure O pc of a regular polytope O is defined as:

$$ O^{{pc}} = \bigcup\limits_{{i = 1..m}} {C_i^{{pc}} } \,where\,O = \bigcup\limits_{{i = 1..m}} {C_i } $$
(def12)

The pseudo-closures form the basis of an alternative closed-set topology on the set of dr-rational points.

Two regular polytopes O 1 and O 2 are considered to be Ca connected if a dr-rational point p exists such that p is within O 1 pc and within O 2 pc, i.e. if their pseudo-closures overlap. This will be denoted as Ca (O 1 , O 2 ).

Regular polytope definition of Cb

By contrast, the definition of Cb does not use the pseudo-closure. Instead, an axiomatic definition is used:

$$ {\text{C}}_{\text{b}} \left( {C_{\text{1}}, C_{\text{2}} } \right) =_{\text{def}} \exists C:C \subseteq C_1 \cup C_2 \wedge C \cap C_1 \ne C_{\emptyset } \wedge C \cap C_2 \ne C_{\emptyset } . $$
(def13)

Note that C 1 and C 2 do not need to overlap, but a convex polytope must fit within the union of C 1 and C 2 and must cross the boundary, as shown in Fig. 16. The actual implementation of Cb takes a slightly different form from this definition, but can be shown to be equivalent.

Fig. 16
figure 16

C lies within C1C2, and overlaps C1 and C2

If C 1 and C 2 overlap, i.e. C 1C 2 C , then letting C = C 1C 2 , it is clear that CC 1 C 2 , CC 1 C and CC 2 C . Therefore OV ⇒ Cb.

The implementation of the Cb predicate takes this form (see Fig. 17):

Fig. 17
figure 17

Forming the connection region from convex polytopes

If C 1 and C 2 overlap, then Cb(C 1, C 2) - done.

Otherwise, if there exists one mutually anti-equal pair of half spaces (one half space from each convex polytope) H i C 1, H j C 2, \( H_i = \overline{H}_j \), then

Form the intersection of all the remaining half spaces:

$$ C = {\text{ }}\left\{ {H_k \in C_{\text{1}} :H_k \ne H_i, H_l \in C_{\text{2}} :H_l \ne H_j } \right\}. $$

If this convex polytope is cut by H i and H j , that is to say,CH i C and CH j C , then Cb(C 1, C 2) - done.

(Clearly, from this definition: CC 1C 2, and CH i = CC 1C and CH j = CC 2C ).

Otherwise ¬Cb(C 1, C 2) - done

Equivalently - for C 1 = {H i , i = 1..n}, C 2 = {H j , j = 1..m}

$$ {\text{C}}_{\text{b}} \left( {C_{\text{1}}, C_{\text{2}} } \right) =_{\text{def}} {\text{OV}}\left( {C_{\text{1}}, C_{\text{2}} } \right) \vee \left( {\exists H_i \in C_{\text{1}}, H_j \in C_{\text{2}} :H_i = \overline{H}_j \wedge C \cap H_i \ne C_{\emptyset } \wedge C \cap H_j \ne C_{\emptyset } } \right),{\text{where}}\,C = \left\{ {H_k \in C_1 :H_k \ne H_i, H_l \in C_2 :H_l \ne H_j } \right\}. $$

If there is no anti-equal pair of half spaces, and C 1 and C 2 do not overlap, then they cannot be Cb connected. If more than one pair of anti-equal half spaces exists, then the convex polytopes definitely are not Cb connected.

In Fig. 17, for example, the region C (shown dotted) can be formed in each case by forming the intersection of the two convex polytopes (omitting the anti-equal half space pair), but only in the left hand case does the half space divide C.

For regular polytopes \( O_1 = \bigcup\limits_{{i = 1..n_1 }} {C_{{1i}} }, O_2 = \bigcup\limits_{{j = 1..n_2 }} {C_{{2j}} }, C_b \) can be defined as:

$$ {\text{C}}_{\text{b}} \left( {O_{\text{1}}, O_{\text{2}} } \right) =_{\text{def}} \exists C_{{{\text{1}}i}} \in O_{\text{1}}, C_{{{\text{2}}j}} \in O_{\text{2}} :{\text{C}}_{\text{b}} \left( {C_{{{\text{1}}i}}, C_{{{\text{2}}j}} } \right). $$
(def14)

Properties of Ca and Cb

It is clear that:

$$ \begin{array}{*{20}c} {{\text{C}}_{\text{a}} \left( {O_1, O_2 } \right)\;\;for\;O_1 \ne O_{\emptyset } } \hfill \\ {{\text{and}}\;{\text{C}}_{\text{a}} \left( {{{O}}_{\text{1}}, {{O}}_{\text{2}} } \right) \Rightarrow {\text{C}}_{\text{a}} \left( {O_{\text{2}}, O_{\text{1}} } \right).} \hfill \\ \end{array} $$

and that the same applies to Cb.

That is to say that both Ca and Cb obey the axioms for the definition of the “connects with” relation of the basic RCC theory [27]. It is also clear that

$$ {\text{OV}}\left( {O_{\text{1}}, O_{\text{2}} } \right) \Rightarrow {\text{C}}_{\text{b}} \left( {O_1, {\text{ }}O_2 } \right),\,{\text{and}}\,{\text{that}}\,{\text{C}}_{\text{b}} \left( {O_1, \,O_2 } \right) \Rightarrow {\text{C}}_{\text{a}} \left( {O_1, \,O_2 } \right). $$

It is important to note that the details of the definitions, and in particular the use of dr-rational numbers and pseudo-closure are in some sense “under the covers”. To the outside observer, the definition of half space, and therefore convex and regular polytopes is in terms of integers (A, B, C and D). It is only when connection or overlap is to be determined that dr-rational arithmetic is required.

Internal connectivity of regular polytopes

Neither Ca(O 1, O 2) nor Cb(O 1, O 2) imply that O 1 or O 2 are internally connected. For example, in Fig. 18, regular polytopes A (hashed) and B (shaded) are Cb connected to each other, but B is not internally connected.

Fig. 18
figure 18

Regular polytope connectivity

A regular polytope can be defined as “Ca connected” by induction as follows:

A Ca connection S is defined as a set of convex polytopes S = {C i : i = 1..j} such that:

  • S is a Ca connection if j = 1 and ¬Empty(C j ).

  • CO, S′ = {C, C i : i = 1..j} is a Ca connection if {C i : i = 1..j} is a Ca connection , and ∃ ij such that Ca(C, C i ).

  • (Note—this implies ¬Empty(C)).

Figure 19 shows a regular polytope consisting of seven convex polytopes. These are grouped into three Ca connections. A Ca connection is by definition a regular polytope, and a regular polytope is said to be Ca connected if it is a Ca connection.

Fig. 19
figure 19

Regular Polytope containing three Ca connections

Internal Cb connectivity can be defined in the same way for regular polytopes. Note that the regular polytope in Fig. 19 has four Cb connections, with the connection marked 2 being composed of 2a and 2b which are separated as Cb connections. Note also that if a regular polytope contains any empty convex polytopes in its definition, then it cannot be Ca or Cb connected (by the above definition). This is the reason that a regular polytope is defined as a set of non-empty convex polytopes in Section 2.3.

Defining the connection relations

The implementation strategy for regular polytope connection predicates proceeds as follows:

  • Intersection, union and negation on regular polytopes are defined as described in Section 2.3.

  • Define Empty(C) on convex polytopes to implement: Empty(C) = defp, pC.

  • Use this to define OV(A, B) and Empty(A) on regular polytopes A, B.

  • Use these to define AB =def Empty (\( A \cap \overline{B} \)) (denoted P(A, B) in the RCC – see Section 5)

  • Define equals (A = B) =def (AB) ∧ (BA) (denoted EQ(A, B)).

  • Define connection as Ca and/or Cb as required.

  • Define all remaining Region Connection Calculus relations (see Table 1).

Table 1 The basic relations of RCC theory [6]

This is the approach that was used to implement a set of Java classes in 2D and 3D [28], and rigorously defines all the relations, but is not the sequence of definitions as given in [6], since that approach is not compatible with a finite topological space. The original approach was to define the “part of” relation P(A, B) (defined as AB above) in terms of the connection relation. The definition was:

$$ {\text{P}}\left( {A,B} \right) =_{\text{def}} \forall Z\left[ {{\text{C}}\left( {Z,A} \right) \to {\text{C}}\left( {Z,B} \right)} \right] $$

This had the unwanted and surprising side effect that it required the space to be non-atomic. Randell, Cui and Cohn [6] discussed the possibility of an “atomic” RCC theory, defining:

$$ {\text{PROP}}\_{\text{REGION}}(A) =_{\text{def}} \exists Z:{\text{NTPP}}\left( {Z,A} \right) $$

It was shown by Düntsch et al. [29, 34], however, that this definition is redundant, and that all regions in an RCC must be proper. Roy and Stell [30] discuss this in a context of a discrete space, and conclude that this definition cannot be maintained. The approach they use defines a dual pseudo-complement, but this is unnecessary in the case of the regular polytope topology, since the issue of boundaries and closure has been addressed by the definition of half space used. Instead, it can be shown that the space of regular polytopes forms what could be called a “Finite Boolean Connection Algebra”.

Regular polytopes as a Boolean connection algebra

It can be verified readily that the axioms of a Boolean Algebra [20] are satisfied by the set of regular polytopes, with the role of the zero (0) being fulfilled by the empty regular polytope O , and 1 by the universal regular polytope O . The Boolean operations “and” (∧) and “or” (∨) are represented by the intersection (∩) and union (∪) operations as defined for regular polytopes. The proof of this assertion can be found in [15], and follows directly from the definitions of intersection, union and complement.

Roy and Stell [30] also add axioms equivalent to the following to define connectivity, thus creating a Boolean Connection Algebra:

  1. (B1)

    C(A, B) ⇒ C(B, A)

  2. (B2)

    C(A, A) for AO

  3. (B3)

    \( \forall A \; \left( {{{A}} \ne {\text{O}}_{\emptyset }, {\text{O}}_{\infty } } \right):C\left( {A,\overline{A} } \right) \)

  4. (B4)

    AO , BO , CO : C(A, BC) ⇔ [C(A, B) or C(A, C)].

  5. (B5)

    AO , ∃ BO : ¬C(A, B).

It has been shown [15] that the space spanned by regular polytopes satisfies these axioms apart from the final “non-atomic” axiom (B5), using strong (Cb) or weak (Ca) connectivity. It is also shown that the closely related axioms of a weak proximity space [31] are satisfied.

The final axiom (B5) and the equivalent “strong” axiom of the Proximity space, in effect state that for any proper subset of the space, there exists another subset which is not connected to it. It is readily shown that this cannot be satisfied by a finite space [30, 34].

  • Consider \( \overline{A} \) to be an atomic set, AO , such that A′AA′ = A or A′ = O .

  • Consider \( \bar{A} \), the complement of A:

  • \( \overline{A} \ne {\text{O}}_{\infty } \Rightarrow \exists {\text{B}} \ne {\text{O}}_{\emptyset } :\neg {\text{C}}\left( {\overline{A}, B} \right) \). (by (B5).

  • But \( \neg {\text{C}}\left( {\overline{A}, B} \right) \Rightarrow B \subset A \). Contradiction.

  • Therefore there can be no atomic set in a space that satisfies (B5).

Without this axiom, the space spanned by regular polytopes can be called a Finite Boolean Connection Algebra, or a Weak Proximity Space.

Conclusion

Using the regular polytope, it is possible to rigorously define connectivity, overlap, and equality of regions. This allows the full set of RCC relations to be defined as follows (Table 1).

At first sight, this seems to be a small number of relations compared to the 512 that can be identified using the Egenhofer 3 × 3 matrix [32], but as has been shown by Zlatanova [33], only eight of them are distinct and applicable to pairs of surfaces in 2D, or pairs of solids in 3D. All of the predicates in Table 1 are derivable from those eight. Note also that for all of the predicates which are defined in terms of C, there are two varieties—based on Ca and Cb, thus the predicates DCa, DCb, ECa, ECb, TPPa, TPPb, NTPPa and NTPPb can be defined.

It has been shown [4, 15] that the space of regular polytopes obeys the axioms of the Region Connection Calculus [6] based on the definitions given in section 2, and that it forms a Weak Proximity Space [31]; and a Boolean Connection Algebra [30]. It is important to remember that it is the computational representation that satisfies the axioms, not an abstraction which is approximated by the computational representation. Thus it is possible to computationally apply the operations in any combination with complete confidence that no logic failure can result.

The regular polytope has been shown to be a viable and robust model for the representation of spatial objects. This representation has been shown to possess a useful, complete, rigorous and closed logic, in the computational domain. It is important to note that the logic is applied to the representation itself. The representation is not just an approximation of a mathematical model which displays the logic. Thus the programming can proceed without generating a large number of special cases (or surprises).

Comparison with other approaches

In common with the infinite precision rational number approach, the Regular Polytope objects cannot be rotated through an arbitrary angle with exact results. This is also true of objects stored using integers or floating point numbers. It is given that, in a limited precision computer, there must be approximations [11], with the variation being in the frequency and impact of these approximations. The important fact, and that which makes the Regular Polytope and infinite precision rational approaches so valuable is that the underlying spatial algebra is rigorous (in common also with the Realms and Dual Grid approaches in 2D).

The differentiation between this and the infinite precision rational number approach is to be found in the precision requirements. The probability that a randomly selected rational number can be simplified (by determining a common factor between numerator and denominator and dividing through) is only about 40% (actually 1-6/π2) [15,35]. Thus it cannot be expected that there will be any appreciable savings to be gained by simplifying rational numbers.

In 2D, the increase in precision requirements in the infinite precision rational number approach is fairly modest, but this is not true of the 3D case. If the intersection of two polyhedra is calculated, the new points generated can require seven times the storage space of the original points [15]. Thus, assuming ordinary 32bit integers for the first generation, any derived objects may require 224bit integers to store. This continues through subsequent generations—1568bit, 10968 etc.

This is not true of the Regular Polytope. The storage requirements do not increase, and there is no loss of computational power over time, no matter what the depth of the computational complexity. Ordinary 32 and 64 bit integers are sufficient to store the half space definitions, and, although more precision is needed internally to calculate predicates such as “isEmpty”, there is no need to store these higher precision numbers.

Implementation in Java

A demonstration suite of software has been written in Java, which implements all of the basic functions listed in Tables 1 and 2. This has been demonstrated with practical volumes (about 1000 parcels) of real Cadastral data [28]. In many of the cases such as those in Fig. 20, the predicates defined in Java are defined exactly in terms of their theoretical definitions.

Table 2 Topological functions
Fig. 20
figure 20

Java implementation of partOf and equals

In this paper the important issue of connectivity has been discussed and though not trivial two alternate definitions been given, the later having advantages in robustness. It has been shown that the regular polytope representation can support the Relation Connection Calculus, and could appropriately be referred to as a Finite Boolean Connection Algebra.

The technique has been shown to be computable, both theoretically—using rigorous proofs, and practically—using demonstration Java programs.