Keywords

1 The Language of Space

lopadotemahoselahogeleokraniolipsanodimypotrimatosilfio

laravomelitokatakehymenokihlepikosyfofatoperisteralektryonopto

kefalliokiglopeliolagosireovafitraganopterygon

“λοπαδοτεμαχοσελαχογαλεοκρανιολειψανοδιμυποτριμματοσιλφιο

λαραβομελιτοκατακεχυμενοκιχλεπικοσσυφοφαττοπεριστεραλεκτρυονοπτο

κεφαλλιοκιγκλοπελειολαγωσιραιοβαφητραγανοπτερύγων”

(Aristophanes, 427-386 b.C., “Ecclesiazusae”, line 1163)

Aristophanes, the ancient greek author of the first comedies in the history of theatre wrote this 171 letters-long word that probably used to be the longest known word throughout the ages, supposedly referring to a name of a dish, a kind of a fricassée containing some 15 ingredients: clearly a “complex” word, describing an equally complex set of ailments recommended for the creation of this dish. But it is not human language alone that can create very long words. Metaphorically, space also “speaks” immensely lengthier “words”, so long as one is able to “listen” to them. Geometric, topological and other mathematical aspects of spatial complexity may indicate whether a spatial object is endowed with a higher or lower spatial complexity, but they do not constitute measures of spatial complexity themselves. This leads us to a central issue with respect to the measurement of spatial complexity: Since complexity is different than entropy, or any other indicator of complexity, any measure of complexity should be a measure of complexity per se, backed by the mathematical literature of complexity. Such a measure should (under certain topological restrictions) be of general applicability to two-(and possibly higher)-dimensional smooth surfaces. A rasterization/digitization significantly facilitates the measurement of spatial complexity, since even maps of points and lines can (under certain conditions) be rasterized and, subsequently, symbols of cover or color can be assigned to each cell of the resulting square grid. The term “raster” that is commonly used in GIS signifies geoprocessing of spatial elements on the basis of squares (pixels). In fact, it is a common practice in geospatial analysis to “rasterize” all spatial elements, that is to attribute to square cells or pixels even linear or point data. The long experience gained from the use of geographic technologies (such as Geographical Information Systems “GIS” and satellite image processing) is particularly useful in this respect. After experimenting with various geo-encoding models, digital arrays of pixels are used to represent either “vector” (0-and-1-dimensional) or “raster” (2-dimensional) spatial entities. The rasterization is easily created by enlarging or reducing the map size as appropriate and assigning a special color to each one of its cells (Fig. 6.1). Whether the term “cell” or “pixel” is used, it invariably concerns discrete square cells on a map of equal square partitions. In the science and practice of image processing, continuous functions are routinely used in image analyses. For instance, the convolution of the map f(x, y) with the map g(x, y) is defined as a function:

Fig. 6.1
figure 1

Rasterization” is a widely used process in image analysis, by which points, lines and areas (0,1,2-dimensional spatial elements respectively) are translated to square cells. In this way, all elements of a map, whether points or lines or areas, can be converted to cellular (square) representations, with accuracy depending on the pre-decided resolution of the square map that is to be constructed

$$h(x,y) = \iint {f(x_{1} ,y_{1} )g(x - x_{1} ,y - y_{1} )dx_{1} dy_{1} }$$
(6.1)

Thus, analytic expressions of known functions are used in their discrete form, such as, for instance, the discrete Fourier Transform of a 2d array f(x, y) of size mxn:

$$f(u,v) = \frac{1}{{\sqrt {mn} }}\sum\limits_{x = 0}^{m - 1} {\sum\limits_{y = 0}^{n - 1} {f(x,y)e^{{ - 2i\pi \left( {\frac{xu}{m} + \frac{vy}{n}} \right)}} } }$$
(6.2)

Equivalently, the form of a closed curve on the plain in polar coordinates (with distance D from the barycentre and angle θ with respect to the horizontal axis) is given in terms of a typical Fourier expression:

$$D= \frac{{a_{0} }}{2} + \sum\limits_{n = 1}^{\infty } {\left[ {a_{n} \cos (n\theta ) + b_{n} \sin (n\theta )} \right]}$$
(6.3)

The analytic approach applies when the curve is “not too rough”. When the curve’s shape is not so, the analytic approach is of limited applicability, because it renders more than one values for the same angle θ. But when the map is examined in discrete cells, there is always one single value attributed to each cell. Further, the numerical application of such functions practically presupposes discrete spatial domains, so some “discretization” or “rasterization” process is eventually unavoidable for all kinds of computerized image processing.

A square “map” is a binary or multicolored planar surface, which has been constructed by any means (satellite or aerial photography, plain photography, field observations, cartographic processing etc.), and can be described mathematically by a function on the discrete plain Z2 defined as \(f{:}Z^{2} \to \{ 0,1,2,...,V\}\), where V is the number of colors (“covers”) appearing on the map. In example, a “binary map” is defined by a function \(f{:}Z^{2} \to \{ 0,1\}\), where f(0) = white and f(1) = black. In the same way, for higher spatial dimensions, the mapping function f is defined in Z3 (for three dimensions, in which case, the equivalent of the 2d pixel is a 3d a “voxel”), in Z4 (for four dimensions, in which case, the equivalent is a 4d a “doxel”), or in Zn in general.

Obviously, an alphabet of symbols may be chosen so as to adequately represent (under certain conventions) spatial allocations (i.e. colors) on a rasterized map (Fig. 6.2). Yet, we should not lose sight from the fact that both spatial and semantic generalizations made on the initial image, map or surface, affect the accuracy, precision and effectiveness of our assessments of spatial complexity. It is easy to visualize how a map configuration can eventually be converted into a linguistic or numerical description with a “run length encoding”, where the spatial sequence of a map’s allocation of covers (i.e.landscape or soil types, kinds of land use, geomorphic features) corresponds to symbols of an alphabet. Similarly, three-dimensional spaces can be converted to linguistic descriptions by using some (appropriate for that purpose) alphabet.

Fig. 6.2
figure 2

If a three-dimensional surface that is covered by three types of cover (A, B, C) is projected on a 2-dimensional space and then encoded by using an alphabet of three symbols (A, B, C), it eventually yields a map, or, alternatively, a 2d linguistic description of this surface

Even maps of points can be converted to maps of square cells. This process involves the use of Voronoi polygons (or Voronoi cells, or Thiessen polygons) that make a one-to- one correspondence of spatial regions to points. Indeed, areas covered by Voronoi polygons can be converted to a map of square cells (Fig. 6.3). Following similar procedures, lines and curves may be made equivalent to areas, which are eventually displayed as raster maps.

Fig. 6.3
figure 3

Even spatial distributions of points (a) can be converted to areas of square cells (f). Voronoi polygons can be used to convert point data to maps of square cells. Beginning with a map (a) with point data only, a triangulation of the space is created by connecting the points (b). Next, the barycentres of all triangles are defined (c). Consequently, the barycentres are joined by lines and these lines are extended as appropriate (d) up to the map’s boundaries. The number of the resulting Voronoi polygons (e) is equal to the number of initial points (8 in this example) and, eventually, the map of Voronoi polygons is rasterized (f)

Practically, re-arranging a two-dimensional image as an one-dimensional line has long proven useful in computational analyses, particularly for image classification purposes (Seiffert and Michaelis 1997). It is now natural to ask “how can we measure the complexity of spatial forms of a binary map (or landscape with two land cover types), without considering spatial distributions of particular physical entities in it?”.

An index of spatial complexity (IS) was initially proposed by Papadimitriou (2002), measuring the number of common boundaries between different kinds of map cover per unit area. Later, a different index was proposed (Papadimitriou 2009), based on Levenshtein distances (Levenshtein 1966) which measure the minimum distance between two strings of symbols as the minimum number of the three basic operations necessary to convert one string into another (deletions d, substitutions s, additions t): a = min{d + s + t}. It was shown (Papadimitriou 2009) that this algorithm can be spatialized and that it can be used to calculate the spatial complexity of a map by means of the formula:

$$C_{L} = \frac{1}{uv}\sum\limits_{\begin{subarray}{l} i = 1 \\ j = 1 \end{subarray} }^{\begin{subarray}{l} j = v - 1 \\ i = u - 1 \end{subarray} } {\alpha_{ij} }$$
(6.4)

where u = rows, v = columns of cells of the map, and αij are the entries of the matrix of the edit distances which are derived by comparing parallel and adjacent strips of landscapes. This formula converts the one-dimensional edit algorithm from a measure of minimum description of string differences to a measure of minimal length description of spatial differences and it is for this reason that it serve as a measure of spatial complexity (Papadimitriou 2009).

Another index (KS) was later suggested (Papadimitriou 2012), based on the concept of Kolmogorov complexity (Kolmogorov 1965, 1986), defined as

$$K_{s} = \min \left(( {U\left( x \right), \, U\left( y \right),U\left( {x^{\prime } } \right),U\left( {y^{\prime } } \right)} \right)$$
(6.5)

where x = the original horizontal string, y = the compressed horizontal string, x′ = the vertical string, y′ = the vertical compressed string.

The notion of “Kolmogorov complexity” was used to evaluate the algorithmic complexity of a finite string of symbols (e.g. ABDDCBFGAAG… or 0,111,001,010…), which is defined on a finite alphabet, such as {A, B, C, D … Z} or {0, 1, 2, …}, or {black, white}, or {0, 1} or any other.

The problem with Kolmogorov complexity is that, in the general case, it is non-computable, so alternative approaches have appeared in the literature. Fortnow et al. (2011) sought possible answers to the question of extracting the Kolmogorov-randomness from a string and showed that we can extract Kolmogorov complexity with only a constant number of bits of additional information in a polynomial-time computable procedure. Furthermore, it is possible to apply a modified notion of Kolmogorov-complexity to “short” strings, as will be explained in the next section.

2 Metrics of Spatial Complexity

“Tutor: What is twice three?

Scout: What’s a rice tree?

Sub-scout: When is ice free?

Sub-Sub-scout: What’s a nice fee?”

(Lewis Carroll, 1832–1898)

With these premises from previous research, two new and more effective metrics of spatial complexity will be defined here. “Fivos Papadimitriou spatial complexity metric 1” (referred to as CP1 hereafter) and the explicit procedure for its computation will be described next.

This metric makes use of an initial concept by Papentin (1973, 1980, 1982, 1983a, b), who suggested that it is possible to evaluate the complexity (not spatial) of a small string by identifying patterns in it and then the string’s complexity is defined as the length of the compressed string. However, he did not present any algorithmic procedure for identifying such patterns and his method was not spatial either. Also, the measure previously defined on the basis of Kolmogorov complexity (Ks) that was described by Papadimitriou (2012) did not comprise any algorithmic procedure for finding patterns in a string. And one further difference between the CP1 and the procedures developed by both Papentin (1973) and Papadimitriou (2012) mentioned previously, is that CP1 is much more restrictive, because it is defined as the minimum algorithmic complexity taking into account all possible orientation changes of the square map under consideration.

Consequently CP1 differs:

  1. (I)

    from the Papadimitriou (2012) metric, because: (a) it follows an exact algorithmic procedure for finding patterns, (b) it is based on Papentin complexity rather than on Kolmogorov complexity and (c) it is calculated as the minimum from all possible symmetric transformations (rotations, inversions etc.) of the original map.

  2. (II)

    from the Papentin (1973) metric, because: (a) it is spatial (Papentin’s measure was not) and (b) it is associated with an exact procedure for the identification of patterns.

In computing the string length, the following conventions are used:

  1. (a)

    If a symbol is repeated twice or more consecutively, then it can be written with a power of the times it appears consecutively, i.e. the string AAAAAAABA can be shortened to A7BA.

  2. (b)

    If a block of symbols repeats itself consecutively, then parentheses can be used and powers indicating the number the block of symbols is repeated, i.e. the string ABCABCABCABCABCABC can be represented as (ABC)6.

  3. (c)

    Lambda (λ) symbolizes a block of consecutive symbols, used to indicate compression. In the compressed string, the lambda block of symbols is separated by a comma (,) from the λ-compressed string. The comma is also counted as a separate symbol in the final string length calculation. For instance, the initial 30 symbols-long string:

BWBBWBBWBBWBBWBBWBBWBBWBBWBWWW

can be compressed by using the compression λ = BWB that has 5 symbols to create the following short string: λ9W3.

The above notation would be incomplete without citing the compression λ = BWB, because λ could symbolize just any block of symbols. Hence, the compression of the initial string should be written as: λ = BWB, λ9W3 which consists in 10 symbols (5 symbols for the λ = BWB plus one symbol for the comma, and 4 symbols additionally for the short string).

Thus, without any loss of information, it can be said that this compressed 10-symbols long string can fully encode the initial 30-symbols long string. Hence, the formula for the calculation of CP1 is simply:

$$\it C_{P1} = \min_{{D_{4} }} \left\{ {S_{b} } \right\}$$
(6.6)

where b = 1, 2, 3, … L and Sb are all the compressed strings generated by blocks (b) of symbols, from b = 1 symbol up to b = L symbols, and L is the initial length of the string and for all possible map orientations derived from the symmetry group of the square (D4).

Let us now see exactly how the CP1-complexity of a small map can be calculated. Beginning by scanning cells from top to bottom and from left to right (as one reads the lines of a book), consider a 3 × 3 binary map (Fig. 6.4) with initial string (with the position of each symbol numbered below): W B B W B B W B B.

Fig. 6.4
figure 4

Converting a map to a “word” (a string of symbols) for the calculation of its spatial complexity

The procedure begins by first trying possible compressions using blocks of two symbols, beginning from the two first symbols on the left of the string and ending with the two last symbols (the abbreviation CSL stands for compressed string length):

  1. (a)

    Blocks of 2 symbols

Symbols’ numbers

λ

Compression

Short string

CSL

1 + 2

WB

λ = WB

λ = WB, λΒλΒλΒ

11

2 + 3

BB

λ = BB

λ = ΒB, WλWλWλ

11

3 + 4

BW

λ = BW

λ = BW, WBλΒλΒ2

12

4 + 5

WB

λ = WB

λ = WB, λΒλΒλΒ

11

5 + 6

BB

λ = BB

λ = ΒB, WλWλWλ

11

6 + 7

BW

λ = BW

λ = BW, WBλΒλΒ2

12

7 + 8

WB

λ = WB

λ = WB, λΒλΒλΒ

11

8 + 9

BB

λ = BB

λ = ΒB, WλWλWλ

11

and continues with block sizes increasing by one, up to L − 1, as follows:

  1. (b)

    Blocks of 3 symbols

Symbols’numbers

λ

Compression

Short string

CSL

1 + 2 + 3

WBB

λ = WBB

λ = WBB, λ3

8

2 + 3 + 4

BBW

λ = BBW

λ = BBW, Wλ2B2

11

3 + 4 + 5

BWB

λ = BWB

λ = BWB, WBλ2B

11

4 + 5 + 6

WBB

λ = WBB

λ = WBB, λ3

8

5 + 6 + 7

BBW

λ = BBW

λ = BBW, Wλ2B2

11

6 + 7 + 8

BWB

λ = BWB

λ = BWB, WBλ2B

11

7 + 8 + 9

WBB

λ = WBB

λ = WBB, λ3

8

  1. (c)

    Blocks of 4 symbols

Symbols’ numbers

λ

Compression

Short string

CSL

1 + 2 + 3 + 4

WBBW

λ = WBBW

λ = WBBW, λΒ22

13

2 + 3 + 4 + 5

BBWB

λ = BBWB

λ = BBWB, WλBWB2

13

3 + 4 + 5 + 6

BWBB

λ = BWBB

λ = BWBB, WBλWB2

13

4 + 5 + 6 + 7

WBBW

λ = WBBW

λ = WBBW, λΒ22

13

5 + 6 + 7 + 8

BBWB

λ = BBWB

λ = BBWB, WλBWB2

13

6 + 7 + 8 + 9

BWBB

λ = BWBB

λ = BWBB, WBλWB2

13

  1. (d)

    Blocks of 5 symbols

Symbols’ numbers

λ

Compression

Short string

CSL

1 + 2 + 3 + 4 + 5

WBBWB

λ = WBBWB

λ = WBBWB, λΒWΒ2

13

2 + 3 + 4 + 5 + 6

BBWBB

λ = BBWBB

λ = BBWBB, WλWB2

13

3 + 4 + 5 + 6 + 7

BWBBW

λ = BWBBW

λ = BWBBW, WBλB2

13

4 + 5 + 6 + 7 + 8

WBBWB

λ = WBBWB

λ = WBBWB, λΒWB2

13

5 + 6 + 7 + 8 + 9

BBWBB

λ = BBWBB

λ = BBWBB, WλWB2

13

  1. (e)

    Blocks of 6 symbols

Symbols’ numbers

λ

Compression

Short string

CSL

1 + 2 + 3 + 4 + 5 + 6

WBBWBB

λ = WBBWBB

λ = WBBWBB, λWΒ2

13

2 + 3 + 4 + 5 + 6 + 7

BBWBBW

λ = BBWBBW

λ = BBWBBW, WλB2

13

3 + 4 + 5 + 6 + 7 + 8

BWBBWB

λ = BWBBWB

λ = BWBBWB, WBλB

13

4 + 5 + 6 + 7 + 8 + 9

WBBWBB

λ = WBBWBB

λ = WBBWBB, λWΒ2

13

  1. (f)

    Blocks of 7 symbols

Symbols’ numbers

λ

Compression

Short string

CSL

1 + 2 + 3 + 4 + 5 + 6 + 7

WBBWBBW

λ = WBBWBBW

λ = WBBWBBW, λΒ2

13

2 + 3 + 4 + 5 + 6 + 7 + 8

BBWBBWB

λ = BBWBBWB

λ = BBWBBWB, WλB

13

3 + 4 + 5 + 6 + 7 + 8 + 9

BWBBWBB

λ = BWBBWBB

λ = BWBBWBB, WBλ

13

  1. (g)

    Blocks of 8 symbols

Symbols’ numbers

λ

Compression

Short string

CSL

1 + 2 + 3 + 4 + 5 + 6 + 7 + 8

WBBWBBWB

λ = WBBW, BBWB

λ = WBBWBBWB, λΒ

13

2 + 3 + 4 + 5 + 6 + 7 + 8 + 9

BBWBBWBB

λ = BBWB, BWBB

λ = BBWBBWBB, Wλ

13

From these calculations, it follows that a string of 8 symbols is the shortest one. This shortest string faithfully represents the original string of 9 symbols without loss of information. But 8 is not the value of CP1. From all possible rotations of the initial map, a rotation by 90° to the right produces a compressed string shorter than 8 symbols (Fig. 6.5), so the resulting string consists in 4 symbols only: W3B6 and hence we eventually conclude that CP1 = 4 for this map.

Fig. 6.5
figure 5

Orientation matters in the calculation of spatial CP1 -complexity: rotating the initial binary map (left, with string WB2WB2WB2) by 90° to the right results in the string W3B6, of which the complexity is readily calculated to be equal to 4 (in contrast to the original map, for which a lengthy calculation process was required, resulting to a complexity value equal to 8)

Besides CP1, yet another algorithmic metric will be defined here, what can be called the “Fivos Papadimitriou spatial complexity metric 2”, symbolized by CP2, based on modifications of the formula that was derived by Papadimitriou (2009), so as to make it much easier to calculate and more appropriate for small square maps. The division by the product of rows and columns will be omitted here so it will be only the sum of the total Levenshtein distances; not their average as in Papadimitriou (2009) and is thus calculated as:

$$\normalsize \normalsize \normalsize \it C_{P2} = \sum\limits_{\begin{subarray}{l} i = 1 \\ j = 1 \end{subarray} }^{\begin{subarray}{l} j = v - 1 \\ i = u - 1 \end{subarray} } {\alpha_{ij} }$$
(6.7)

where aij are the in-between i-rows (i = 1, 2, …, u) and in-between j-columns (j = 1, 2, …, v) Levenshtein distances which result from pairwise comparisons of strips of the surface considered, successively, and for all the strips covering the surface. Thus, the CP2 metric differs from the CL metric in the following:

  1. (a)

    it requires less calculations to compute compared to CL for square maps since no averaging for columns and rows is required;

  2. (b)

    it assumes only positive integers as values;

  3. (c)

    it can be used to derive values that are comparable to CP1 for small maps (notice, for instance, that, for 3 × 3 binary maps the maximum value of both CP1 and CP2 is 8).

However, instead of seeking a minimum length of string number, CP2 seeks a minimum operations number.

Another difference is that while CP1 is sensitive to symmetric transformations (rotations, inversions), CP2 is not (for an example calculation of CP2 see Fig. 6.6).

Fig. 6.6
figure 6

A 5 × 5 square map with three cover types showing how CP2 and CP1 values are comparable for small square maps. First, notice that CP1=22 because the map’s irreducible string is: A2CBA2B2C5 BA2CACBA2BAC. Some characteristic column and row slides are depicted to illustrate the calculations of CP2 per pair of rows and columns. Eventually, the calculations lead to CP2 = 24 (that is an agreement by more than 90% of the two metrics for this map)

Complexity calculations of either CP2 or CP1 may also be carried out (as the case may be) according to the “entropy encoding” technique that is widely used in image processing for many electronics applications. This is a procedure of lossless data compression, derived by encoding the image components in a “zigzag” fashion, as shown in Fig. 6.7. It begins from one of the corner cells of the image and then proceeds in a zigzag manner up to the opposite corner of the image, by recording the cell category of each cell encountered in this zigzag process. Yet, there are several other scanning methods that are used in optoelectronics and other technologies. Following such other methods will inevitably result in different strings of symbols than the raster scanning (Fig. 6.8).

Fig. 6.7
figure 7

The “entropy encoding” technique applied on a rasterized 8 × 8 initial image (a): beginning with the top left corner cell (b), continuing with the second upper right cell, then carrying on diagonally until the entire image is “encoded”, down to the bottom right cell

Fig. 6.8
figure 8

Alternative scanning methods used in various technologies: raster scanning (a) that is most commonly used, rosette scanning (b), spiral scanning (c), linear array scanning (d)

3 Extrema of Spatial Complexities CP1 and CP2

Since things may differ from one another,

to a higher or a lesser degree of difference,

there is also a maximal difference,

and that one I call contrariety

“ἐπεὶ δὲ διαφέρειν ἐνδέχεται ἀλλήλων τὰ διαφέροντα πλεῖον καὶ ἔλαττον,

ἔστι τις καὶ μεγίστη διαφορά, καὶ ταύτην λέγω ἐναντίωσιν”

(Aristotle, 384-322 b.C., “Metaphysics”, 10.1055a)

It is easy to verify that the CP2 of any multicolored square map of size n ranges in between 2 and \(2n - 2\sqrt n\). Indeed, the spatial complexity of any multicolored map is lowest when there is only one different cell at any one of the map’s corners. In this case, the map’s CP2 is at least 2, because the corner cell has only two borders with two white cells. So the pairwise comparisons of the 1st row with the 2nd row and the 1st column with the 2nd column will record this difference in CP2. As the size of a multicolored map increases, all cells will have different colors, so the maximum CP2 produces \(\sqrt n\) by pair of rows, as well as by per pair of columns. Hence there are \(\sqrt n - 1\) comparisons of map rows, plus \(\sqrt n - 1\) comparisons of map columns, with \(\sqrt n\) differences per comparison. Consequently, there are \(2\sqrt n (\sqrt n - 1)\) differences between cells, compared by columns and by rows pairwise and thus,

$$2 \le C_{P2} \le 2n - 2\sqrt n$$
(6.8)

Expectedly, the max CP2 grows with increasing n.

As concerns CP1, if a square binary map of size n has only one black cell and that particular cell is located at anyone of the map’s corners, then its CP1 is minimum and equal to:

$$C_{P1\min } = 3 + \left\lfloor {\log_{10} (n)} \right\rfloor$$
(6.9)

In fact, for any binary map, the lower complexity is attained when there is only one black cell at any one of the map’s corners. In this case, the map’s CP1 is

$$C_{P1} \left\{ {{\text{BW}}^{{\text{u}}} } \right\} = 3$$
(6.10)

where u is the number of white cells that follow in the string.

If there are up to u = 9 white cells (that is a map with n = 10 cells) then the string still has the same minimum:

$$C_{P1} \left\{ {{\text{BW}}^{{9}} } \right\} = 3$$
(6.11)

and thus, in this case, the minimum CP1 is also CP1 = 3.

If there are u = 10 white cells following the corner black cell, then the string has n = 11 so that:

$$C_{P1} \left\{ {{\text{BW}}^{{{10}}} } \right\} = 4$$
(6.12)

In fact, CP1 will remain equal to 4 for all strings of length up to n = 99:

$$C_{P1} \left\{ {{\text{BW}}^{{{99}}} } \right\} = 4$$
(6.13)

However, with one more cell (n = 100), the string will need three digits to be described (of which two characters only to represent the power of W), so CP1-complexity becomes:

$$C_{P1} \left\{ {{\text{BW}}^{{{100}}} } \right\} = 5$$
(6.14)

Thus, as the map size increases, string codes are determined by a power of 10 (hence by the logarithm of 10) of the exponent u. As log10n also assumes non-integer values, the floor function \(\left\lfloor {} \right\rfloor\) of the logarithm of n applies, so CP1 has a bound of its minimum value, depending on the map size n, defined as:

$$C_{P1\min } = 3 + \left\lfloor {\log_{10} (n)} \right\rfloor$$
(6.15)

or, equivalently,

$$C_{P1} = 2 + \left\lceil {\log_{10} (n)} \right\rceil$$
(6.16)

where \(\left\lceil {} \right\rceil\) is the ceiling function.

Notice that the floor function is a stepwise function, meaning that the maximum values of the minima of CP1 min assume integer values only, whose ranges increase slowly with n. To verify, consider the following examples, with increasing mapsize n:

$${\text{For}}\,n = 81,C_{P1\,\min } = 3 + \left\lfloor {\log_{10} (81)} \right\rfloor = 3 + \left\lfloor {1.81} \right\rfloor = 4$$
(6.17)
$${\text{For}}\,n = 121,C_{P1\,\min } = 3 + \left\lfloor {\log_{10} (121)} \right\rfloor = 3 + 2 = 5$$
(6.18)
$${\text{For}}\,n = 625,C_{P1\,\min } = 3 + \left\lfloor {\log_{10} (625)} \right\rfloor = 3 + \left\lfloor {2.25} \right\rfloor = 5$$
(6.19)

Thus if any one of the four corner cells of a binary square map is black, whatever the map size, the minimum CP1 complexity can not be higher than \(3 + \left\lfloor {\log_{10} (n)} \right\rfloor\).

More generally, for the entropy class 1, the minimum CP1 complexity is attained when there is only one black cell, located at anyone of the map’s corners, so for all binary maps

$$C_{P1\,\min } = 3 + \left\lfloor {\log_{10} (n)} \right\rfloor = 2 + \left\lceil {\log_{10} (n)} \right\rceil$$
(6.20)

holds, whatever the value of n is.

Given these, it can be proven that if all the black cells of a binary square map appear as a single block of ω-consecutive black cells located after m-consecutive white cells anywhere in the map except for its corners, then the CP1 is:

$$C_{P1} = 3 + \left\lceil {\log_{10} (m)} \right\rceil + \left\lceil {\log_{10} (\omega )} \right\rceil + \left\lceil {\log_{10} (n - m - \omega )} \right\rceil$$
(6.21)

Indeed, for any black cell located anywhere in the binary map but the corner, the string has the general form:

$${\text{W}}^{m} {\text{BW}}^{n - m - 1}$$
(6.22)

where m is the number of cells preceding the black cell and therefore the CP1 of such strings is:

$$C_{P1} = 3 + \left\lceil {\log_{10} (m)} \right\rceil + \left\lceil {\log_{10} (n - m - 1)} \right\rceil$$
(6.23)

For three black consecutive cells located anywhere in the map except for the corner, the string is:

$${\text{W}}^{m} {\text{B}}^{3} {\text{W}}^{n - m - 3}$$
(6.24)

which has a CP1 equal to:

$$C_{P1} = 5 + \left\lceil {\log_{10} (m)} \right\rceil + \left\lceil {\log_{10} (n - m - 3)} \right\rceil$$
(6.25)

Consequently, for a block of ω consecutive black cells located anywhere in the map but the corner, the string is:

$${\text{W}}^{m} {\text{B}}^{\omega } {\text{W}}^{n - m - \omega }$$
(6.26)

and hence:

$$C_{P1} = 3 + \left\lceil {\log_{10} (m)} \right\rceil + \left\lceil {\log_{10} (\omega )} \right\rceil + \left\lceil {\log_{10} (n - m - \omega )} \right\rceil$$
(6.27)

This formula gives the complexity of all binary maps with entropy class 1 with black cells appearing as a single block anywhere in the binary map except for the map’s four corner cells.

As an example, consider a binary 10 × 10 map (Fig. 6.9), with the following incompressible string of 9 symbols:W36B25W39. This map has a single block of 25 consecutive black cells located after 36 initial white cells and 39 white cells that follow immediately after the block of black cells.

Fig. 6.9
figure 9

A 10 × 10 binary map, with a single block of 25 consecutive black cells located after 36 initial white cells and 39 white cells that follow immediately after the block of black cells

Applying the previous formula, the CP1 complexity of this map is:

$$\begin{aligned} C_{P1} & = 3 + \left\lceil {\log_{10} (36)} \right\rceil + \left\lceil {\log_{10} (25)} \right\rceil + \left\lceil {\log_{10} (39)} \right\rceil \\ & = 3 + 2 + 2 + 2 = 9 \\ \end{aligned}$$
(6.28)

Due to to the periodic nature of the floor and ceiling functions, the following proposition is interesting to consider, which holds when the logarithm of n with base 10 is non-integer (as most often the case is).

Also, it if and only if \(\left\lfloor {\log_{10} (n)} \right\rfloor \notin Z\), then a lower bound of the minimum CP1 of a square binary map is 2 + log10n.

This follows immediately by considering the Fourier series expansion (sawtooth function) of the floor function for non-integer real numbers x:

$$\left\lfloor x \right\rfloor = x - \frac{1}{2} + \frac{1}{\pi }\sum\limits_{k = 1}^{\infty } {\left[ {\frac{{\sin \left( {2\pi kx} \right)}}{k}} \right]}$$
(6.29)

Substituting the value x = log10(n) to

$$C_{P1\,\min } = 3 + \left\lfloor {\log_{10} (n)} \right\rfloor$$
(6.30)

yields:

$$C_{P1\,\min } = \log_{10} n + \frac{5}{2} + \frac{1}{\pi }\left[ {\sum\limits_{k = 1}^{\infty } {\frac{{\sin \left[ {2\pi k(\log_{10} (n))} \right]}}{k}} } \right]$$
(6.31)

and given the bounded variation of the Fourier series, one lower bound is:

$$2 + \log_{10} n$$
(6.32)

In fact, it is easy to verify that

$$\frac{5}{2} + \log_{10} n > 3$$
(6.33)

holds for every n > 3.16228 (this is one lower bound; what is the infimum?).

As an example, consider n = 121. Then, log10(121) = 2.082, so a lower bound of CP1 min is 2 + 2.082 = 4.082. Indeed,

$$C_{P1\,\min } = 3 + \left\lfloor {\log_{10} (121)} \right\rfloor = 5 > 4.082$$
(6.34)

Interestingly, the minimum CP1 of binary maps can also be related to the transcendental number π. An alternative expression is derived by expanding the Fourier series by complex numbers. In the previous example, the same result is derived either way:

$$\begin{aligned} C_{P1\min } & = \frac{5}{2} + \log_{10} (121) \\ & \quad - \frac{{i\left[ {\log (1 - e^{{ - 2i\pi \log_{10} (121)}} ) - \log (1 - e^{{2i\pi \log_{10} (121)}} )} \right]}}{2\pi } = 5 \\ \end{aligned}$$
(6.35)

If and only if all black cells of a binary square map appear as a single block of ω-consecutive black cells located after m-consecutive white cells anywhere in the map except for its corner, and

$$\left\lfloor {\log_{10} (m)} \right\rfloor \wedge \left\lfloor {\log_{10} (\omega )} \right\rfloor \wedge \left\lfloor {\log_{10} (n - m - \omega )} \right\rfloor \notin Z,$$

then a lower bound of the minimumCP1 of the map is:

$$3 + \log_{10} m\omega + \log_{10} (n - m - \omega )$$
(6.36)

This can be proven by considering that

$$\begin{aligned} & C_{{P1\min }} = 6 + \log _{{10}} m\omega + \log _{{10}} (n - m - \omega ) - \frac{3}{2} + \\ & + \frac{1}{\pi }\Bigg[{\sum\limits_{{k = 1}}^{\infty } {\frac{1}{k}} } \left( {\sin \left[ {2\pi k(\log _{{10}} m)} \right] + \sin \left[ {2\pi k(\log _{{10}} \omega )} \right]} \right. + {\left. { \sin \left[ {2\pi k(\log _{{10}} n - m - \omega )} \right]} \right)} \Bigg] \\ \end{aligned}$$
(6.37)

and as 

$$- \frac{3}{2} \le \frac{1}{\pi }\Bigg[ \sum\limits_{k = 1}^{\infty } {\frac{1}{k}}\left( {\sin \left[ {2\pi k(\log_{10} m)} \right] } + {\sin \left[ {2\pi k(\log_{10} \omega )} \right]} \right. {\left. { + \sin \left[ {2\pi k(\log_{10} n - m - \omega )} \right]} \right)} \Bigg] \le \frac{3}{2} $$
(6.38)

it follows that a lower bound is

$$3 + \log_{10} m\omega + \log_{10} (n - m - \omega )$$
(6.39)

Finally, as the map size n of a multicolored square map increases with \(n \to \infty\), the ratio of the maximum CP1 to the number of the cells’ boundaries converges to 1 and the minimum CP1 tends to zero.

The proof follows easily by counting the number of boundaries from left to right and converting them into a string of symbols. The first row has \(\sqrt n\) boundaries, but the last cell of the 1st row is the boundary of the second row. Continuing until the penultimate cell, the number of boundaries in a multicolored square map is U = n − 1. All the first column cells have no boundary (they share the same boundary with the last column’s right boundaries) and the last cell (down right) has no boundary to any other cell. So, for instance, a 4 × 4 map has 15 boundaries between cells if the entire map is converted into an one-dimensional map. Consequently, it easily follows that

$$\mathop {\lim }\limits_{{n \to \infty }} \left( {\frac{{C_{{P1\max }} }}{U}} \right) = \mathop {\lim }\limits_{{n \to \infty }} \frac{n}{{n - 1}} = 1$$
(6.40)

and

$$\mathop {\lim }\limits_{{n \to \infty }} \left( {\frac{{C_{{P1\min }} }}{U}} \right) = \mathop {\lim }\limits_{{n \to \infty }} \frac{{3 + \left\lfloor {\log _{{10}} n} \right\rfloor }}{{n - 1}} = 0$$
(6.41)