The Shortest Path Problem for the Distant Graph of the Projective Line Over the Ring of Integers
The Shortest Path Problem for the Distant Graph of the Projective Line Over the Ring of Integers
Andrzej Matras´ 0
Artur Siemaszko 0
Mathematics Subject Classification 0
B Artur Siemaszko 0
Communicated by Rosihan M. Ali.
0 Faculty of Mathematics and Computer Science, University of Warmia and Mazury in Olsztyn , Sloneczna 54, 10710 Olsztyn , Poland
The distant graph G = G(P(Z ), ) of the projective line over the ring of integers is considered. The shortest path problem in this graph is solved by use of Klein's geometric interpretation of Euclidean continued fractions. In case the minimal path is nonunique, all the possible splitting are described which allows us to give necessary and sufficient conditions for existence of a unique shortest path. Projective line · Distant graph · Shortest path problem · Continued The projective line P( R) over any ring R with 1 can be defined using admissible pairs [1]. For some rings, for example for commutative ones, it is equivalent to using unimodular pairs. One of the basics concerning the projective line over ring P( R) is the distant relation on the set of points. A pair ( x¯, y¯ ) ∈ P( R)×P( R) is in the distant relation if the matrix
fractions

51C05 · 05C12
1 Introduction
[x , y ] ∈ G L2(R) for any choice of admissible elements x ∈ x¯ and y ∈ y¯. Here, and
in the sequel x¯ := Rx for all admissible x ∈ R2. In that way one defines distant graph
G = G(P(R), ) for any ring P(R) [
4
]. The vertices of the distant graph on P(R) are
the points of P(R), the edges of the graph are the undirected pairs of distant points.
The distance function di st (x¯, y¯) is the minimal number of edges needed to walk from
x¯ to y¯. The diameter of the G is the supremum of all distances between its points.
The notion of the distant relation was introduced in the nineties of the previous
century (see e.g. [
6
]). Blunck and Havlicek explored this notion later in [
2,3
]. They
gave for instance the necessary and sufficient condition for the distant graph to be
connected.
We consider the projective line over Z . In this case, points of P(Z ) are cyclic
modules Z (a, b), where (a, b) ∈ Z × Z is a unimodular pair. From Z being a G E2
ring follows the connectedness of the distant graph [
2
], but nothing can be said about
its diameter. In this paper, we give a simple direct proof that the distant graph of the
projective line over Z has the infinite diameter.
The aim of this paper is to analyse paths in the distant graph G(P(Z ), ) and solve
the shortest path problem for it.
The main tool in our considerations is the transition algorithm introduced in [
8
]
(see also [
9
]) for bases of Z 2 in order to investigate some kind of Markov partitions
of automorphisms of the twodimensional torus. This is in fact the reinterpretation of
Klein’s geometrization of continued fractions (see e.g. [
7
]).
The distant graph of a ring is defined in terms of “homogenous” ring coordinates.
However, our statements follow from affine setup, hence we present in Sect. 2 the
transition algorithm on Z × Z ⊂ R2. This is a repetition of [
8
] but we do it for seek
of completeness.
In the next section, we adopt this algorithm to the language of the projective line.
Then we make use of it to find the shortest paths connecting given two nonadjacent
vertices. It also allows us to provide necessary and sufficient conditions for existence
of exactly one shortest path between them.
For any nonadjacent vertices x¯ , y¯ ∈ G(P(Z ), ) we define so called cone relations
on P(Z )\{x¯ , y¯ } with precisely two equivalence classes. Any path entirely contained in
one of this classes is called a consistent path. We prove that in each of the equivalence
classes of the cone relation there is precisely one shortest path connecting x¯ and y¯
(Theorem 1). All vertices of those two paths together with x¯ and y¯ form the set of
vertices of some subgraph, called by us the Klein graph K (x¯ , y¯ ).
If we abandon the assumption of consistency then the issue becomes more
complicated. It turns out that in general there may be lots of shortest paths between two
nonadjacent vertices. Nevertheless we prove that there is at least one shortest path
which is contained in some induced subgraph of K (x¯ , y¯ ) called by us a corner graph.
This observation allows us to give a recipe to find one of the shortest paths.
Consequently, we obtain the formula for the distance dist(x¯ , y¯ ) between two vertices
(Theorem 2).
Further, the careful insight into the corner graph enables to formulate the necessary
and sufficient conditions for the existence of more than one shortest path (Theorem 3).
In [
2
], Blunck and Havlicek code a path connecting any pair of elements from
connected component of the distant graph of a ring R as a product of elementary matrices.
In our modification, this product is a decomposition of an element of P G L(2, R)
transforming the first pair of elements of the path onto the last one. In the last
section, we get from this factorization the formula for the distance in the distant graph in
algebraic language. We hope that this algebraic approach allows us to generalize the
results to some wider class of rings, for instance to discretely ordered ones.
2 Basic Tools: Klein Sails and Fans of Bases
Formally P(Z ) is a set of cyclic modules Z (a, b) generated by unimodular pairs
(a, b) ∈ Z × Z . To follow all considerations of this paper, it is convenient to lift the
projective line to Z 2 understood as the subset of the plane R2.
Every two elements x¯ , y¯ ∈ P(Z ) determine two lines k, l ⊂ R2, respectively. Both
lines contain the origin and other integer points, hence, are rational. They divide the
plane into four closed quadrants. In each of them consider the boundary of the closed
convex hull of all integer points distinct from the origin. This boundary is a infinite
polyline. It splits into three parts. Two of those parts are contained in lines k and l and
the middle one has precisely one common point with each of those lines (see Fig.1).
This part is called a Klein sail. A similar construction may be carried out for irrational
lines as well. The difference is that one gets a single polyline having no common
points with the lines and asymptotic to them. Klein considered those polylines as
geometrization of continued fraction expansions of irrational numbers.
By construction every integer point lying on any of Klein sails form a unimodular
pair in Z × Z . We will be interested in the set of those points since every shortest
walk between x¯ and y¯ must be contained in the set of Z modules generated by them.
The set of integer points on Klein sails may be found by use of the so called transition
algorithm developed in [
8
] (see also [
9
]) for bases of Z × Z in order to investigate
some kind of Markov partitions of automorphisms of the twodimensional torus. Fix
x ∈ x¯ and y ∈ y¯ and consider k and l as horizontal and vertical axes positively directed
by x and y. This gives us the enumeration of four quadrants determined by k and l. To
start the transition algorithm first find, using the Extended Euclidean Algorithm, the
bisequence (cn)n∈Z of all vectors with det[x, cn] = 1 enumerated in such a way that
cn+1 = cn − x. If y ∈ {cn} then stop the algorithm. Otherwise there is precisely one
n0 ∈ Z such that cn0 is in the first quadrant and cn0+1 is in the second one. Denote
e1 := cn0 and f1 := cn0+1. Obviously β1 = (e1, f1) forms a basis in Z × Z (see the
remark after Lemma 1). Assume the βk = (e, f ) is a basis in Z × Z with e in the first
quadrant and f in the second one. If y = e + f then the algorithm stops. Otherwise put
βk+1 = (e + f , f ) if e + f lies in the first quadrant and βk+1 = (e, e + f ) lies in the
second one.
If the set of bases {βk } were infinite then norms of their vectors would tend to infinity
while the areas of parallelograms spanned by them would stay equal to 1, hence the
angles would tend to 0 or π . In our construction, they converge to 0 since the angles
are decreased step by step. It follows that y lies in the interior of the parallelogram
spanned be vectors of βk for large enough k, which is a contradiction (see the remark
after Lemma 1). Therefore, the algorithm eventually stops necessarily on y.
In order to translate the above algorithm in terms of the projective line we note that
it can be rewritten in the following way. First we may assume that e1 + f1 is in the first
quadrant. The other case is completely symmetric. If e1 + f1 = y then the algorithm
stops. Otherwise we add f1 to e1 so many times until the resulting vector stays in the
first quadrant. We get the finite sequence of vectors (eA0 := e1, e2, . . . , ea1+1 =: eA1 ).
By construction f2 := eA1 + f1 lies in the second quadrant. Then we keep adding eA1
to f1 so many times until the resulting vector stays in the second quadrant. We get
the finite sequence of vectors (fB0 := f1, f2, . . . , fb1+1 =: fB1 ). Then we repeat the
construction until the summation of vectors is equal to y.
We have constructed two sequences of vectors
(e1, e2, . . . , eA1 , eA1+1, . . . , eA2 , eA2+1, . . . , eAr−1 , eAr−1+1, . . . , eAr )
and
(f1, f2, . . . , fB1 , fB1+1, . . . , fB2 , fB2+1, . . . , fBl−1 , fBl−1+1, . . . , fBl ),
where Ak = kn=0 an, k = 0, . . . , r + 1, and Bk = kn=0 bn, k = 0, . . . , l + 1. Here
a0 = ar+1 = b0 = bl+1 = 1. Those two sets together with x and y we will project to
the projective line and the resulting set of vertices with appropriate edges we will call
a Klein graph which is the main tool of this paper. The notion of a Klein graph does
not depend on choice of representative elements of x¯ and y¯ since opposite Klein sails
are symmetric with respect to the origin.
3 Basic Tools in Terms of the Projective Line
This section is devoted to presenting the material of the previous one in terms of the
projective line. This allows us to conduct all considerations independently on choice
of representative elements of vertices in the projective line.
Having two distinct elements x¯ , y¯ ∈ P(Z ) we define an equivalence relation on
P(Z )\{x¯ , y¯ }:
u¯ ∼{x¯,y¯} v¯ if αux αuy αvx αvy > 0,
u = αux x + αuy y, v = αvx x + αvy y.
for any choice x ∈ x¯ , y ∈ y¯ , u ∈ u¯ , v ∈ v¯ , where αux, αuy, αvx, αvy ∈ R such that
Since each of vectors in the inequality appears twice, the relation is well defined. Each
such relation is called a cone relation.
For two vectors x, y ∈ Z 2 denote positive and negative cones in R2 by
C ±(x, y) = {αx + βy : ±αβ > 0}.
Every cone relation has two equivalence classes being images of
C +(x, y) ∩ Z 2 and C −(x, y) ∩ Z 2
by the canonical projection from Z 2\{(0, 0)} onto the projective line.
The basic property of those relations is the following lemma proved in [
8
]:
Lemma 1 (Lemma 2.1, [
8
]) If x¯ , y¯ , x¯ , y¯ ∈ P(Z ) satisfy x¯ y¯ and x¯ y¯ then
either {x¯ , y¯ } = {x¯ , y¯ } or precisely one equivalence class of each cone relations ∼{x¯,y¯}
and ∼{x¯ ,y¯ } is contained in the equivalence class of another cone relation.
The above lemma may be expressed in various ways. It is, for example, equivalent to
the fact that the interior of the parallelogram spanned by members e, f of any basis
in Z 2 contains no vectors from Z 2. In other words the only vectors in the closed
parallelogram spanned by e and f are its vertices. By Pick’s formula this is equivalent
for this parallelogram to have area equal to one. This is in turn equivalent to the
equality
where [e, f ] stands for the matrix with columns equal to e and f respectively.
We will need also the following obvious observation.
Lemma 2 If x¯ , y¯ , u¯ and v¯ are pairwise distinct elements of P(Z ) then
det [e, f ] = ±1,
u¯ ∼{x¯,y¯} v¯ ⇔ x¯ ∼{u¯ ,v¯} y¯ .
In graph theory, a set of vertices is called a clique if its elements are pairwise adjacent.
From Lemma 1, one can easily deduce the following corollary.
Corollary 1 1. Any maximal clique in P(Z ) has exactly three elements.
2. Every pair of adjacent vertices belongs to precisely two maximal cliques.
3. If {x¯ , y¯ , u¯ } and {x¯ , y¯ , v¯ } are two maximal cliques then
u
¯
{x¯,y¯} v¯ .
It is not difficult to find maximal cliques for every pair x¯
y¯ . Indeed
{x¯ , y¯ , x + y} and {x¯ , y¯ , x − y}
are the only maximal cliques containing x¯ and y¯ .
Now we will express the transition algorithm described in the previous section in
terms of the projective line. We do this to demonstrate that the notion of Klein graph is
really a projective notion as well as to establish some notation used later in the paper.
The concept of the Klein graph is a main tool of the next two sections used to find
shortest paths connecting an arbitrary pair of vertices of the distant graph.
Transition Algorithm
Given two elements x¯ , y¯ ∈ P(Z ) fix one of them, say x¯ .
Using the Extended Euclidean Algorithm find a sequence (c¯n)n∈Z of all vertices of
the distant graph adjacent to x¯ . The sequence (c¯n )n∈Z may be ordered in such a way
that {c¯n, c¯n+1, x¯ } is a clique for every n ∈ Z . If y¯ ∈ (c¯n ) then stop.
If not, there is precisely one n0 ∈ Z such that c¯n0 {x¯,y¯} c¯n0+1. Denote c¯n0 and
c¯n0+1 by e¯1 and f¯1 arbitrarily.
By 1. and 2. of Corollary 1 there is precisely one g¯2 = x¯ such that {e¯1, f¯1, g¯2} is a
clique. Either
(TR) g¯2 ∼{x¯,y¯} e¯1
or
(TL) g¯2 ∼{x¯,y¯} f¯1.
In the sequel of this paper we assume the case (TR). The other case is completely
symmetric. It means that considering (TL) instead of (TR) we have to mutually
exchange all notations. For instance we exchange symbols e¯ j and f¯j . Later on we
introduce some numbers r , a j , A j associated to vertices e¯ j and l, b j , B j associated to
vertices f¯j . We also must exchange them considering the case (TL) instead of (TR).
Denote e¯2 := g¯2. Among all vertices, excluding e¯1, adjacent to f¯1 there are precisely
two adjacent to each other that are not in the relation ∼{e¯1,y¯}. Moreover in the sequence
of vertices adjacent to f¯1 there are finitely many in the relation ∼{e¯1,y¯} with e¯2. We
may naturally enumerate them: (e¯2, . . . , e¯a1+1) in such a way that e¯k e¯k+1. If the
next vertex in this sequence and not in the relation ∼{e¯1,y¯} with e¯a1+1 is equal to y¯ then
stop.
If not, denote the above vertex by f¯2 and repeat the same construction with e¯a1+1
and f¯2 playing the role of f¯1 and e¯2, respectively. We get the sequence (f¯2, . . . , f¯b1+1).
Note that f¯k f¯k+1, k = 2, . . . , b1, and f¯j ∼{f¯1,y¯} f¯2, j = 2, . . . , b1 + 1.
Then repeat the above construction with e¯a1+1 and f¯b1+1 playing the role of e¯1
and f¯1, respectively. The transition algorithm is depicted in Fig. 1 for x = [
2, 3
] and
y = [−3, 2].
Since all lines in R2 determined by members of P(Z ) are rational our algorithm
eventually stops after reaching y¯ as we have shown in the previous section. We have
constructed two sequences of vertices:
(e¯1, e¯2, . . . , e¯ A1 , e¯ A1+1, . . . , e¯ A2 , e¯ A2+1, . . . , e¯ Ar−1 , e¯ Ar−1+1, . . . , e¯ Ar )
and
(f¯1, f¯2, . . . , f¯B1 , f¯B1+1, . . . , f¯B2 , f¯B2+1, . . . , f¯Bl−1 , f¯Bl−1+1, . . . , f¯Bl ),
where Ak = kn=0 an, k = 0, . . . , r + 1, and Bk = kn=0 bn, k = 0, . . . , l + 1. Here
a0 = ar+1 = b0 = bl+1 = 1. This is caused by the fact that e¯ Ar and f¯Bl are both
adjacent to y¯ so we also have e¯ Ar+1 = f¯Bl+1 = y¯ .
By construction both sequences are contained in different equivalence classes of
∼{x¯,y¯} and two consecutive vertices in each of them are adjacent. Vertices e¯ Ak and f¯Bk ,
excluded y¯ , will be called corner vertices. Note that by construction r − l ∈ {0, 1}.
Two sequences constructed in the above algorithm may be organized as a sequence
of adjacent pairs of vertices.
f¯Bm
e¯ Am+1
e¯k , k = Am , . . . , Am+1, m = 0, 1, . . . , r − 1;
f¯k , k = Bm , . . . , Bm+1, m = 0, 1, . . . , l − 1.
(1)
To the set of vertices defined above add x¯ and y¯ . The resulting set with appropriate
edges is an induced subgraph of the distant graph and will be called a Klein graph
associated to x¯ and y¯ . Denote it by K (x¯ , y¯ ). If we consider only corner vertices in this
graph we get an induced subgraph which we will call a corner graph and denote by
K (x¯ , y¯ ).
The Klein graph is depicted in Fig. 2. All vertices of the corner graph are marked in
black. The bolded edges are edges of the standard path to be defined in the beginning
of Sect. 5.
4 Consistent Paths
Definition 1 A path connecting x¯ and y¯ in the distant graph is called consistent if all
its elements but x¯ and y¯ are contained in the same equivalence class of ∼{x¯,y¯}.
The length of the shortest consistent path between x¯ and y¯ is denoted by dc(x¯ , y¯ ).
Theorem 1 Let x¯ , y¯ ∈ P(Z ).
1. The union of each equivalence classes of ∼{x¯,y¯} and {x¯ , y¯ } contains a unique
consistent path connecting x¯ and y¯ . The lengths of those two paths are equal to
da (x¯ , y¯ ) = 1 + Ar and db(x¯ , y¯ ) = 1 + Bl ,
where the numbers Ar and Bl are taken from the transition algorithm.
In particular the distant graph of P(Z ) is connected.
Proof Take x¯ , y¯ ∈ P(Z ). Consider the path
p = p(x¯ , y¯ ) = {x¯ = e¯0, e¯1, . . . , e¯ Ar , y¯ },
where vertices e¯1, . . . , e¯ Ar are taken from the transition algorithm described in the
previous section. It is by construction consistent. Take another consistent path
p˜ = p˜(x¯ , y¯ ) = {x¯ = z¯0, z¯1 . . . , y¯ }
contained in the same equivalence class C of ∼{x¯,y¯} as p. We will show that p ⊂ p.
˜
The set C \{e¯1, . . . , e¯ Ar } is a disjoint union of equivalence classes Ck of cone relations
∼{e¯k ,e¯k+1}, k = 0, . . . , Ar (here e¯0 = x¯ ). If e¯1 = z¯1 ∈ p˜ we are done. Otherwise
z¯1 ∈ C0. It follows from the fact that e¯1 is the last vertex in the sequence of adjacent to
x¯ vertices contained in C and moreover by Lemma 1, all other vertices in this sequence
contained in C belong to C0. We have either z¯2 = e¯1 or, again by Lemma 1, z¯2 ∈ C0.
Eventually we get e¯1 = z¯k ∈ p˜ ∩ p because we have to go out of C0 in order to get y¯ .
Assuming z¯k = e¯l we are able to show, by the same arguments as above, that e¯l+1 ∈ p˜
which shows that p ⊂ p˜. Therefore p is a unique shortest consistent path between x¯
and y¯ contained in C . When computing the length of p we have to count steps between
e¯1 and e¯ Ar whose number is Ar − 1 and add one step between x¯ and e¯1 and another
one between e¯ Ar and y¯ . We have finished the proof of 1.
Now 2. and 3. immediately follows from 1.
Example 1 Let x¯ = [
1, 0
] and y¯ = [37, 158]. Then
e¯1 = [
1, 1
], e¯2 = [
1, 2
], e¯3 = [
1, 3
], e¯4 = [
1, 4
], e¯5 = [
4, 17
], e¯6 = [15, 64],
f¯1 = [
0, 1
], f¯2 = [
1, 5
], f¯3 = [
2, 9
], f¯4 = [
3, 13
], f¯5 = [
7, 30
], f¯6 = [11, 47].
Therefore da (x¯ , y¯ ) = 8 and db(x¯ , y¯ ) = dc(x¯ , y¯ ) = 7. We see that
p(x¯ , y¯ ) = x¯ , f¯1, . . . , f¯6, y¯
is the unique shortest consistent path between x¯ and y¯ . Notice also that e¯1, e¯4, e¯5, e¯7;
f¯1, f¯4, f¯6 are all corner vertices.
Example 2 Let x¯ = [
1, 0
] and y¯ = [26, 111]. Then
e¯1 = [
1, 1
], e¯2 = [
1, 2
], e¯3 = [
1, 3
], e¯4 = [
1, 4
], e¯5 = [
4, 17
], e¯6 = [15, 64];
f¯1 = [
0, 1
], f¯2 = [
1, 5
], f¯3 = [
2, 9
], f¯4 = [
3, 13
], f¯5 = [
7, 30
], f¯6 = [11, 47].
Therefore da (x¯ , y¯ ) = db(x¯ , y¯ ) = dc(x¯ , y¯ ) = 7. We see that
x¯ , e¯1, . . . , e¯6, y¯ }
and
{x¯ , f¯1, . . . , f¯6, y¯
are the only two shortest consistent paths between x¯ and y¯ .
Definition 2 A Hamiltonian cycle p(x¯ ) containing x¯ ∈ P(Z ) is called consistent if
there is y¯ ∈ P(Z ) such that p(x¯ ) is a union of two consistent paths connecting x¯ and
y.
¯
Formally to run the transition algorithm we have to fix both vertices x¯ and y¯ . But
actually we may fix only x¯ and arbitrary finite sequences of positive integers (an) and
(bm ) whose lengths differ by one. Then we may run the transition algorithm starting
from the longer sequence. After using all numbers an and bm we get two last corner
vertices e¯ Ar and f¯Bl . Then let y¯ be such that it forms a clique with these corner vertices
and e¯ Ar {x¯,y¯} f¯Bl . The above consideration gives the following.
Corollary 2 For every x¯ ∈ P(Z ) and every positive integers d > 2, da and db with
d = da + db there exists a Hamiltonian consistent cycle containing x¯ whose length is
equal to d. Moreover there is y¯ ∈ P(Z ) such that
da = da (x¯ , y¯ )
and
db = db(x¯ , y¯ ).
Note that one can eliminate y¯ from the cycle and get again a Hamiltonian one. In this
way one is able to construct decreasing sequence of Hamiltonian cycles containing x¯
that lengths decrease by one. Of course the shortest such cycle has length 3 and forms
a clique. In the forthcoming paper it will be shown how to construct all such sequences
of Hamiltonian cycles.
5 Nonconsistent Paths
While, as has been shown in the previous section, there are at most two shortest
consistent paths between two vertices in the distant graph of the projective line over
Z , it turns out that in general you can find many shortest paths if we abandon the
assumption of consistency.
In order to compute the length of a shortest path between two vertices x¯ , y¯ ∈ P(Z )
first run the transition algorithm described in Sect. 3 assuming the case (TR). Then it
is convenient to consider the following path which exhaust all vertices of the corner
graph:
(x¯ , f¯1, e¯ A1 , f¯B1 , . . . , f¯Br−2 , e¯ Ar−1 , f¯Br−1 , e¯ Ar , y¯ )
or
(x¯ , f¯1, e¯ A1 , f¯B1 , . . . , f¯Br−2 , e¯ Ar−1 , f¯Br−1 , y¯ ),
depending on whether r = l or r = l + 1. Denote this path by ps (x¯ , y¯ ) and call it a
standard path between x¯ and y¯ (see Fig. 2). Let us agree that the vertices e¯ Ak lie on
the right side of the corner graph and the vertices of f¯Bk lie on its left side. The direct
insight into the graph K (x¯ , y¯ ) gives the following result.
Lemma 3 The length of the standard path between nonadjacent x¯ and y¯ is equal to
r + l + 1 provided l > 0. If l = 0, then it is equal to 2.
The key observation of this section is the fact that if want to make a shortest walk
from x¯ to y¯ then we have to use only vertices of K (x¯ , y¯ ) but we may also use only
vertices of K (x¯ , y¯ ).
Lemma 4 Every shortest path between x¯ and y¯ is a subgraph of K (x¯ , y¯ ). Moreover
among all the shortest paths at least one is a subgraph of K (x¯ , y¯ ).
Proof We intend to show that having a path p˜ from x¯ to y¯ one can find a path from x¯
to y¯ contained in K (x¯ , y¯ ) which is not longer than p˜.
Let then z¯ ∈ p˜\K (x¯ , y¯ ). We have either z¯ ∼{x¯,y¯} e¯1 or z¯ ∼{x¯,y¯} f¯1. Assuming the
former case we can find precisely one k with z¯ ∈ Ck , where Ck are taken from the
proof of Theorem 1. By Lemma 1 all vertices adjacent to z¯ belong to Ck ∪ {e¯k , e¯k+1}.
Therefore the predecessor as well as the successor of z¯ in p˜ are contained in the same
set, hence {e¯k , e¯k+1} ⊂ p˜. Since e¯k e¯k+1, we may shorten p˜ rejecting all vertices
from p˜ ∩ Ck . We argue analogically in the latter case.
Assume now that p˜ is one of the shortest paths between x¯ and y¯ . We already know
that p˜ ⊂ K (x¯ , y¯ ). Let 1 ≤ m ≤ r and Am < k < Am+1 be such that e¯k ∈ p˜. In
general we have always e¯ Am+1 ∈ p˜ since we can not omit e¯ Am+1 ∈ p˜ walking from
e¯k to y¯ . Walking from x¯ to e¯k we must go through f¯Bm or e¯ Am so f¯Bm ∈ p˜ or e¯ Am ∈ p˜.
Since f¯Bm e¯ Am+1 and p˜ is one of the shortest paths, f¯Bm ∈/ p˜ and e¯ Am+1 ∈ p˜. We
know that e¯ Am f¯Bm e¯ Am+1 is a path in K (x¯ , y¯ ) of the length 2, hence there are no
other vertices between e¯ Am and e¯ Am+1 but e¯k . We may replace e¯ Am e¯k e¯ Am+1 by
e¯ Am
f¯Bm e¯ Am+1 ⊂ K (x¯ , y¯ ).
We analogically consider f¯k ∈ p˜ instead of e¯k which ends the proof.
Now let us ponder the question when the standard path is one of the shortest between
x¯ and y¯ . Let
(a1, b1, . . .) = (c1, c2, . . . , cr+l ).
The first obvious case is c2 = 0. Indeed, if c2 = b1 = 0 then l = 0 and x¯ f¯1 y¯
is the standard path of the length 2. If additionally c1 = a1 = 0 then r = 0 and
x¯ e¯1 y¯ is the other shortest path. If c2 = 0 and c1 = 0 then r = 1 and the
standard path is the only shortest one.
The other case is if all numbers ck , k = 1, . . . , r + l, are distinct from 0 (which
is equivalent to c2 = 0) and all but c1 or cr+l are greater than 1. In such a situation
no pairs (e¯ Ak , e¯ Ak+1 ), k = 1, . . . , l − 1, (f¯Bk , f¯Bk+1 ), k = 0, . . . , r − 2, are adjacent.
It means that the shortest walk from e¯ Ak to e¯ Ak+1 is e¯ Ak f¯Bk e¯ Ak+1 . Similarly
the shortest walk between f¯Bk and f¯Bk+1 is f¯Bk e¯ Ak+1 f¯Bk+1 . We have shown the
following.
Proposition 1 The standard path is one of the shortest ones iff
– c2 = 0 or
– c2 > 0 and ck > 1 for all k ∈ {2, . . . , r + l − 1}.
Note that even c1 = 1 or cr+l = 1 the standard path remains one of the shortest ones.
Indeed, if c1 = a1 = 1 then e¯1 e¯2, hence there are two shortest paths from x¯ to
e¯2, namely x¯ f¯1 e¯2 and x¯ e¯1 e¯2. Similarly if cr+l−2 = bl−1 = 1 then
y¯ and f¯Bl−1 e¯ Ar y¯ are two shortest walks from f¯Bl−1 to y¯ and if
e¯ Ar y¯ and e¯ Ar−1 f¯Bl y¯ are two shortest walks
f¯Bl−1 f¯Bl
cr+l−2 = ar−1 = 1 then e¯ Ar−1
from e¯ Ar−1 to y¯ .
One can ask what is a necessary and sufficient condition for the Klein graph K (x¯ , y¯ )
so that the standard path is the only shortest one. The above considerations immediately
convince us that first of all we must have c1 > 1 and cr+l > 1. We must also have
ck > 1 for k = 2, . . . , r + l − 1 to assure that the standard path is one of the shortest
ones. Assume now that ck = 2 for some k ∈ {2, . . . , r + l − 1}. If ck = a j then
e¯ A j (the standard one) and e¯ A j−1 e¯ A j are two shortest
f¯B j (the standard
e¯ A j−1 f¯B j−1 e¯ A j−1+1
path between e¯ A j−1 and e¯ A j . Similarly if ck = b j then f¯B j−1 e¯ A j
one) and f¯B j−1 f¯B j−1+1 f¯B j are two shortest path between f¯B j−1 and f¯B j . We have
just shown that the necessary and sufficient condition is the following.
Proposition 2 The standard path is the only shortest one iff
– c1 > 0, c2 = 0 or
– c1 > 1, cr+l > 1 and ck > 2 for all k ∈ {2, . . . , r + l − 1}.
Let us now consider a case when the standard path is not the shortest one. We
already know that this is equivalent to
and
ck = 1 for some k ∈ {2, . . . , r + l − 1}.
On the other hand, by Lemma 4, to compute the length of the shortest path between
x¯ and y¯ it is enough to find the shortest one contained in the corner graph associated
with those two vertices.
The considerations similar to those above allow us to give a recipe for finding one
of the shortest paths in K (x¯ , y¯ ). First assume the following convention: walking along
the standard path we say that we meet the number ak+1 or bk+1 if we are in the vertex
e¯ Ak or f¯Bk , respectively. Then the recipe is the following: start from x¯ and walk along
the standard path until you meet the number one. Then walk along the consecutive
vertices on the same side of the corner graph. Once you meet the number different
from one you come back to the standard path. Perform this procedure till you reach
e¯ Ar or f¯Bl . Then make one step more to end at y¯ . In the sequel the path we have just
described is called a standard shortest path.
To compute the distance between x¯ and y¯ it is left to determine by how many steps
we shortened the standard path. For the first observe that if r = l then we never meet
a1 nor bl and if r = l + 1 then we never meet a1 nor ar . Every other appearance
of the number one in the “proper” place results in shortening of the standard path by
precisely one step. It is possible to shorten the standard path by one step in precisely
two cases:
and
The first case always works. To decide whether 2. works or not we must check if it
satisfies some additional condition. Put
and
Then 2. results in shortening iff sk ≤ tk .
sk =
tk =
max{ j : bk−1 = . . . = bk− j = 1} : bk−1 = 1,
0 : bk−1 > 1;
max{ j : ak−1 = . . . = ak− j = 1} : ak−1 = 1,
0 : ak−1 > 1.
(2)
(3)
(4)
(5)
a˜k =
ak : k = 2, . . . , l;
max(ak , 2) : k = 1
b˜k =
bk : k = 1, . . . , l − 1;
max(bk , 2) : k = l,
b˜k = bk
for k = 1, . . . , l.
and
if r = l. If r = l + 1 the former condition remains unchanged and the latter one
becomes
Now we are in position to determine by how many steps we shorten the standard
path. To end this define
Now remove from {1, . . . , l} those k’s that satisfy 2. with sk > tk and denote the
received set by D = Dx¯,y¯ . By the above consideration we see that we shorten the
standard path by
k∈D
steps. The symbol · stands for the floor function.
Theorem 2 Assume that x¯ , y¯ ∈ P(Z ) are not adjacent. Then the length of the shortest
path connecting x¯ and y¯ is equal to
dist(x¯ , y¯ ) =
r + l + 1 −
In particular, G(P(Z ), ) is of infinite diameter.
6 Uniqueness of the Shortest Paths
In this section we formulate necessary and sufficient conditions for the existence of
more than one shortest path between two vertices. In the previous section we described
the construction of one of the shortest paths between two nonadjacent vertices. This
path may split, but need not to, into more shortest paths because of appearance of 1
or 2 in the sequence (c1, . . . , cr+l ). Two next lemmas explain the situation.
First we deal with ones. We say the two blocks of 1’s overlap if there are natural
numbers 0 ≤ l1 ≤ l2 ≤ l + 1 and 0 ≤ r1 ≤ r2 ≤ r + 1 satisfying
(o1) l1 < r1 ≤ l2 + 1 ≤ r2 with l2 < l + 1 iff r = l + 1
or
(o2) l1 < r1 ≤ l2 = r2 = r + 1 = l + 1
or
Lemma 5 Appearance of 1 in the sequence (c1, . . . , cr+l ) results in splitting the
shortest path iff two blocks of 1’s overlap or r = l and ci = 1 for all i ’s.
Proof First note that 1 in (c1, . . . , cr+l ) causes splitting of any path p contained in
the Klein graph iff it appears in one of the following configurations depicted in Fig. 3:
(s1) bk = ak = 1, 1 ≤ k ≤ l;
(s2) bk = 1, ak+1 = 1, f¯k ∈ p.
In particular to split the shortest path 1 has to appear in both sides of the Klein graph.
Then fix some block B of 1’s in the left side of the Klein graph: bl1 = · · · = bl2 = 1,
where 0 < l1 ≤ l2 < l. Then imagine that we “shift” some block A of 1’s in the right
side: ar1 = . . . = ar2 = 1, where 0 < r1 ≤ r2 < r . We want to assure that meeting of
those two blocs results in splitting the shortest path.
Assume that  A = r2 − r1 + 1 ≤ B = l1 − l2 + 1. Then in order to gain the
configuration (s1) or (s2) that causes splitting we must have
r1 ≤ l2 + 1 ≤ r2
or r1 ≤ l1 ≤ r2.
Indeed, if neither of the above conditions holds then there are three possibilities. Two
of them are l2 + 1 < r1 or l1 > r2. In this cases neither (s1) nor (s2) holds. The last
case is r1 > l1 and l2 ≥ r2. This forces  A < B and appearance of (s1) and (s2).
Nevertheless this does not cause splitting because the standard shortest path has as a
part the path f¯Bl1−1 f¯Bl1 · · · f¯Bl2 . Walking along this part we do not “jump”
onto the right side of the Klein graph although we meet 1’s in configuration (s1) and
(s2). Therefore we are not able to gain splitting. Together with  A ≤ B the former
condition gives (o1) and the latter one gives (o4).
Similarly, if  A ≥ B then we must have
Together with  A ≥ B the former condition gives (o1) and the latter one gives (o4).
Until now we have assumed that our blocks neither start nor end at x¯ and y¯ . Now
we assume opposite.
Assume first r1 = l1 = 0. Then in order to have splitting we must have r2 > l2
which gives (o3). If l1 = 0 = r1 then l1 < r1 and necessarily r1 ≤ l2 + 1 ≤ r2. This
gives (o1). If r1 = 0 = l1 then l1 > r1 and necessarily l1 ≤ r2 ≤ l2 which is (o4).
Next let r = l and r2 = l2 = r . Then in order to have splitting we must have l1 < r1
which is (o2). If l2 = l = r = r2 then r2 < r which is equivalent to r2 < r + 1.
Moreover we must have r1 ≤ l1 ≤ r2. This gives the additional condition in (o4). If
l2 = l = r = r2 then l2 + 1 ≤ r2 and we must have l1 < r1 ≤ l2 + 1 which is (o1).
Now assume that r = l + 1. First consider r2 < r . Then r2 < r = l + 1 = l2 and in
order to guarantee splitting we must have r1 ≤ l1 ≤ r2. This gives (o4). If r2 = r + 1
then to obtain splitting the standard shortest path has to end in the right side of the
Klein graph. Therefore if r1 ≤ l1 then l2 ≤ l + 1 < r2 = l + 2 and we get (o5). On the
other hand if r1 > l1 then we must have r1 ≤ l2 + 1 and we have to “jump” into the
right side of the Klein graph which forces l2 < l + 1. This is the additional condition
in (o1).
There is left one case. Namely, c1 = · · · = cr+l = 1. In this case it obvious that
one has splitting iff r = l.
We have considered all possible configurations of two blocks of 1’s that result in
splitting. Since we get all conditions (o1)–(o5) and each of them obviously forces
splitting, we have finished the proof.
Another reason of splitting is appearance of 2 in this sequence. By direct insight
into the graph K (x¯ , y¯ ) we get the following result.
Lemma 6 Appearance of 2 in the sequence (c1, . . . , cr+l ) results in splitting the
standard shortest path iff one of the following conditions hold
(st1) there exists k ∈ {2, . . . , l} such that bk = 2, ak > 1, ak+1 > 1 or b1 = 2 and
a2 > 1.
(st2) there exists k ∈ {2, . . . , l} such that ak = 2, bk > 1 and sk ≤ tk ,
where the numbers sk and tk in the above are defined in (2) and (3).
Proof Note that if bk = 2 then necessary and sufficient condition to split the standard
shortest path is that it contains vertices f¯Bk−1 , f¯Bk and e¯ Ak (see the left side of Fig. 4).
The standard shortest path contains f¯Bk−1 iff k > 1 and ak > 1 or k = 1 even if a1 = 1.
It necessarily contains e¯ Ak since bk = 2 > 1. The standard shortest path contains f¯Bk
iff ak+1 > 1.
Now assume that ak = 2. Then necessary and sufficient condition to split the
standard shortest path is appearance of vertices e¯ Ak−1 , f¯Bk−1 and e¯ Ak (see the right side
of Fig. 4). The vertex e¯ A0 = e¯1 is never contained in the standard shortest path so k
must be greater than 1. The vertex e¯ Ak−1 appears in it iff sk ≤ tk . This path necessarily
contains f¯Bk−1 since ak = 2 > 1. Then we see that e¯ Ak appears in the standard shortest
path iff bk > 1.
Observe that in the both cases k must be less then r + 1. This gives range of k in
the thesis of the lemma.
All discussion of this section and direct insight into the Klein graph convince us
that the following statement is true.
Theorem 3 Assume that x¯ , y¯ ∈ P(Z ) are not adjacent. There is more than one shortest
path between x¯ and y¯ if and only if
– two blocks of 1’s overlap or
– r = l and all numbers ak and bk are equal to one or
– one of the conditions of Lemma 6 holds.
7 Algebraic Representation of Paths in the Klein Graph
In [
2
] there is described a onetoone correspondence between products of matrices
of the form
E (a) =
and paths in G = G(P(Z ), ). The length of a path is equal to the number of matrices
in an associated product. This together with some relations in G E2(Z ) noted in [
5
]
gives the algebraic method to find the shortest walks between arbitrary vertices of the
distant graph.
For any two non distant vertices x¯ and y¯ of the distant graph we express the method
of finding the shortest path developed in Sect. 5 in terms of matrices form G E2(Z ).
Fix two representative elements x ∈ x¯ and y ∈ y¯ . In order to use the Blunck–Havlicek
algorithm we establish as a standard basis in Z 2 the basis (x, f1), where f1 is defined in
Sect. 2 for x and y. Let y represents as [ p, q] in the above basis. Then by construction
q/ p ≥ 1. The (TR) case of Sect. 3 requires y to have the slope not less then 2. If
1 ≤ q/ p < 2 then we change the basis to (−x, e1). In this basis y represents as
[q − p, q], hence it has the slope not less than 2.
The standard path from x¯ to y¯ is associated by the Blunck–Havlicek algorithm with
the matrix
E (−1)n+1(dn) · . . . · E (d1) · E (−d0) · E (0),
where q/ p = [d0; d1, . . . , dn ] is a continued fraction expansion with dn > 1.
The number of matrices in the product in (7) may be reduced using the following
two formulas
E (a)E (±1)E (b) = ±E (a ∓ 1)(b ∓ 1).
There are two more formulas reducing a number of matrices in any product of matrices
of the form (6), namely
E (a)E (±2)2 E (b) = ∓E (a ∓ 1)E (∓3)E (∓1).
(7)
(8)
(9)
Nevertheless, it is not difficult to see that after all possible reductions of (7) using (8)
the expression from the left hand side of (9) does not appear in the resulting product.
Any change of order of reductions may effect the resulting representation of A as
a product of matrices of the form (6). In spite of this all representations that cannot
be reduced any more have the same number of matrices since they all represent the
shortest paths from x¯ to y¯ .
We say that a matrix A represents a path from x¯ to y¯ if in the basis described above
for any choice x ∈ x¯ to y ∈ y¯ the product given by the Blunck–Havlicek algorithm is
equal to A.
By results of Sect. 5 the matrix given by (7) represents at least one shortest path
from x¯ to y¯ . There may be other matrices representing such a path. The situations is
described in the below proposition whose thesis directly follow from analysis of the
Klein graph.
Proposition 3 There are at most two matrices representing the shortest paths from x¯
to y¯ , among them there is always a matrix A given by (7).
All the shortest paths from x¯ to y¯ are represented by precisely one matrix iff
1. either dn > 2 or
2. dn − 1 = dn−1 = . . . = dn−k = 1 and dn−k−1 > 1 for some odd k ≥ 1.
If there are two matrices representing the shortest paths from x¯ to y¯ then the other one
is equal to
−
Acknowledgments We would like to express our gratitude to professor Hans Havlicek for attracting our
attention to the problem and fruitful discussion on the subject. We also thank to Mariusz Bodzioch, a Ph.D.
student of our faculty, for help in preparing the figures. The second named author was partially supported
by the NCN (National Science Centre, Poland) Grant 2011/03/B/ST1/04427.
Open Access This article is distributed under the terms of the Creative Commons Attribution 4.0
International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution,
and reproduction in any medium, provided you give appropriate credit to the original author(s) and the
source, provide a link to the Creative Commons license, and indicate if changes were made.
1. Blunck , A. , Havlicek , H.: Projective representations I: projective lines over a ring . Abh. Math. Semin. Univ. Hambg . 70 , 287  299 ( 2000 )
2. Blunck , A. , Havlicek , H.: The connected components of the projective line over a ring . Adv. Geom. 1 , 107  117 ( 2001 )
3. Blunck , A. , Havlicek , H.: On distantisomorphisms of projective lines . Aequationes Math . 69 , 146  163 ( 2001 )
4. Blunck , A. , Herzer , A. : KettengeometrienEine Einführung . Shaker Verlag, Aachen ( 2005 )
5. Cohn , P.H. : On the structure of the G L2 of a ring . Inst. Hautes Etudes Sci. Publ. Math. 30 , 5  53 ( 1966 )
6. Herzer , A. : Chain geometries . In: Buekenhout, F . (ed.) Handbook of Incidence Geometry , pp. 781  842 . Amsterdam, Elsevier ( 1995 )
7. PopescuPampu , P.: The geometry of continued fractions and the topology of surface singularities . In: Brasselet, J.P. , Suwa , T. (eds.) Singularities in Geometry and Topology 2004 . Advanced Studies in Pure Mathematics , vol. 46 , pp. 119  195 . Kinokuniya, Tokyo ( 2007 )
8. Siemaszko , A. , Wojtkowski , M.P. : Counting Berg partitions . Nonlinearity 24 , 2383  2403 ( 2011 )
9. Siemaszko , A. , Wojtkowski , M.P. : Counting Berg partitions via Sturmian words and substitution tilings . European Congress of Mathematics Kraków , pp. 779  790 . European Mathematical Society Publishing House ( 2014 ), 2  7 July 2012