Abstract
In (digital) grids, neighbor relation is a crucial concept; digital distances are based on paths through neighbor points. Digital distances are significant, e.g., in digital image processing for giving an approximation of the Euclidean distance and allowing incremental algorithms on images. Neighborhood sequences (i.e., infinite sequences of the possible types of neighbors) are defining digital distances with a lower rotational dependency than the distances based only on a sole neighborhood. They allow one to change the used neighborhood condition in every step along a path. They are defined in various grids, and they can be periodic. Generalized neighborhood sequences do not need to be periodic. In this paper, the triangular grid is studied. An equivalence and two partial order relations on the set of generalized and periodic neighborhood sequences are shown on this grid. The first partial order, the “faster” relation, is based on distances defined by neighborhood sequences, and it does not provide a lattice but gives a relatively complex relation for neighborhood sequences with a short period. The other partial order, the relation “componentwise dominate”, defines a complete distributive lattice on the set of generalized neighborhood sequences. Finally, a relation of the above-mentioned relations is established. Important differences regarding the cases of the square and triangular grids are also highlighted.
Keywords:
digital distances; digital geometry; neighborhood sequences; partial orders; equivalence classes; non-traditional grids MSC:
68R99; 52C05; 06A06; 11H06
1. Introduction
The present paper has various roots in mathematics. On the one hand, digital geometry (a field that is closely connected to graph theory, geometry and combinatorics and that has applications in crystallography, image processing and computer graphics [,]), including the theory of digital (path-based) distances on various grids, was started by the seminal works of Rosenfeld and Pfaltz in the 1960s. They defined the two basic movements (steps) on the square grid (see [,]): the cityblock (also called the Manhattan taxicab) motion that allows horizontal and vertical steps only, while the chessboard motion allows diagonal steps also as when a king moves on the chessboard.
In digital spaces, e.g., on a computer screen, the geometry is not the same as in the continuous spaces: instead of the Euclidean geometry, digital geometry is applied. There is an underlying grid, and pixels or gridpoints are arranged accordingly; the neighborhood relation is crucial, while no neighbor points exist in Euclidean geometry. Consequently, digital distances are based on the steps/moves to neighbor pixels/points. However, the digital distances based on the cityblock or on the chessboard moves are a rough approximation of the Euclidean distance and have a large rotational dependency, i.e., to go in different directions, e.g., horizontal and diagonal (0 and , respectively), the same number of steps leads to connected points with a Euclidean distance of a factor.
Therefore, Rosenfeld and Pflatz previously coined the idea of alternating use of these two motions to have a digital distance with a lower rotational dependency []. These octagonal distances are obtained by the mixed use of the two basic motions. The theory was further developed when arbitrarily long periodic sequences of cityblock and chessboard steps, named neighborhood sequences, were studied in [,] (to distinguish those neighborhood sequences. Some more general ones were introduced later on, and we refer to these as periodic neighborhood sequences throughout this paper).
Digital distances are useful for stepwise approximations and simulations with incremental algorithms, e.g., computing distance transform in digital image processing and various algorithms in computer graphics. Moreover, as these distances always have integer values, it is easy to use them without rounding errors. Das et al. also provided a formula for calculating the distance between two arbitrary gridpoints based on any periodic neighborhood sequence. Based on this formula, a partial order relation on the set of periodic neighborhood sequences was investigated in [].
This result connects our topic to other fields of mathematics. When there is a set of objects, e.g., the set of neighborhood sequences (and distance functions based on them), one may be interested to know how the objects of the set are related to each other. Various relations and algebraic concepts are known to help to describe the inner structure of a set. Now, we come back to the history of neighborhood sequences in the next section with a brief literature review.
In this paper, we use both periodic and generalized neighborhood sequences. Our motivation here is to show that similar algebraic concepts can be studied on sets of neighborhood sequences on a triangular grid and a square grid; thus, our results are somewhat analogous to the results of [,] with some interesting and remarkable differences. Moreover, a better understanding of the structure of the sets of neighborhood sequences allows us to know more about the distances based on them and also helps to find adequate neighborhood sequences and/or distances based on them in various applications.
On the triangular grid, there is also a natural equivalence relation on the sets of neighborhood sequences based on the distance function that they define; thus, after recalling the necessary definitions and preliminaries, we start our results with this equivalence relation. Although this result appears to be an easy consequence of some previous studies (see, e.g., []), we present it for the following two reasons.
On the one hand, it highlights an important difference between the square and triangular grids, which has various interesting consequences later on. On the other hand, the partial order that we consider first is a relation on the above-mentioned equivalence sets. This partial order and equivalence relation have a close connection to the distances defined by the neighborhood sequences. Further, another partial order relation is also studied. By this second partial order relation, lattice structures can also be obtained with some additional properties.
We also highlight the main differences between the cases of square and triangular grids in view of the mentioned relations and their analogous relations on the other grid, as the latter one is, in fact, not a point lattice (i.e., the triangular grid is not translation invariant to all grid vectors). Our last two theorems establish some connections among the considered relations. More precisely, our results are as follows. (For a better explanation, see Section 4).
The first two results are more or less the rephrasing or formal stating of known things:
- On the set T of generalized neighborhood sequences of the triangular grid, the relation of defining the same distance function is an equivalence relation (Theorem 1).
- The faster relation is a partial order both on the equivalence classes of T and of the set of periodic neighborhood sequences on the triangular grid (Theorem 2).
The following results are our main results:
- The set does not form a lattice under the faster relation (Theorem 3).
- The set T does not form a lattice under the faster relation (Theorem 4).
- Incomparability of two generalized neighborhood sequences of the square grid under the componentwise dominate relation implies that the given neighborhood sequences cannot have the same speed, i.e., it cannot happen that both of them are faster than the other (Proposition 5).
- The set S of generalized neighborhood sequences of the square grid is a Boolean lattice under the componentwise dominate relation (Theorem 5).
- The set T is a complete distributive lattice under the componentwise dominate relation (Theorem 6); however, it is not a Boolean lattice (Proposition 7).
- The set is a distributive lattice under the componentwise dominate relation (Theorem 7); however, it may not be complete (Theorem 10).
- The maximal equivalent neighborhood sequence of any generalized neighborhood sequence of T is defined and computed (in the proof of Theorem 8).
- The relations faster and componentwise dominate have more complex and sophisticated structures on T than do their analogous relations on S (Theorems 11 and 12).
In the next section, a brief literature review is given allowing the reader to better understand and place our results. Then, in Section 3, necessary definitions and preliminaries are recalled about the triangular grid itself, about the neighborhood sequences on the triangular grid and about lattice theory. These parts before starting with the real results in Section 4 may seem lengthy; however, we would like to have the paper self-consistent such that readers without much background in these fields can also read and understand how the results are connected to these fields. Section 5 shows how our results can be applied, and our concluding section summarizes our results and also give links to future works.
2. Literature Review
Here, we recall parts of the history of digital distances. As we previously mentioned, Rosenfeld and Pfaltz defined the first digital distances. Around the same time when Das and their co-authors conducted their fundamental studies regarding periodic neighborhood sequences in the 1980s, a similar type of generalization of the basic digital distances was introduced under the same “neighborhood sequence” name [,] using some more general predefined motions (but still restricting the work to periodic sequences).
In [,], the concept of neighborhood sequences appeared with another type of generalization that also allowed non-periodic infinite neighborhood sequences. In [], partial order relations were introduced, and the lattice properties of the set of these neighborhood sequences were analyzed extending the results of []. In [,], a greedy shortest path algorithm, a necessary and sufficient condition for neighborhood sequences to define metrical distances and a formula to compute distances between any pair of points was proven.
Higher dimensional extensions of these digital distances were also studied, see, e.g., []. Approximation of the Euclidean distance has been studied in [,,,] in various dimensions. Various image processing algorithms, e.g., distance transforms [,,], have been developed; moreover, the distances based on neighborhood sequences have a close connection to integer sequences [].
A generalization giving various real-valued weights to the diagonal steps was also investigated to give perfect approximation of the Euclidean distance on a perimeter of a square [,], while another type of generalization using a larger set of neighbor relations was developed under the name “broadcasting sequences” [,,]. These papers show that neighborhood sequences have already been efficiently applied on a square grid.
Another way to have a digital distance with a lower rotational dependency is to use a non-traditional grid instead of the traditional (i.e., the square/rectangular) grid. The hexagonal and the triangular grids also provide regular tiling of the plane, and moreover they have better symmetric properties compared with the square grid [,,].
In [], Deutsch described the basic three types of neighborhoods in a triangular grid. Stojmenovic and Nagy, in [] and in [,], respectively, used three coordinate values to represent a honeycomb grid and triangular tiling of the plane. These are dual notations of the same structure. In this paper, we use a triangular grid with triangle pixels (trixels for short). For defining digital distances on this grid, the concept of a generalized neighborhood sequence was used in [,]. The applicability of the neighborhood sequences and of the distances based on them is shown in [,], where applications in image processing and in networking are presented.
3. Basic Definitions and Preliminaries
To allow us to formally write our results, in this section, we provide the basic definitions and notations. In this paper, and denote the set of positive integers, nonnegative integers and integers, respectively. We also recall some basic facts about the neighborhood sequences and the distances based on them.
First, we recall the description of the triangular grid using three coordinate values to address the cells of the triangular grid, i.e., trixels.
3.1. Description of the Triangular Grid
Figure 1 (right) shows a part of the grid with coordinate axes and coordinate triplets for the points of the grid (for details, we refer to [,,]). The coordinate system reflects the symmetry of the grid. The points are represented by trixels; however, throughout the paper, we usually refer to them as points.
Figure 1.
Various (strict) neighborhood relations (left) and a part of the grid with the symmetric coordinate system (right).
If the sum of the coordinates of a point p is 0, then we call this point even. If the sum is 1, then we call this point odd. Graphically, the even points (as triangles) have the same orientation as the origin, and the odd points (triangles) have the opposite orientation.
Since we have two types of points, the triangular grid is not a point lattice, e.g., not every grid vector transforms the grid to itself.
Definition 1.
Let p and q be two points in the triangular grid (plane). The i-th coordinate of the point p is indicated by . Let m be 1, 2 or 3. The points p and q are m-neighbors, if the following two conditions hold:
- for,
- .
In the case of equality at the second condition, we use the term strict m-neighbors as well.
The coordinate-values of the points and the definition of neighborhood relation harmonize (see Figure 1) and return the same neighborhood relations as the ones used in [].
On the square grid, the description of neighborhood relations is similar to Definition 1 using the Cartesian coordinate system and addressing the points of grid by the elements of . Accordingly, the one-neighbor relation corresponds to the cityblock neighborhood, while the two-neighbor relation corresponds to the chessboard neighborhood.
Now, we recall some known parts of the theory of neighborhood sequences concentrating on the triangular grid.
3.2. Neighborhood Sequences
We start this subsection with the definition of neighborhood sequences for both square (see, e.g., [,,]) and triangular grids ([,,]).
Definition 2.
A neighborhood sequence on the triangular grid (on the square grid) is an infinite sequence , where (, resp.) for all . If there exists such that , , then B is periodic (with period l). In this case, the abbreviation is used.
Let T (S) and () denote the sets of general and periodic neighborhood sequences on the triangular (square) grid, respectively.
In some papers, to distinguish the general scenario, when non-periodic neighborhood sequences can also be used, the term “generalized neighborhood sequence” is used [,]; however, here and on the triangular grid in general, if we do not restrict ourselves to only periodic ones, we may simply use the term “neighborhood sequence”. We use neighborhood sequences to define path-based (digital) distances as follows.
Definition 3.
Let p and q be two points (in the triangular grid or in the square grid), and let be a neighborhood sequence (respectively). The point sequence of the form , with -neighbor points and for each , is called a B-path, i.e., a path from p to q with respect the neighborhood sequence B. Further, the length of the path is m. Let a B-path from p to q with minimum length (with respect to B) be denoted by . The distance from p to q is defined as the length of such a shortest path and is written as Since the distance is defined by B, it is called the B-distance.
The above-defined distance functions may not satisfy the metric properties. On the rectangular grid, there are already neighborhood sequences that define distances without satisfying the triangular inequality; however, these distances are always symmetric on that grid. Here, we show that the case of the triangular grid is more interesting and challenging.
Example 1.
Let , , and . In this case, , but . Thus, this distance does not meet the triangular inequality. Furthermore, there is a property of B-distances of a triangular grid that does not occur in the rectangular case; it is possible that the B-distance is non-symmetric. Let , , then opposite to .
To use the neighborhood sequences in various applications, a/the shortest B-path and the B-distance are computed from any point to any other and necessary and sufficient conditions are proven for a neighborhood sequence to define a metric (see [,,] for these results on the rectangular grids and [,,] on the triangular grid).
The following fact about B-distances on the square grid can be shown, e.g., based on the algorithm providing a short/the shortest B-path. This is connected to one of the important differences between B-distances on the two grids.
Proposition 1.
On the square grid, each neighborhood sequence defines a unique distance function injectively, i.e., if are two different neighborhood sequences (), then there are points such that .
This is not the case on the triangular grid; thus, we require some further notions. The next concept, the minimal equivalent neighborhood sequence, and the related result are recalled from [].
Definition 4.
Let and be two neighborhood sequences. is the minimal equivalent neighborhood sequence of B if the following conditions hold:
- for all points; and
- for each neighborhood sequence, if for all points, thenfor all.
Lemma 1
(Nagy []). The minimal equivalent neighborhood sequence of B is uniquely determined and is given by
- if;
- , ifand if there is no, such that;
- , ifand there are somewithandis odd, where
- , otherwise.
As we shall see later, this concept and result has a good connection with the “componentwise dominate” relation (that we recall formally in Definition 9). By that terminology, one can say that any neighborhood sequence B componentwise dominates its minimal equivalent neighborhood sequence.
Now, we recall the main theorem of []. First, we need some further notions and notations.
For a neighborhood sequence B, let be the minimal equivalent neighborhood sequence of B, and let be the neighborhood sequence that is obtained from by replacing its first value 3 by 2 (if it has any value 3). Further, the sequence obtained from B by replacing all its values of 3 with values of 2 is denoted by . Thus, .
For two points and , let and be defined as the sorted difference vector of p and q: let be the value with highest absolute value among , let be the value with the smallest absolute value among these values, and let be the third value. (For disambiguation, if the largest absolute value appears twice, let the positive one be and the negative one be .)
Now, we are ready to recall the formula for computing the B-distance.
Lemma 2
(Nagy []). Let two points and and a neighborhood sequence be given. Let the sequences , and be given accordingly. Further, let where k is the index of the first element 3 of B (if there is no value 3 in B, then ).
Now, let
The B-distance from p to q can be computed by the following formula
The concept of digital disks based on neighborhood sequences is also recalled (see, e.g., []).
Definition 5.
Let B be a neighborhood sequence on the triangular grid. Then, for any point p of the grid and for any natural number ,
denotes the digital disk (based on the B-distance) with center p and radius r. In the case where p is the origin, the notation can be simplified to .
We note here that the digital disk with a radius r depends only on the first r elements of B.
3.3. Lattice Theory
We assume that the reader is familiar with the basic concepts of lattice theory, otherwise they aer referred to review the following concepts in [,] or another standard textbook on the topic. Here, we list them to show the notation we use:
- Equivalence relation with equivalence classes .
- Partially ordered set .
- Supremum (least upper bound, for any ) of a set.
- Infimum (greatest lower bound ) of a set.
- Lattice, distributive lattice.
- Complete lattice (with a supremum and an infimum for any ).
- Complete distributive lattice and Boolean lattice (Boolean algebra).
4. Relations on the Set of Neighborhood Sequences in the Triangular Grid
The results of the paper are shown in this section. First, the equivalence relation and the partial order relation “faster” on the equivalence classes of neighborhood sequences are shown, and then some algebraic properties of this partial order relation are presented. Finally, the “componentwise dominate” relation will be investigated with details.
4.1. An Equivalence Relation
In this section, we formally establish the equivalence relation among the neighborhood sequences that has been previously mentioned.
Definition 6.
Let and be two neighborhood sequences in T. We say that they are equivalent, i.e., , if, for every pair of points , ).
Based on the definition of minimal equivalent neighborhood sequences, we may establish the following statement.
Lemma 3.
For any two neighborhood sequences and , , if and only if their minimal equivalent sequences coincide.
Based on that, we can conclude the following result.
Theorem 1.
The relation ∼ is an equivalence relation on the set T of generalized neighborhood sequences.
Proof.
Using Definition 6, ∼ is reflexive, symmetric and transitive, and therefore it is an equivalence relation. □
By comparing this result to the square and nD rectangular grids, it is important to note that there are no two different neighborhood sequences that generate the same distance function on those grids. By the mirror of this fact, the forthcoming relations on the neighborhood sequences on the triangular grid also have some interesting properties in which the case of the triangular grid differs from the case of rectangular grids.
For further purposes, we fix the following notation.
Definition 7.
Let denote the equivalence class of neighborhood sequences defined by ∼:
We say that B is a representative of the set or that B represents this class.
There exists neighborhood sequence B for which the class contains only the neighborhood sequence B itself and no other neighborhood sequences. One can obtain neighborhood sequences with this property based on Lemma 1, e.g., every neighborhood sequence without containing any value of 3 is satisfying this property.
4.2. A Partial Order Defined by B-Distances
Since there are several, there are actually infinitely many distance functions that are defined by neighborhood sequences; thus, the question arises of how they are related to each other. The next definition is recalled from [].
Definition 8.
For any , we define the relation “faster” denoted by in the following way:
for all points .
The relation can be understood on the set of equivalence classes of neighborhood sequences as well; however, for simplicity, we use the above notations, where and represent their equivalence sets, respectively. When we are talking about periodic neighborhood sequences, then only the elements of are counted.
Notice that equality is allowed by the relation ; thus, the term “is faster than or has the same speed” would match better to it; however, for traditional reasons, we use the short term “faster”.
Similarly, the relation is defined on the sets of S and , and it was studied in [,] as it also plays an important role in the metricity condition.
Proposition 2
(Fazekas et. al. []). On the square grid forms a complete distributive lattice. On the other hand, is not a lattice.
The equivalence classes for the neighborhood sequences on the square grid are singleton sets, i.e., each of them has exactly one element, and therefore this element can be used to represent this class or used instead of the class itself.
The next examples demonstrate the non-triviality of our partial order for the case of periodic neighborhood sequences.
Example 2.
Let such that , . Further, let the points , , and . Then, , but . Therefore, the functions -distance and -distance are not comparable, in general.
We should note here that similar examples can also be constructed on the square and other grids using B-distances. Our next example, however, does not work on point lattices but does work on the triangular grid.
Example 3.
Let , and the points , and . Then, one may see that but .
This example shows that, although we have the same sum of the values in the sequences, (i.e., ), their order makes a difference on the distance: the steps of a shortest path may not commute []. We note here that, on the square- and nD grids the B-distance of the point-pair depends only on the multiset of used elements of the neighborhood sequence and does not depend on the order of the first elements of the neighborhood sequence [,].
Now, after these introductory examples and thoughts, let us see how and which neighborhood sequences are comparable on the triangular grid.
Theorem 2.
The relation is a partial order on the sets of equivalence classes of T and .
Proof.
By definition, the relation is reflexive and transitive. In defining it for the equivalence sets, it is clear that, if and , then , and thus ; therefore, they represent the same class. □
As we have previously seen in Example 3, the neighborhood sequences and are not comparable under the relation . In terms of digital disks, this means that and ; see also Figure 2, where digital disks with radii up to 3 are presented with the (periodic) neighborhood sequences , and .
Figure 2.
Digital disks with neighborhood sequence on the left, with on the right and with at the bottom. The origin is marked with gray color, disks with radius 1 are dark shaded, disks with radius 2 are (dark and) medium color, while for disks with radius 3, all shaded pixels are counted.
Based on Lemma 2, and by observing the digital disks obtained by neighborhood sequences (see [,,] for details), we may consider the following important observations.
Proposition 3.
In the triangular grid, from any point
- (a)
- By a 2-step, exactly the same region (i.e., set of points) is reached as by two consecutive 1-steps.
- (b)
- By two consecutive 2-steps, a larger region can be reached than by using a 1-step and a 3-step in any order.
We can transform part (b) of the above proposition into the next lemma about the partial order .
Lemma 4.
The following statements hold for the specific periodic neighborhood sequences mentioned below.
However, and .
Proof.
The first and the second statements follow from the formula of Lemma 2.
The first part of the last statement of the lemma is proven, for instance, by looking the points that can be reached in one step: in one step, a larger set of points is reached by than by , i.e., . To prove the other part, consider the B-distances of the points and . By the formula of Lemma 2, and , proving the incomparability of the neighborhood sequences and under on the triangular grid. □
Now, we establish our results on the structure of T and under . Some of the results may seem simple or easy to prove; however, they give important information about the sets T and of neighborhood sequences. They also underline the differences between the distances defined on the square and on the triangular grids. Figure 3 shows the partial order on the sets of periodic neighborhood sequences with periods 1, 2 and 3 for both of the square and triangular grids. As one can observe, the diagram of with period 2 already appears more complicated than the diagram of with period 3 (the diagrams on the top are recalled from []). The Hasse diagrams shown here compress a number of comparisons of B-distances.
Figure 3.
The Hasse diagrams of the partial orders (top) and (bottom) restricted to neighborhood sequences with periods 1, 2 and 3, from left to right, respectively.
One can observe on Figure 3, bottom-right, that, for instance, the neighborhood sequence is faster than , , , and all the neighborhood sequences below them, i.e., , , , , , , , and . By, e.g., the formula of Lemma 2, one can see that there is no point that can be reached in one step by any of the listed neighborhood sequences B but not with the neighborhood sequence . That could be the base of the induction. The inheritance can be proven for each particular case (applying also, e.g., Proposition 3) by checking the sums of the prefix of the (minimal equivalent) neighborhood sequence B and comparing the same length prefix of , i.e., to the number that is twice the length of the prefix.
On the other hand, , , , , , and are faster than . All those relations can be seen since any path defined by is also a path with any of the listed neighborhood sequences; thus, the distance determined by cannot be smaller than the B-distance defined by another neighborhood sequence in this list. (Trivially, is faster than itself. We mention this only for the sake of completeness).
Further, there are neighborhood sequences such that they are incomparable with under the relation faster. Each of those neighborhood sequences B are listed below with two points such that the B-distance of exactly one of the points, p, is smaller from the origin than its -distance, while, for the second point, q, its B-distance is larger than its -distance from the origin.
- , and ;
- , and ;
- , and ;
- , and ;
- , same points as above;
- , and .
The relations among other neighborhood sequences can be shown in a similar manner.
Now, as the first of our main theoretical results about , we show the following.
Theorem 3.
The set of periodic neighborhood sequences is not a lattice.
Proof.
Let and be periodic neighborhood sequences. Notice that , while
The least upper bound of these sequences in can be written as
, which belongs to the equivalence set
Notice that contains only three values of 2. Clearly, there is no element of that is in . Now, let us suppose, on the contrary, that there is a neighborhood sequence in and for some value . Then, in T but ; therefore, there must be such that holds.
- may contain an element larger than 2 among its first three elements. (Clearly, it cannot contain values smaller than 2 at these positions without contradicting the fact that .) However, in this case, for the periodic sequence , we have (and ), but (as one can easily check) and . That leads to a contradiction.
- In the other case, it means that there is a value (for a value ) such that ; however, . Without loss of generality, suppose that, for all : holds. Then, defining for and as a periodic neighborhood sequence with period , clearly and . However, in this case, , which leads to a contradiction.
Therefore, cannot be in . □
By the previous proof, we demonstrated the following fact.
Corollary 1.
Even if the supremum of two periodic neighborhood sequences exists, it may not be periodic.
By the following theorem, we show the case with the set of general neighborhood sequences.
Theorem 4.
The set of neighborhood sequences on the triangular grid is not a lattice.
Proof.
Let
and
(The last two values are repeated for each of these sequences up to infinity). Observe that and form a singleton equivalence set under ∼. Clearly, and . Let such that and . Then, one can easily infer that . Further, the first two elements of can be at most 2. Let us assume that the first difference of and occurs at their st position, i.e., for all ; however, . Then, would imply that . It can only be if and , which contradicts .
Clearly, but (since the order of elements 1 and 3 matters). Therefore, and have no greatest lower bound, completing the proof that T is not a lattice. □
In the previous proof, we used non-periodic sequences. Thus, it seems that none of T and form a lattice under the relation . This also highlights an important difference between the square and the triangular grid. In the next subsection, another relation will be investigated on T and .
4.3. Lattices
The results of the previous subsection recommend that, instead of the relation , we may use another relation to find some structure in T and in . Now, we adopt another partial order relation that was investigated in [] for S and and is called “componentwise dominates” in [] for some subsets of . We have also seen that it plays a natural role when we defined and used minimal equivalent neighborhood sequences in T.
Definition 9.
For any two neighborhood sequences , , the relation ⊒ is defined in the following way:
Let us have a more detailed view of the structure that this relation gives to the sets S and on the square grid. It should be noted that is a proper refinement of ⊒ in S and ; more formally, we can state the following results (based, e.g., on the formula to compute B-distances on the square grid [] or on the properties of a faster relation from []).
Proposition 4.
Let . If , then . Furthermore, if and , then .
Proof.
It is a corollary of the formula to compute B-distances on the square grid; see Proposition 1 and Definition 9. □
Moreover, we state the following.
Proposition 5.
Let . If and , then and cannot be at the same time, i.e., at most, one of them may hold.
Proof.
Generally, for , there could be three cases, either both and hold, or maybe exactly one of them, or maybe none of them.
If the condition and holds:
- We may have that and are incomparable under . Let us consider, e.g., and . Then, considering the points and , their -distance is 2; however, their -distance is 3. On the other hand, by considering and , their -distance is 4, while their -distance is 5.
- However, it may also happen that, e.g., , and we check the case, e.g., with and . (By changing the role of and , the opposite relation can be fulfilled.)
Now, to complete the proof, let us assume that and for . It follows that . Thus, there is a position i where the first mismatch occurs in these two sequences, i.e., for all but . Then, considering the points and with , i.e., k is the number of 2s among the first elements of (and also of since their long prefix sequence are identical). Then, one of the - and -distances of these points is i, the other is , and hence it cannot be that both and hold. □
Moreover, the following results are known.
Proposition 6
(Fazekas et al. []). is a complete distributive lattice with the greatest lower bound and least upper bound .
is a distributive lattice with the greatest lower bound and least upper bound ; however, it is not a complete lattice.
Our first result in this subsection is a kind of strengthening of (the first part of) the previous result on the square grid.
Theorem 5.
is a Boolean lattice (Boolean algebra).
Proof.
A Boolean algebra, by definition, is a complemented distributive lattice. By Proposition 6, is a complete distributive lattice, and we need to show only that it is also complemented. Having exactly two types of neighborhood, the complementary relation can easily be defined on them: with 1 and 2 as complements of each other. This complementarity relation can also be extended to the neighborhood sequences: the complement of the neighborhood sequence , contains the opposite element in every of its positions. In this way, both the axioms of complements: and are satisfied for every neighborhood sequence B on the square grid. Thus, the statement is proven. □
Now, we turn to analyze the componentwise dominate relation on neighborhood sequences of the triangular grid. In the following part, the sets T and are analyzed under ⊒.
Theorem 6.
is a complete distributive lattice with the greatest lower bound and least upper bound .
Proof.
By Definition 9, ⊒ is a partial order on T. Moreover, for any , , we can define as and as . Furthermore, for any set P of neighborhood sequences , their greatest lower bound
and least upper bound
is determined; thus, the completeness of the lattice is shown. This implies also that and . Finally, the distributivity of the lattice is straightforward. □
However, there is a remarkable difference between the T and S under ⊒.
Proposition 7.
is not a Boolean lattice with and where and .
Proof.
In the proof of the previous theorem, we previously proved that is a distributive lattice with the given operators. We need to show that the complement operation cannot be introduced on T fulfilling the required axioms. Let , if there is its complement , then both and would be fulfilled. However, then should be to make true; however, would be required to fulfill . This contradiction proves the result. □
Now, we continue with a result on .
Theorem 7.
is a distributive lattice with the greatest lower bound and least upper bound .
Proof.
The proof is similar to the proof of the previous theorem except the completeness by noting that the constructions mentioned there provide periodic neighborhood sequences with period of the least common multiplier of the periods of the given neighborhood sequences. □
In the next part of the paper, we establish connections on the relations studied in this paper. Let us see how the ordering ⊒ and the sets T and can be connected to the B-distances. First, we use the relation ⊒ on specific subsets of T.
Theorem 8.
Let B be any neighborhood sequence in T. The relation ⊒ defines a complete distributive lattice on .
Proof.
The reflexivity, the antisymmetry and the transitivity follows from the the definition of ⊒. Therefore, is a partially ordered set for any .
It is clear that, for every , and exist in T and can be defined as , and .
It can be checked (e.g., by using Lemma 1) that both and are in . Thus, is a lattice.
Let be a subset of with some index set K. Let now, . Clearly, is the least upper bound of the subset X, and thus is a complete lattice.
The statement that this lattice is distributive is trivial. Moreover, , the minimal equivalent neighborhood sequence for B, and
Thus, the proof of the theorem is completed. □
The neighborhood sequence defined by the last formula of the previous proof can be called the maximal equivalent neighborhood sequence of B. Analogously to Lemma 1, it can be shown that it is uniquely defined for every . The case of periodic neighborhood sequences is more interesting due to the fact that there are periodic neighborhood sequences such that their minimal/maximal equivalent neighborhood sequences are not periodic and vice versa.
Example 4.
is periodic. It is the same as its maximal equivalent neighborhood sequence. However, its minimal equivalent neighborhood sequence is not periodic, it is (having only 2’s after the first 3). The next non-periodic neighborhood sequence belongs to the same equivalence class: having 3 at every place i where for some .
Example 5.
Let , and then its minimal equivalent neighborhood sequence is the same; however, its maximal equivalent neighborhood sequence,
, is not periodic (having exactly one value 2).
Therefore, it is interesting to analyze what we can say about subsets of T containing only periodic neighborhood sequences.
Theorem 9.
Let B be any neighborhood sequence in . The relation ⊒ defines a distributive lattice on that may not be complete.
Proof.
Since ⊒ is a partial order on any set (see (the proof of) Theorem 8), it is a partial order on the subset . Now, we show that, for any two representatives and of the class have and elements in . Let and be the periods of and , respectively. For simplicity, let . (The least common multiplier of and suffices.) Then, let us construct with period l: . Similarly, the construction .
Therefore, form a lattice for any . By the constructions above, it is clear that this lattice is distributive.
Now, we show an example for that proves that this lattice is not complete.
Let . Then, contains every neighborhood sequence that have the following properties: , and for every .
Now, a monotonously increasing and a monotonously decreasing sequence in will be shown, such that they have a common “limit sequence” but is not in . In this way, we show that is not complete. For technical purposes, we introduce the following notation. Any periodic neighborhood sequence can also be written in the form having period : , and this form is denoted by .
Now, for any neighborhood sequence that has period l, i.e., , and for any with let defined with the elements for and . In this way, only the i-th (modulo l) element of B is changed from 2 to 3 or vice versa, each other element remains the same.
Further, for any , we say that k is even-square-bounded (ESB) if there is an even such that , else k is odd-square-bounded (OSB). Clearly, the even-square-bounded and the odd-square-bounded numbers form longer and longer intervals in as they are growing. Let , , and now we define the sequences and in as follows. For an ESB , use and , else (in case k is OSB) let and .
In this way, to describe and , we give the long periods of and after and , respectively, such that exactly one of the -th long periods is modified at the -th position; where the modified period depends on the ESBness of k. For the sake of a better view, we show some of the first constructed values of these sequences:
,
,
,
and
,
,
,
,
.
As one may observe, and as can also be seen from the construction, every element of both sequences for is in , i.e., and for all non-negative values of k. It is also clear that and for every non-negative k, moreover, in both sequences, there are strict inequalities infinitely often. However, by comparing the elements of the two sequences with the same index k, from the construction, we have the following. They both have long periods, i.e., and .
Moreover, their elements for every and for every (the mismatch is at the last position of the long period). Then, for each , let us choose a value with and let and, further, . By the previously analyzed property of the sequences and , the sequence is well-defined. It is clear that holds. Now, we prove that is not periodic.
The definitions of and imply that, for each non-negative j with , and , but . However, there is no periodic sequence with this property.
Finally, let . It is clear that . Now, suppose that in for some . However, in this case, in (such as in T) but ; therefore, there is such that . However, this would yield in , if .
However, by , for each , which contradicts in . Thus, there is no least upper bound for X in ; therefore, is not complete. □
Now, we are ready to complement the results of Theorem 7.
Theorem 10.
is not a complete lattice.
Proof.
Observe that, in the previous proof, we demonstrated that is not complete as all the neighborhood sequences constructed were in ; however, as , the mentioned property is also inherited to itself. □
Thus, the sets T and have some similar properties under the partial order ⊒ as S and with the differences mentioned.
We are closing in on results that connect the orderings and ⊒ on the triangular grid. These results, with respect to Propositions 4 and 5, show that these relations give a more complex (theoretical) structure on the triangular grid compared with on the square grid.
Theorem 11.
Let . The following statements hold:
- (a)
- If , then .
- (b)
- Moreover, and both may hold, even if and .
- (c)
- Further, if none of and hold, all the following possibilities may occur:
- both and hold, i.e., and have the same “speed” according to the faster relation;
- exactly one of and holds, i.e., one of them is (really) faster (and not equally fast) compared with the other; or
- none of and hold: and are also incomparable under the faster relation.
Proof.
From Part (a) from , it follows that every -path is also a -path, and thus is immediately proven.
If the class contains more than one element, then one can easily pick two elements from there, e.g., the minimal and the maximal equivalent neighborhood sequences and , respectively. Then, clearly , but . On the other hand, since these neighborhood sequences are equivalent (; they provide the same distance function), both and hold.
Finally, the proof of part (c) is by examples.
Considering and , it is clear that none of and hold; however, they provide the same distance function with their minimal equivalent neighbor sequence with exactly one value of 3 and all other values are 2. Thus, both and hold in this case.
Now, consider and . Clearly, and . On the other hand, the minimal equivalent neighborhood sequence of is contains exactly one value of 1 and exactly one value of 3 and then only 2s. The minimal equivalent neighborhood sequence of is itself. These facts imply that is faster than but not vice versa, i.e., and .
To show the last possibility, let and . One may observe, e.g., on the bottom right of Figure 3 that these two neighborhood sequences are incomparable under the faster relation, i.e., and . □
In the next result, the equivalence relation ∼ is also involved.
Theorem 12.
Let every class be represented by the minimal (maximal) equivalent neighborhood sequence (, respectively) of the class. Then, the relation ⊒ provides a proper refinement of defined on the sets of these classes of T, i.e., for any two neighborhood sequences that are minimal (resp. maximal) equivalent neighborhood sequences of themselves implies that . However, it may occur that holds without .
Proof.
Let and be two neighborhood sequences such that both of them are equivalent to their minimal (maximal, resp.) neighborhood sequences. Assume that holds. Let p and q be any two points of the grid. Then, let be determined by a short/the shortest -path . Observe that, by the definition of , the -path is also a path from p to q, but then clearly holds.
It is also clear from the definitions that and if and only if , and then both and trivially hold.
The refinement is proper, since there are neighborhood sequences and , such that but . Let and . Notice that each of these sequences defines a singleton equivalence class, therefore and , and thus and . □
We need to note that the previous proof works for any representatives of the classes. On the other hand, this last result shows also one of the good applicability features of our result, and this will lead us to the next section.
5. Applications
This paper is of theoretical nature; however, in this section, our aim is to briefly show how our results can be applied.
In [], neighborhood sequences were used in communication networks in various scenarios. The case of periodic neighborhood sequences were studied as special cases, as it is sufficient to attach a period-long part of the neighborhood sequence along the signal. Based on our equivalence relation described in this paper, one may easily find a periodic equivalent neighborhood sequence to the original sequence (if such equivalent exists) even if the original sequence is not a periodic one.
Example 6.
Let be a neighborhood sequence defined by It is easy to see that is not periodic. However, one can see that is equivalent to , and this latter is periodic with period 3, which makes it possible to use the distance function defined by in communication schemes that require periodic neighborhood sequences. The minimal equivalent neighborhood sequence of is not periodic, but is its maximal equivalent neighborhood sequence (which we defined in this paper).
Another possible application can be in the approximation of Euclidean disks on the triangular grid: We recall here the fact that there are digital disks with the same radius that are incomparable under set theoretic inclusion on the triangular grid also yields to advanced types of approximation of the Euclidean disks based on neighborhood sequences that is impossible on the square grid: it uses the intersection of two disks; see, e.g., in [].
To make such approximations allowed and efficient, one requires two such neighborhood sequences, let us say and , that are not in any of the relations that we have studied, i.e., none of the following is true for them: , , , , and . If any of these relations were true, then the intersection of the disks after each step will be the same as one of the disks based on one of the neighborhood sequences, and one will not gain anything by using the other neighborhood sequence.
From an application point of view, it is essential to be able to decide if two given neighborhood sequences are in any of the studied relations. Regarding our equivalence relation studied in Section 4.1, one can use Lemma 1 and the fact that equivalent neighborhood sequences have the same minimal equivalent neighborhood sequence.
For the faster relation, the decision is based on the comparisons of formulae of Lemma 2; finally, it is clear to see which neighborhood sequence componentwise dominates another neighborhood sequence by the definition of the relation.
On the other hand, based on our results, we may also able to decide about the faster relation based on Theorem 12: using an arbitrary representative of an equivalent class, it could happen that does not hold, even if it could hold for some of their other representatives. This causes the possibilities listed in Theorem 11. We highlight again the difference between neighborhood sequences on the square and on the triangular grid with the following example: and . If there are representatives and of these classes for which holds, then it is easy to see that it also holds for their minimal/maximal equivalent neighborhood sequences, and thus can be more easily deducted by using these special representatives.
6. Conclusions
We investigated various relations among the neighborhood sequences on a triangular grid with various properties. There are specific equivalence and partial order relations, and we also proved a distributive lattice structure. More precisely, we characterized and described the equivalent neighborhood sequences that define the same distance function and characterized the partial order relation “faster” on the aforementioned equivalence classes.
Further, among other results, we showed that the relation “componentwise dominate” gives a lattice structure to the sets T and of general and periodic neighborhood sequences. Based on our results, we can say that the structure of the set of neighborhood sequences on the triangular grid is proven to be more interesting than the structure of the set of neighborhood sequences on the square grid. This is based, e.g., on the fact that there are various neighborhood sequences that define the same distance function. Thus, the minimal and the newly investigated maximal equivalent neighborhood sequences play crucial roles not only in the computation of B-distances and in various applications of them but also in the description of various relations among the neighborhood sequences.
Further, by viewing the digital disks (circles) of the same radius, they do not form a well-ordered set on the triangular grid for a fixed radius [,,], and the order that the elements of the neighborhood sequence takes also matters. As we also presented, our results could be applied in communication networks with a honeycomb structure in a similar way as to the examples shown in []. Our theoretical results can help to find appropriate neighborhood sequences with some desired properties and relations.
On the one hand, it is a future task to develop further applications in the field of image processing, computer imaging and/or in networking where the appropriate neighborhood sequences are selected based on the algebraic relations that we investigated. On the other hand, in [], a possible generalization of the faster relation was also defined where some parameters were also added to make theoretical investigations on these relations a possible future work.
Funding
This research was partly funded by the Hungarian National Foundation for Scientific Research: OTKA F043090.
Data Availability Statement
Not applicable.
Acknowledgments
The author is thankful for the discussions on the topic with their OTKA F043090 research mates, A. Fazekas, A. Hajdu and L. Hajdu as well as for their support.
Conflicts of Interest
The author declares no conflict of interest.
References
- Klette, R.; Rosenfeld, A. Digital Geometry-Geometric Methods for Digital Picture Analysis; Morgan Kaufmann, Elsevier Science B.V.: San Franciso, CA, USA, 2004. [Google Scholar]
- Kiselman, C.O. Elements of Digital Geometry, Mathematical Morphology, and Discrete Optimization; Published by World Scientific: Singapore, 2022; 488p. [Google Scholar]
- Rosenfeld, A.; Pfaltz, J.L. Sequential operations in digital picture processing. J. ACM 1966, 13, 471–494. [Google Scholar] [CrossRef]
- Rosenfeld, A.; Pfaltz, J.L. Distance functions on digital pictures. Pattern Recognit. 1968, 1, 33–61. [Google Scholar] [CrossRef]
- Das, P.P.; Chakrabarti, P.P.; Chatterji, B.N. Distance functions in digital geometry. Inf. Sci. 1987, 42, 113–136. [Google Scholar] [CrossRef]
- Das, P.P.; Chatterji, B.N. Octagonal distances for digital pictures. Inf. Sci. 1990, 50, 123–150. [Google Scholar] [CrossRef]
- Das, P.P. Lattice of octagonal distances in digital geometry. Pattern Recognit. Lett. 1990, 11, 663–667. [Google Scholar] [CrossRef]
- Fazekas, A.; Hajdu, A.; Hajdu, L. Lattice of generalized neighbourhood sequences in nD and ∞D. Publ. Math. Debr. 2002, 60, 405–427. [Google Scholar] [CrossRef]
- Nagy, B. Metrics based on neighbourhood sequences in triangular grids. Pure Math. Appl. 2002, 13, 259–274. [Google Scholar]
- Yamashita, M.; Honda, N. Distance functions defined by variable neighborhood sequences. Pattern Recognit. 1984, 17, 509–513. [Google Scholar] [CrossRef]
- Yamashita, M.; Ibaraki, T. Distances defined by neighborhood sequences. Pattern Recognit. 1986, 19, 237–246. [Google Scholar] [CrossRef]
- Nagy, B. Distance functions based on generalized neighbourhood sequences in finite and infinite dimensional space. In Proceedings of the ICAI’01: Fifth International Conference on Applied Informatics, Eger, Hungary, 28 January–3 February 2001; pp. 183–190. [Google Scholar]
- Nagy, B. Distance functions based on neighbourhood sequences. Publ. Math. Debr. 2003, 63, 483–493. [Google Scholar] [CrossRef]
- Nagy, B. Distance with generalized neighbourhood sequences in nD and ∞D. Discret. Appl. Math. 2008, 156, 2344–2351. [Google Scholar] [CrossRef]
- Danielsson, P.E. 3D octagonal metrics. In Proceedings of the Eighth Scandinavian Conference on Image Analysis (SCIA 1993), Tromsø, Norway, 25–28 May 1993; pp. 727–736. [Google Scholar]
- Das, P.P. Best simple octagonal distances in digital geometry. J. Approx. Theory 1992, 68, 155–174. [Google Scholar] [CrossRef][Green Version]
- Mukherjee, J. Error analysis of octagonal distances defined by periodic neighborhood sequences for approximating Euclidean metrics in arbitrary dimension. Pattern Recognit. Lett. 2016, 75, 16–23. [Google Scholar] [CrossRef]
- Mukherjee, J.; Das, P.P.; Kumar, M.A.; Chatterji, B.N. On approximating Euclidean metrics by digital distances in 2D and 3D. Pattern Recognit. Lett. 2000, 21, 573–582. [Google Scholar] [CrossRef]
- Strand, R.; Nagy, B.; Fouard, C.; Borgefors, G. Generating Distance Maps with Neighbourhood Sequences. In Discrete Geometry for Computer Imagery, DGCI 2006, LNCS 4245; Springer: Berlin/Heidelberg, Germany, 2006; pp. 295–307. [Google Scholar]
- Normand, N.; Strand, R.; Évenou, P.; Arlicot, A. Minimal-delay distance transform for neighborhood-sequence distances in 2D and 3D. Comput. Vis. Image Underst. 2013, 117, 409–417. [Google Scholar] [CrossRef]
- Normand, N.; Strand, R.; Évenou, P.; Arlicot, A. A Streaming Distance Transform Algorithm for Neighborhood-Sequence Distances. Image Process. Line 2014, 4, 196–203. [Google Scholar] [CrossRef][Green Version]
- Normand, N.; Strand, R.; Évenou, P. Digital Distances and Integer Sequences. In Discrete Geometry for Computer Imagery. DGCI 2013; Lecture Notes in Computer Science, LNCS 7749; Gonzalez-Diaz, R., Jimenez, M.J., Medrano, B., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; pp. 169–179. [Google Scholar]
- Nagy, B.; Strand, R.; Normand, N. Distance Functions Based on Multiple Types of Weighted Steps Combined with Neighborhood Sequences. J. Math. Imaging Vis. 2018, 60, 1209–1219. [Google Scholar] [CrossRef]
- Nagy, B.; Strand, R.; Normand, N. Distance Transform Based on Weight Sequences. In Discrete Geometry for Computer Imagery-21st IAPR International Conference, DGCI 2019, LNCS 11414; Springer: Cham, Switzerland, 2019; pp. 62–74. [Google Scholar]
- Martin, R.; Nickson, T.; Potapov, I. Geometric computations by broadcasting automata. Nat. Comput. 2012, 11, 623–635. [Google Scholar] [CrossRef]
- Potapov, I. Pattern formations with broadcasting automata model. In Proceedings of the Invited Talk at Eighth Workshop on Non-Classical Models of Automata and Applications, NCMA 2016, Debrecen, Hungary, 29–30 August 2016; books@ocg.at 321. Österreichische Computer Gesellschaft/Austrian Computer Society: Vienna, Austria, 2016; pp. 61–73. [Google Scholar]
- Song, H.; Potapov, I. Polygon Approximations of the Euclidean Circles on the Square Grid by Broadcasting Sequences. In Discrete Geometry for Computer Imagery-21st IAPR International Conference, DGCI 2019, LNCS 11414; Springer: Cham, Switzerland, 2019; pp. 444–456. [Google Scholar]
- Conway, J.H.; Burgiel, H.; Goodman-Strass, C. The Symmetries of Things; AK Peters: Natick, MA, USA, 2008. [Google Scholar]
- Grünbaum, B.; Shephard, G.C. Tilings by regular polygons. Math. Mag. 1977, 50, 227–247. [Google Scholar] [CrossRef]
- Nagy, B. Non-traditional 2D Grids in Combinatorial Imaging–Advances and Challenges. In Keynote Talk at 21st International Workshops on Combinatorial Image Analysis, IWCIA22, to Appear in LNCS 13348; Springer: Cham, Switzerland, 2022. [Google Scholar]
- Deutsch, E.S. Thinning algorithms on rectangular, hexagonal and triangular arrays. Commun. ACM 1972, 15, 827–837. [Google Scholar] [CrossRef]
- Stojmenovic, I. Honeycomb Networks: Topological Properties and Communication Algorithms. IEEE Trans. Parallel Distrib. Syst. 1997, 8, 1036–1042. [Google Scholar] [CrossRef]
- Nagy, B. Finding shortest path with neighborhood sequences in triangular grids. In Proceedings of the ITI-ISPA 2001: Second IEEE R8-EURASIP International Symposium on Image and Signal Processing and Analysis, Pula, Croatia, 19–21 June 2001; pp. 55–60. [Google Scholar]
- Nagy, B. Characterization of digital circles in triangular grid. Pattern Recognit. Lett. 2004, 25, 1231–1242. [Google Scholar] [CrossRef]
- Nagy, B. Application of neighborhood sequences in communication of hexagonal networks. Discret. Appl. Math. 2017, 216, 424–440. [Google Scholar] [CrossRef]
- Nagy, B. Isometric transformations of the dual of the hexagonal lattice. In Proceedings of the sixth IEEE International Symposium on Image and Signal Processing and Analysis, ISPA 2009, Salzburg, Austria, 16–18 September 2009; pp. 432–437. [Google Scholar]
- Nagy, B. Distances with neighbourhood sequences in cubic and triangular grids. Pattern Recognit. Lett. 2007, 28, 99–109. [Google Scholar] [CrossRef]
- Grätzer, G. Lattice Theory: First Concepts and Distributive Lattices; Dover Books on Mathematics; Dover Publications: Dover, UK, 2009. [Google Scholar]
- Grätzer, G. Lattice Theory: Foundation; Birkhäuser: Basel, Switzerland, 2011. [Google Scholar]
- Nagy, B. Number of Words Characterizing Digital Balls on the Triangular Tiling. In Discrete Geometry for Computer Imagery-19th IAPR International Conference, DGCI 2016, LNCS 9647; Springer: Berlin/Heidelberg, Germany, 2016; pp. 31–44. [Google Scholar]
- Nagy, B.; Strand, R. Approximating Euclidean circles by neighbourhood sequences in a hexagonal grid. Theor. Comput. Sci. 2011, 412, 1364–1377. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).