• Research
• Open Access

# Fixed point theorems in generalized metric spaces with applications to computer science

Fixed Point Theory and Applications20132013:118

https://doi.org/10.1186/1687-1812-2013-118

• Received: 3 January 2013
• Accepted: 17 April 2013
• Published:

## Abstract

In 1994, Matthews introduced the notion of a partial metric space in order to obtain a suitable mathematical tool for program verification (Matthews in Ann. N.Y. Acad. Sci. 728:183-197, 1994). He gave an application of this new structure to formulate a suitable test for lazy data flow deadlock in Kahn’s model of parallel computation by means of a partial metric version of the celebrated Banach fixed point theorem (Matthews in Theor. Comput. Sci. 151:195-205, 1995). In this paper, motivated by the utility of partial metrics in computer science, we discuss whether they are a suitable tool for asymptotic complexity analysis of algorithms. Concretely, we show that the Matthews fixed point theorem does not constitute, in principle, an appropriate implement for the aforementioned purpose. Inspired by the preceding fact, we prove two fixed point theorems which provide the mathematical basis for a new technique to carry out asymptotic complexity analysis of algorithms via partial metrics. Furthermore, in order to illustrate and to validate the developed theory, we apply our results to analyze the asymptotic complexity of two celebrated recursive algorithms.

MSC:47H10, 54E50, 54F05, 68Q25, 68W40.

## Keywords

• partial metric
• fixed point
• asymptotic complexity analysis
• recurrence equation
• running time of computing

## 1 Introduction

When a computational program uses a recursion process to find the solution to a problem, such a process is characterized by obtaining in each step of the computation an approximation to the aforementioned solution which is better than the approximations obtained in the preceding steps and, in addition, by obtaining always the final approximation to the problem solution as the ‘limit’ of the computing process. A mathematical model to this sort of situations is the so-called Scott model which is based on ideas from order theory and topology (see [1, 2] for a detailed account of the Scott model and its applications). In particular, the order represents some notion of information in such a way that each step of the computation is identified with an element of the mathematical model which is greater than (or equal to) the other ones associated with the preceding steps, since each approximation gives more information about the final solution than those computed before. The final output of the computational process is seen as the limit of the successive approximations. Thus the recursion processes are modeled as increasing sequences of elements of the mathematical model, which is identified with an ordered set, that converge to its least upper bound with respect to the given topology.

In 1994, Matthews introduced the notion of Scott-like topology as a mathematical framework to model increasing information content sequences in computer science in the spirit of Scott .

Let us recall, with the aim of reminding the concept of Scott-like topology, that a pair $\left(X,\le \right)$ is said to be an ordered set provided that X is a nonempty set and ≤ is a reflexive, antisymmetric and transitive binary relation on X . Given a subset $Y\subseteq X$, an upper bound for Y is an element $x\in X$ such that $y\le x$ for all $y\in Y$. A least element for Y is an element $z\in Y$ such that $z\le y$ for all $y\in Y$. Moreover, a sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in $\left(X,\le \right)$ is increasing if ${x}_{n}\le {x}_{n+1}$ for all $n\in \mathbb{N}$.

According to Matthews, a weakly order consistent topology over an ordered set $\left(X,\le \right)$ is a topology $\mathcal{T}$ over X such that $x\le y⇔x\in cl\left(y\right)$ for all $x,y\in X$, where by $cl\left(y\right)$ we denote the closure of $\left\{y\right\}$ with respect to $\mathcal{T}$. Furthermore, a Scott-like topology over an ordered set $\left(X,\le \right)$ is a weakly consistent topology $\mathcal{T}$ over X satisfying the following properties:
1. (1)

every increasing sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in $\left(X,\le \right)$ has least upper bound, where denotes the set of positive integer numbers;

2. (2)

for every $O\in \mathcal{T}$ containing the least upper bound of an increasing sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$, there exists ${n}_{0}\in \mathbb{N}$ such that ${x}_{n}\in O$ for all $n>{n}_{0}$.

In the aforesaid reference , Matthews introduced also the notion of a partial metric. In order to recall this new concept, let us denote by ${\mathbb{R}}^{+}$ the set of nonnegative real numbers.

Following , a partial metric on a nonempty set X is a function $p:X×X\to {\mathbb{R}}^{+}$ such that for all $x,y,z\in X$:
1. (i)

$p\left(x,x\right)=p\left(x,y\right)=p\left(y,y\right)⇔x=y$;

2. (ii)

$p\left(x,x\right)\le p\left(x,y\right)$;

3. (iii)

$p\left(x,y\right)=p\left(y,x\right)$;

4. (iv)

$p\left(x,y\right)\le p\left(x,z\right)+p\left(z,y\right)-p\left(z,z\right)$.

Of course a partial metric space is a pair $\left(X,p\right)$ such that X is a nonempty set and p is a partial metric on X.

The concept of a partial metric, since its introduction by Matthews, has been widely accepted in computer science (see, for instance, ). This is due to the fact that partial metric spaces can be used as a mathematical tool to model computational processes in the spirit of Scott. Indeed, each partial metric p on X generates a ${T}_{0}$ topology $\mathcal{T}\left(p\right)$ on X which has as a base the family of open p-balls $\left\{{B}_{p}\left(x,\epsilon \right):x\in X,\epsilon >0\right\}$, where ${B}_{p}\left(x,\epsilon \right)=\left\{y\in X:p\left(x,y\right) for all $x\in X$ and $\epsilon >0$. Moreover, every partial metric p induces an order ${\le }_{p}$ on X as follows: $x{\le }_{p}y⇔p\left(x,y\right)=p\left(x,x\right)$.

The next result reveals the reason for which the partial metric spaces can be used as a suitable mathematical tool to describe Scott processes (see  for a deeper discussion).

Proposition 1 Let $\left(X,p\right)$ be a complete partial metric space. Then the partial metric topology $\mathcal{T}\left(p\right)$ is a Scott-like topology over $\left(X,{\le }_{p}\right)$, and thus every increasing sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in $\left(X,{\le }_{p}\right)$ has least upper bound and converges to it with respect to $\mathcal{T}\left(p\right)$.

Remark 2 Note that the fact that the sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ is ascending with least upper bound x provides that ${x}_{n}{\le }_{p}x$ for all $n\in \mathbb{N}$ and, thus, that $p\left({x}_{n},x\right)-p\left({x}_{n},{x}_{n}\right)=0$. So, in the preceding proposition, we actually have the convergence of ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ to x is with respect to $\mathcal{T}\left({p}^{s}\right)$.

Inspired by the applications to program verification, Matthews extended Banach’s fixed point theorem to the framework of partial metric spaces in , and he used it to formulate a suitable test for lazy data flow deadlock in Kahn’s model of parallel computation in . The aforementioned extension of Banach’s fixed point theorem can be stated as follows.

Theorem 3 Let f be a mapping of a complete partial metric space $\left(X,p\right)$ into itself such that there is $s\in \left[0,1\left[$ such that
$p\left(f\left(x\right),f\left(y\right)\right)\le sp\left(x,y\right)$

for all $x,y\in X$. Then f has a unique fixed point. Moreover, if ${x}^{\ast }\in X$ is the fixed point of f, then $p\left({x}^{\ast },{x}^{\ast }\right)=0$.

According to , a sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in a partial metric space $\left(X,p\right)$ converges to a point $x\in X$ with respect to $\mathcal{T}\left(p\right)⇔p\left(x,x\right)={lim}_{n\to \mathrm{\infty }}p\left(x,{x}_{n}\right)$. Moreover, a sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in a partial metric space $\left(X,p\right)$ is called a Cauchy sequence if ${lim}_{n,m\to \mathrm{\infty }}p\left({x}_{n},{x}_{m}\right)$ exists and is finite. Furthermore, a partial metric space $\left(X,p\right)$ is said to be complete if every Cauchy sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in X converges, with respect to $\mathcal{T}\left(p\right)$, to a point $x\in X$ such that $p\left(x,x\right)={lim}_{n,m\to \mathrm{\infty }}p\left({x}_{n},{x}_{m}\right)$.

According to , every partial metric induces in a natural way a metric. Indeed, given a partial metric space $\left(X,p\right)$, then the function ${p}^{s}:X×X\to {\mathbb{R}}^{+}$ defined by
${p}^{s}\left(x,y\right)=2p\left(x,y\right)-p\left(x,x\right)-p\left(y,y\right)$

for all $x,y\in X$ is a metric on X. Moreover, a sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ in $\left(X,p\right)$ converges to $x\in X$ with respect to $\mathcal{T}\left({p}^{s}\right)$ if and only if ${lim}_{n\to \mathrm{\infty }}p\left(x,{x}_{n}\right)={lim}_{n\to \mathrm{\infty }}p\left({x}_{n},{x}_{n}\right)=p\left(x,x\right)$. Furthermore, a sequence in $\left(X,p\right)$ is Cauchy if and only if it is Cauchy in the metric space $\left(X,{p}^{s}\right)$, and $\left(X,p\right)$ is complete if and only if $\left(X,{p}^{s}\right)$ is complete.

Since Matthews published Theorem 3, an intense research activity on fixed point results in partial metric spaces have been developed. A large number of fixed point results in the metric framework have been extended to the partial metric context in [13, 1641].

In the light of the facts that, on the one hand, partial metric spaces are a useful tool for solving practical problems that arise in several fields of computer science and, on the other hand, the scientific community has a growing interest in partial metric fixed point theory, in this paper our goal is to show that partial metric spaces can be used satisfactorily for the asymptotic complexity analysis of algorithms by means of fixed point techniques. To this end, we discuss whether Theorem 3 can be used for such a purpose. However, we show that, in principle, this question has a negative answer and, for this reason, we delve into the study of fixed point techniques in asymptotic complexity analysis of algorithms. Thus, we present a mathematical technique for discussing the complexity of algorithms whose foundation lies in the use of two new fixed point results that we provide for partial metric spaces. In order to show the potential applicability of the developed theory and to validate our new fixed point technique, we apply it to analyze formally the asymptotic complexity of two celebrated recursive algorithms, namely, Quicksort and Hanoi.

The remainder of the paper is organized as follows. In Section 2 we prove the announced fixed point theorems for self-mappings defined on complete partial metric spaces. Moreover, in the same section, we provide examples that show that the hypothesis in the statements of our results cannot be weakened. Section 3 is devoted to introducing the reader to fixed point techniques for asymptotic complexity analysis of algorithms. Concretely, general and fundamental aspects of asymptotic complexity analysis are recalled and, in addition, the reference fixed point technique to carry out the complexity analysis of algorithms, due to Schellekens and in which our study is based, is presented in detail in order to motivate our subsequent work developed in Section 4. In the latter section, we discuss the feasibility of using the Matthews fixed point theorem as a mathematical tool for the asymptotic complexity analysis of algorithms and, in particular, we show that the aforesaid result is not, in principle, appropriate for such a purpose. Accordingly, in the same section, we introduce a new mathematical technique for the asymptotic complexity analysis of algorithms whose basis is provided by the fixed point results proved in Section 2. We end the section, and thus the paper, applying the developed fixed point method to analyze the asymptotic complexity of the aforesaid recursive algorithms.

## 2 The fixed point theorems

In this section we present our main results which will play a central role in the application to asymptotic complexity analysis developed in Section 4.1. To this end, let us recall that a mapping f from an ordered set $\left(X,\le \right)$ into itself is monotone if $f\left(x\right)\le f\left(y\right)$ whenever $x\le y$. Moreover, according to , a mapping from an ordered set $\left(X,\le \right)$ into itself is said to be ≤-continuous provided that the least upper bound of ${\left(f\left({x}_{n}\right)\right)}_{n\in \mathbb{N}}$ is $f\left({x}^{\ast }\right)$ for every increasing sequence ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ whose least upper bound exists and is ${x}^{\ast }$. Of course every ≤-continuous mapping is monotone.

Theorem 4 Let $\left(X,p\right)$ be a complete partial metric space and let $f:X\to X$ be a ${\le }_{p}$-continuous mapping. If there exists ${x}_{0}\in X$ such that ${x}_{0}{\le }_{p}f\left({x}_{0}\right)$, then f has a fixed point in $↑{x}_{0}=\left\{x\in X:{x}_{0}{\le }_{p}x\right\}$.

Proof Let ${x}_{0}\in X$ such that ${x}_{0}{\le }_{p}f\left({x}_{0}\right)$. Since f is monotone, we have that
${x}_{0}{\le }_{p}f\left({x}_{0}\right){\le }_{p}{f}^{2}\left({x}_{0}\right){\le }_{p}\cdots {\le }_{p}{f}^{n}\left({x}_{0}\right){\le }_{p}{f}^{n+1}\left({x}_{0}\right){\le }_{p}\cdots .$

Observe that we can assume, without loss of generality, that ${x}_{0}\ne f\left({x}_{0}\right)$ since otherwise we have guaranteed the existence of the fixed point in $↑{x}_{0}$.

Since the sequence ${\left({f}^{n}\left({x}_{0}\right)\right)}_{n\in \mathbb{N}}$ is increasing in $\left(X,{\le }_{p}\right)$, we have, by Proposition 1 and Remark 2, that there exists ${x}^{\ast }\in X$ such that ${x}^{\ast }$ is the least upper bound of ${\left({f}^{n}\left({x}_{0}\right)\right)}_{n\in \mathbb{N}}$ and, in addition, that ${lim}_{n\to \mathrm{\infty }}{f}^{n}\left({x}_{0}\right)={x}^{\ast }$ with respect to $\mathcal{T}\left({p}^{s}\right)$. Since f is ${\le }_{p}$-continuous, we have that $f\left({x}^{\ast }\right)$ is the least upper bound of ${\left({f}^{n}\left({x}_{0}\right)\right)}_{n\in \mathbb{N}}$. Whence we immediately obtain that $f\left({x}^{\ast }\right)={x}^{\ast }$ and that ${x}^{\ast }\in ↑{x}_{0}$. □

Remark 5 Observe that the proof of Theorem 4 follows applying similar arguments to those given in the proof of Kleen’s theorem or Tarski-Kantorovitch’s theorem for mappings defined from ω-chain-complete ordered sets into itself (see [42, 43] for more details). However, we have included a detailed proof of the aforementioned result for the sake of completeness and in order to help the reader.

The next example shows that the ${\le }_{p}$-continuity of the mapping cannot be deleted in the statement of Theorem 4.

Example 6 Let p be the partial metric space on $\left(0,\mathrm{\infty }\right]$ given by
${p}_{\mathrm{\infty }}\left(x,y\right)=max\left\{\frac{1}{x},\frac{1}{y}\right\}$

for all $x,y\in \left(0,\mathrm{\infty }\right]$, where we adopt the convention that $\frac{1}{\mathrm{\infty }}=0$. It is not hard to check that the partial metric space $\left(\left(0,\mathrm{\infty }\right],{p}_{\mathrm{\infty }}\right)$ is complete and that $x{\le }_{{p}_{\mathrm{\infty }}}y⇔x{\le }_{\mathrm{\infty }}y$, where ${\le }_{\mathrm{\infty }}$ stands for the usual order on the extended real line. Consider the subset $X=\left\{1,2\right\}$ of $\left(0,\mathrm{\infty }\right]$. Then the partial metric space $\left(X,{p}_{\mathrm{\infty }}\right)$ is also complete. Now, define the mapping $f:X\to X$ by $f\left(1\right)=2$ and $f\left(2\right)=1$. Clearly, $1{\le }_{{p}_{\mathrm{\infty }}}=f\left(1\right)=2$. Observe that f is not ${\le }_{p}$-continuous because f is not monotone. In fact, $1{\le }_{{p}_{\mathrm{\infty }}}2$ and $2=f\left(1\right){\nleqq }_{{p}_{\mathrm{\infty }}}f\left(2\right)=1$. It is clear that f has no fixed points.

Let us recall that, given a partial metric $\left(X,p\right)$, a mapping $f:X\to X$ is continuous provided that f is continuous from $\left(X,\mathcal{T}\left(p\right)\right)$ into itself.

Remark 7 Note that every monotone and continuous mapping f from a complete partial metric space into itself is ${\le }_{p}$-continuous. Indeed, assume that ${\left(\left({x}_{n}\right)\right)}_{n\in \mathbb{N}}$ is an increasing sequence in $\left(X,{\le }_{p}\right)$. Since $\left(X,p\right)$ is complete, we have guaranteed, by Proposition 1 and Remark 2, that there exists ${x}^{\ast }\in X$ such that ${x}^{\ast }$ is the least upper bound of ${\left({x}_{n}\right)}_{n\in \mathbb{N}}$ and, in addition, that ${lim}_{n\to \mathrm{\infty }}{x}_{n}={x}^{\ast }$ with respect to $\mathcal{T}\left({p}^{s}\right)$. Since f is continuous, we have that ${lim}_{n\to \mathrm{\infty }}f\left({x}_{n}\right)=f\left({x}^{\ast }\right)$ with respect to $\mathcal{T}\left(p\right)$. The monotonicity of f provides that $f\left({x}_{n}\right){\le }_{p}f\left({x}^{\ast }\right)$ and, thus, that $p\left(f\left(x\right),f\left({x}_{n}\right)\right)-p\left(f\left({x}_{n}\right),f\left({x}_{n}\right)\right)=0$. Whence we deduce that ${lim}_{n\to \mathrm{\infty }}f\left({x}_{n}\right)=f\left({x}^{\ast }\right)$ with respect to $\mathcal{T}\left({p}^{s}\right)$. Moreover, since the sequence ${\left(f\left({x}_{n}\right)\right)}_{n\in \mathbb{N}}$ is increasing and the partial metric space $\left(X,p\right)$ is complete, we have guaranteed the existence of the least upper bound of ${\left(f\left({x}_{n}\right)\right)}_{n\in \mathbb{N}}$, say ${y}^{\ast }\in X$, in such a way that ${lim}_{n\to \mathrm{\infty }}f\left({x}_{n}\right)={y}^{\ast }$ with respect to $\mathcal{T}\left({p}^{s}\right)$. Therefore $f\left({x}^{\ast }\right)={y}^{\ast }$, as claimed.

In the light of Theorem 4 and Remark 7, we immediately obtain the following result.

Corollary 8 Let $\left(X,p\right)$ be a complete partial metric space and let $f:X\to X$ be a monotone and continuous mapping. If there exists ${x}_{0}\in X$ such that ${x}_{0}{\le }_{p}f\left({x}_{0}\right)$, then f has a fixed point in $↑{x}_{0}=\left\{x\in X:{x}_{0}{\le }_{p}x\right\}$.

In the following, given a partial metric space $\left(X,p\right)$, we will say that a mapping $f:X\to X$ is ${p}^{s}$-continuous provided that f is continuous from $\left(X,\mathcal{T}\left({p}^{s}\right)\right)$ into itself. In our subsequent result, the ${p}^{s}$-continuity plays a central role.

Theorem 9 Let $\left(X,p\right)$ be a complete partial metric space and let $f:X\to X$ be a monotone and ${p}^{s}$-continuous mapping. If there exists ${x}_{0}\in X$ such that $f\left({x}_{0}\right){\le }_{p}{x}_{0}$, then f has a fixed point in $↓{x}_{0}=\left\{x\in X:x{\le }_{p}{x}_{0}\right\}$.

Proof Let ${x}_{0}\in X$ such that $f\left({x}_{0}\right){\le }_{p}{x}_{0}$. We assume, without loss of generality, that ${x}_{0}\ne f\left({x}_{0}\right)$ since otherwise we have guaranteed the existence of the fixed point in $↓{x}_{0}$.

Since f is monotone, we have that
${x}_{0}{\ge }_{p}f\left({x}_{0}\right){\ge }_{p}{f}^{2}\left({x}_{0}\right){\ge }_{p}\cdots {\ge }_{p}{f}^{n}\left({x}_{0}\right){\ge }_{p}{f}^{n+1}\left({x}_{0}\right){\ge }_{p}\cdots .$
It follows that
$p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)\le p\left({f}^{n}\left({x}_{0}\right),{f}^{n+1}\left({x}_{0}\right)\right)=p\left({f}^{n+1}\left({x}_{0}\right),{f}^{n+1}\left({x}_{0}\right)\right)$

for all $n\in \mathbb{N}$. Thus the sequence ${\left(p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)\right)}_{n\in \mathbb{N}}$ is decreasing in ${\mathbb{R}}^{+}$. So, there exists $r\in {\mathbb{R}}^{+}$ such that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)=r$. Then ${lim}_{m,n\to \mathrm{\infty }}p\left({f}^{m}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)=r$, since $p\left({f}^{m}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)=p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)$ for all $m,n\in \mathbb{N}$ with $n\ge m$. It follows that the sequence ${\left({f}^{n}\left({x}_{0}\right)\right)}_{n\in \mathbb{N}}$ is Cauchy. The fact that $\left(X,p\right)$ is complete yields the existence of ${x}^{\ast }\in X$ such that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)={lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{x}^{\ast }\right)=p\left({x}^{\ast },{x}^{\ast }\right)$.

Next we show that ${x}^{\ast }\in ↓{x}_{0}$. It is clear that
$\begin{array}{c}p\left({x}^{\ast },{x}_{0}\right)-p\left({x}^{\ast },{x}^{\ast }\right)\hfill \\ \phantom{\rule{1em}{0ex}}\le p\left({x}^{\ast },{f}^{n}\left({x}_{0}\right)\right)+p\left({f}^{n}\left({x}_{0}\right),{x}_{0}\right)-p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)-p\left({x}^{\ast },{x}^{\ast }\right)\hfill \\ \phantom{\rule{1em}{0ex}}=p\left({x}^{\ast },{f}^{n}\left({x}_{0}\right)\right)-p\left({x}^{\ast },{x}^{\ast }\right)\hfill \end{array}$

since $p\left({f}^{n}\left({x}_{0}\right),{x}_{0}\right)=p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)$ for all $n\in \mathbb{N}$. By the fact that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{x}^{\ast }\right)=p\left({x}^{\ast },{x}^{\ast }\right)$, we conclude that $p\left({x}^{\ast },{x}_{0}\right)=p\left({x}^{\ast },{x}^{\ast }\right)$ and, thus, that ${x}^{\ast }{\le }_{p}{x}_{0}$.

Now we prove that ${x}^{\ast }$ is a fixed point of f. On the one hand, we have that
$\begin{array}{c}p\left({x}^{\ast },f\left({x}^{\ast }\right)\right)-p\left(f\left({x}^{\ast }\right),f\left({x}^{\ast }\right)\right)\hfill \\ \phantom{\rule{1em}{0ex}}\le p\left({x}^{\ast },{f}^{n}\left({x}_{0}\right)\right)+p\left({f}^{n}\left({x}_{0}\right),f\left({x}^{\ast }\right)\right)-p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)-p\left(f\left({x}^{\ast }\right),f\left({x}^{\ast }\right)\right)\hfill \end{array}$

for all $n\in \mathbb{N}$. On the other hand, we have that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)=p\left({f}^{n}\left({x}_{0}\right),{x}^{\ast }\right)$ and, by the ${p}^{s}$-continuity of f, that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),f\left({x}^{\ast }\right)\right)=p\left(f\left({x}^{\ast }\right),f\left({x}^{\ast }\right)\right)$. Thus, we deduce that $p\left({x}^{\ast },f\left({x}^{\ast }\right)\right)=p\left(f\left({x}^{\ast }\right),f\left({x}^{\ast }\right)\right)$. So, we obtain that $f\left({x}^{\ast }\right){\le }_{p}{x}^{\ast }$.

Moreover, we have that
$\begin{array}{c}p\left({x}^{\ast },f\left({x}^{\ast }\right)\right)-p\left({x}^{\ast },{x}^{\ast }\right)\hfill \\ \phantom{\rule{1em}{0ex}}\le p\left({x}^{\ast },{f}^{n}\left({x}_{0}\right)\right)+p\left({f}^{n}\left({x}_{0}\right),f\left({x}^{\ast }\right)\right)-p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)-p\left({x}^{\ast },{x}^{\ast }\right)\hfill \end{array}$

for all $n\in \mathbb{N}$. Again, we have that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{x}^{\ast }\right)=p\left({x}^{\ast },{x}^{\ast }\right)$ and, by the ${p}^{s}$-continuity of f, that ${lim}_{n\to \mathrm{\infty }}p\left({f}^{n}\left({x}_{0}\right),{f}^{n}\left({x}_{0}\right)\right)=p\left({f}^{n}\left({x}_{0}\right),f\left({x}^{\ast }\right)\right)$. Thus we deduce that $p\left({x}^{\ast },f\left({x}^{\ast }\right)\right)=p\left({x}^{\ast },{x}^{\ast }\right)$. Whence we obtain that ${x}^{\ast }{\le }_{p}f\left({x}^{\ast }\right)$.

We conclude from $f\left({x}^{\ast }\right){\le }_{p}{x}^{\ast }{\le }_{p}f\left({x}^{\ast }\right)$ that $f\left({x}^{\ast }\right)={x}^{\ast }$. □

The next examples show that the ${p}^{s}$-continuity and monotonicity of the mapping cannot be deleted in the statement of Theorem 9.

Example 10 Consider the partial metric $p:{\mathbb{R}}^{+}×{\mathbb{R}}^{+}\to {\mathbb{R}}^{+}$ given by $p\left(x,y\right)=max\left\{x,y\right\}$. It is clear that the partial metric space $\left({\mathbb{R}}^{+},p\right)$ is complete and ${p}^{s}\left(x,y\right)=|y-x|$ for all $x,y\in {\mathbb{R}}^{+}$. Moreover, we have that $x{\le }_{p}y⇔y\le x$, where ≤ stands for the usual order on ${\mathbb{R}}^{+}$. Define the mapping $f:{\mathbb{R}}^{+}\to {\mathbb{R}}^{+}$ by

for all $x\in {\mathbb{R}}^{+}$. Then we have that f is monotone and that $1=f\left(0\right){\le }_{p}0$. It is easy to check that f is not ${p}^{s}$-continuous. Moreover, it is clear that f has no fixed points.

Example 11 Let $X=\left\{0,1\right\}$. Consider the restriction of the partial metric p defined in Example 10 to the set X. Denote the aforesaid restriction by p again. Of course the partial metric space $\left(X,p\right)$ is complete. Now, define the mapping $f:X\to X$ by $f\left(0\right)=1$ and $f\left(1\right)=0$. It follows easily that f is ${p}^{s}$-continuous. Clearly, $1=f\left(0\right){\le }_{p}0$. Moreover, f is not monotone since $1{\le }_{p}0$ and $0=f\left(1\right){\nleqq }_{p}f\left(0\right)=1$. Furthermore, f has no fixed points.

## 3 Asymptotic complexity analysis of algorithms

### 3.1 Preliminaries

In computer science, the complexity analysis of an algorithm is based on determining mathematically the quantity of resources needed by the algorithm to solve the problem for which it has been designed. A typical resource, playing a central role in complexity analysis, is the execution time or running time of computing. Since there are often many algorithms to solve the same problem, one objective of the complexity analysis is to assess which of them is faster when large inputs are considered. To this end, it is necessary to compare their running time of computing. This is usually done by means of the asymptotic analysis in which the running time of an algorithm is denoted by a function $T:\mathbb{N}\to \left(0,\mathrm{\infty }\right]$ in such a way that $T\left(n\right)$ represents the time taken by the algorithm to solve the problem under consideration when the input of the algorithm is of size n. Let us denote by $\mathcal{RT}$ the set formed by all functions from into $\left(0,\mathrm{\infty }\right]$. Of course the running time of an algorithm does not only depend on the input size n, but it depends also on the particular input of the size n (and the distribution of the data). Thus the running time of an algorithm is different when the algorithm processes certain instances of input data of the same size n. As a consequence, for the purpose of size-based comparisons, it is necessary to distinguish three possible behaviors in the complexity analysis of algorithms. These are the so-called best case, the worst case and the average case. The best case and the worst case for an input of size n are defined by the minimum and the maximum running time of computing over all inputs of the size n, respectively. The average case for an input of size n is defined by the expected value or average over all inputs of size n.

In general, to determine exactly the function which describes the running time of computing of an algorithm is an arduous task. However, in most situations it is useful to know the running time of computing of an algorithm in an ‘approximate’ way rather than in an exact one. For this reason, the asymptotic complexity analysis of algorithms is focused on obtaining the ‘approximate’ running time of computing of an algorithm, and this is done by means of the Θ-notation. Let us recall how the Θ-notation allows to achieve such a goal.

Let $f\in \mathcal{RT}$ denote the running time of computing of an algorithm, then the statement $f\in \mathcal{O}\left(g\right)$, where $g\in \mathcal{RT}$, means that there exist ${n}_{0}\in \mathbb{N}$ and $c\in {\mathbb{R}}^{+}$ such that $f\left(n\right){\le }_{\mathrm{\infty }}cg\left(n\right)$ for all $n\in \mathbb{N}$ such that ${n}_{0}\le n$ (${\le }_{\mathrm{\infty }}$ stands for the usual order on the extended real line). So, the function g gives an asymptotic upper bound of the running time f and, thus, an ‘approximate’ information of the running time of the algorithm. Following the standard notation, when g is an asymptotic upper bound of f, we write $f\in \mathcal{O}\left(g\right)$.

Sometimes in the analysis of the complexity of an algorithm, it is useful to assess an asymptotic lower bound of the running time of computing. In this case, the Ω-notation plays a central role. Thus the statement $f\in \mathrm{\Omega }\left(g\right)$ means that there exist ${n}_{0}\in \mathbb{N}$ and $c>0$ such that $cg\left(n\right){\le }_{\mathrm{\infty }}f\left(n\right)$ for all $n\in \mathbb{N}$ with ${n}_{0}\le n$. Of course, and similarly to the $\mathcal{O}$-notation case, when the time taken by the algorithm to solve the problem f is unknown, the function g yields an ‘approximate’ information of the running time of the algorithm in the sense that the algorithm takes a time to solve the problem bounded below by g.

It is clear that the best situation, when the complexity of an algorithm is discussed, matches up with the case in which we can find a function $g\in \mathcal{RT}$ in such a way that the running time f satisfies the condition $f\in \mathcal{O}\left(g\right)\cap \mathrm{\Omega }\left(g\right)$, denoted by $f\in \mathrm{\Theta }\left(g\right)$, because, in this case, we obtain a ‘tight’ asymptotic bound of f and, thus, a total asymptotic information about the time taken by the algorithm to solve the problem under consideration. From now on, we will say that f belongs to the asymptotic complexity class of g whenever $f\in \mathrm{\Theta }\left(g\right)$.

In the light of the preceding discussion, to determine, from an asymptotic complexity analysis viewpoint, the running time of an algorithm consists of obtaining its asymptotic complexity class.

For a fuller treatment of asymptotic complexity analysis of algorithms, we refer the reader to [44, 45].

### 3.2 The complexity space approach

In 1995, Schellekens introduced a topological foundation for the asymptotic complexity analysis of algorithms . The aforementioned foundation is based on the notions of quasi-metric and complexity space.

Let us recall that, following , a quasi-metric on a nonempty set X is a function $d:X×X\to {\mathbb{R}}^{+}$ such that for all $x,y,z\in X$:
1. (i)

$d\left(x,y\right)=d\left(y,x\right)=0⇔x=y$;

2. (ii)

$d\left(x,y\right)\le d\left(x,z\right)+d\left(z,y\right)$.

A quasi-metric space is a pair $\left(X,d\right)$ such that X is a nonempty set and d is a quasi-metric on X.

Each quasi-metric d on X generates a ${T}_{0}$-topology $\mathcal{T}\left(d\right)$ on X which has as a base the family of open d-balls $\left\{{B}_{d}\left(x,\epsilon \right):x\in X,\epsilon >0\right\}$, where ${B}_{d}\left(x,\epsilon \right)=\left\{y\in X:d\left(x,y\right)<\epsilon \right\}$ for all $x\in X$ and $\epsilon >0$.

Given a quasi-metric d on X, the function ${d}^{s}:X×X\to {\mathbb{R}}^{+}$ defined by ${d}^{s}\left(x,y\right)=max\left\{d\left(x,y\right),d\left(y,x\right)\right\}$ is a metric.

A quasi-metric space $\left(X,d\right)$ is called bicomplete if the metric space $\left(X,{d}^{s}\right)$ is complete.

Let us recall that the complexity space is the pair $\left(\mathcal{C},{d}_{\mathcal{C}}\right)$, where
$\mathcal{C}=\left\{f\in \mathcal{RT}:\sum _{n=1}^{\mathrm{\infty }}{2}^{-n}\frac{1}{f\left(n\right)}<\mathrm{\infty }\right\}$
and ${d}_{\mathcal{C}}$ is the bicomplete quasi-metric on $\mathcal{C}$ defined by
${d}_{\mathcal{C}}\left(f,g\right)=\sum _{n=1}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{g\left(n\right)}-\frac{1}{f\left(n\right)},0\right\}.$

Obviously, we adopt the convention that $\frac{1}{\mathrm{\infty }}=0$.

According to , from a complexity analysis point of view, it is possible to associate a function of $\mathcal{C}$ with each algorithm in such a way that such a function represents, as a function of the size of the input data, the running time of computing of the algorithm. Because of this, the elements of $\mathcal{C}$ are called complexity functions. Moreover, given two functions $f,g\in \mathcal{C}$, the numerical value ${d}_{\mathcal{C}}\left(f,g\right)$ (the complexity distance from f to g) can be interpreted as the relative progress made in lowering the complexity by replacing any program P with a complexity function f by any program Q with a complexity function g. Therefore, if $f\ne g$, the condition ${d}_{\mathcal{C}}\left(f,g\right)=0$ can be read as f is ‘at least as efficient’ as g on all inputs. In fact, we have that ${d}_{\mathcal{C}}\left(f,g\right)=0⇔f\left(n\right){\le }_{\mathrm{\infty }}g\left(n\right)$ for all $n\in \mathbb{N}$ and, thus, the fact that ${d}_{\mathcal{C}}\left(f,g\right)=0$ (${d}_{\mathcal{C}}\left(g,f\right)=0$) implies that $f\in \mathcal{O}\left(g\right)$ ($f\in \mathrm{\Omega }\left(g\right)$).

The applicability of the complexity space to the asymptotic complexity analysis of algorithms was illustrated by Schellekens in .

In particular, he introduced a method, based on a fixed point theorem for functionals defined on the complexity space into itself, to provide the asymptotic upper bound of those algorithms whose running time of computing satisfies a recurrence equation of Divide and Conquer type. Let us recall the aforenamed method.

A Divide and Conquer algorithm solves a problem of size n ($n\in \mathbb{N}$) splitting it into a subproblems of size $\frac{n}{b}$, for some constants a, b with $a,b\in \mathbb{N}$ and $a,b>1$, and solving them separately by the same algorithm. After obtaining the solution of the subproblems, the algorithm combines all subproblem solutions to give a global solution to the original problem. The recursive structure of a Divide and Conquer algorithm leads to a recurrence equation for the running time of computing. In many cases the running time of a Divide and Conquer algorithm is the solution to the Divide and Conquer recurrence equation of the form
(1)

where ${\mathbb{N}}_{b}=\left\{{b}^{k}:k\in \mathbb{N}\right\}$, $c>0$ denotes the complexity on the base case (i.e., the problem size is small enough and the solution takes constant time), and $h\left(n\right)$ represents the time taken by the algorithm in order to divide the original problem into a subproblems and to combine all subproblems solutions into a unique one ($h\in \mathcal{C}$ and $h\left(n\right){<}_{\mathrm{\infty }}\mathrm{\infty }$ for all $n\in \mathbb{N}$).

Notice that for Divide and Conquer algorithms with running time satisfying the recurrence equation (1), it is typically sufficient to obtain the complexity on inputs of size n, where n ranges over the set ${\mathbb{N}}_{b}$ [45, 46].

Typical examples of algorithms whose running time of computing can be obtained by means of the recurrence (1) are Quicksort (best case behavior) and Mergesort (all behaviors) (see  for a detailed discussion about the both aforesaid algorithms).

The method introduced by Schellekens allows to show that the Divide and Conquer recurrence equation (1) has a unique solution and, in addition, to provide an upper asymptotic complexity bound of such a solution. To this end, denote by ${\mathcal{C}}_{b,c}$ the subset of $\mathcal{C}$ given by

and by ${d}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}$ the restriction of ${d}_{\mathcal{C}}$ to ${\mathcal{C}}_{b,c}$.

We have that the quasi-metric space $\left({\mathcal{C}}_{b,c},{d}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\right)$ is bicomplete since the quasi-metric space $\left(\mathcal{C},{d}_{\mathcal{C}}\right)$ is bicomplete  and the set ${\mathcal{C}}_{b,c}$ is closed in $\left(\mathcal{C},{d}_{\mathcal{C}}^{s}\right)$.

Next we associate a functional ${\mathrm{\Phi }}_{T}:{\mathcal{C}}_{b,c}\to {\mathcal{C}}_{b,c}$ with the recurrence equation (1) defined as follows:
(2)
Of course a complexity function in ${\mathcal{C}}_{b,c}$ is a solution to the recurrence equation (1) if and only if it is a fixed point of the functional ${\mathrm{\Phi }}_{T}$. It was proved in  that
${d}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left({\mathrm{\Phi }}_{T}\left(f\right),{\mathrm{\Phi }}_{T}\left(g\right)\right)\le \frac{1}{a}{d}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left(f,g\right)$
(3)

for all $f,g\in {\mathcal{C}}_{b,c}$. So, by Banach’s fixed point theorem for metric spaces, we deduce that the functional ${\mathrm{\Phi }}_{T}:{\mathcal{C}}_{b,c}\to {\mathcal{C}}_{b,c}$ has a unique fixed point and, thus, the recurrence equation (1) has a unique solution.

In order to obtain the asymptotic upper bound of the solution to the recurrence equation (1), Schellekens introduced a special class of functionals known as improvers.

Let $C\subseteq \mathcal{C}$, a functional $\mathrm{\Phi }:C\to C$ is called an improver with respect to a function $f\in C$ provided that Φ is monotone and that $\mathrm{\Phi }\left(f\right)\left(n\right){\le }_{\mathrm{\infty }}f\left(n\right)$ for all $n\in \mathbb{N}$.

Taking into account the exposed facts, the following result was stated in .

Theorem 12 The Divide and Conquer recurrence equation (1) has a unique solution ${f}_{T}$ in ${\mathcal{C}}_{b,c}$. Moreover, if the monotone functional ${\mathrm{\Phi }}_{T}$ associated to (1), and given by (2), is an improver with respect to some function $g\in {\mathcal{C}}_{b,c}$, then the solution to the recurrence equation satisfies that ${f}_{T}\in \mathcal{O}\left(g\right)$.

In  Schellekens discussed the complexity class of Mergesort in order to illustrate the utility of Theorem 12. The Mergesort running time of computing (average case behavior) satisfies the following particular case of the recurrence equation (1):
(4)
Of course Theorem 12 provides that the recurrence equation (4) has a unique solution ${f}_{T}^{M}\in {\mathcal{C}}_{2,c}$. In addition, it is not hard to check that the functional ${\mathrm{\Phi }}_{T}$ given by (2) and induced by the recurrence equation (4) is an improver with respect to the complexity function ${g}_{k}\in {\mathcal{C}}_{2,c}$, with $k>0$, if and only if $k\ge \frac{1}{2}$, where

Therefore, by Theorem 12, we conclude that ${f}_{T}^{M}\in \mathcal{O}\left({g}_{\frac{1}{2}}\right)$. Hence the complexity function ${g}_{\frac{1}{2}}$, or equivalently $\mathcal{O}\left(n{log}_{2}\left(n\right)\right)$, gives an asymptotic upper bound of the running time of computing of the aforenamed algorithm.

Furthermore, it must be stressed that Schellekens provided the asymptotic lower bound, and thus the asymptotic complexity class, of the running time of Mergesort (average case behavior) in . Concretely, it was obtained that such a running time of computing belongs to $\mathrm{\Omega }\left(n{log}_{2}\left(n\right)\right)$. Nevertheless, the asymptotic lower bound was obtained applying standard arguments that are not based on the use of fixed point techniques. So, Schellekens proved that Mergesort running time (average case behavior) belongs to the asymptotic complexity class $\mathrm{\Theta }\left(n{log}_{2}\left(n\right)\right)$, but the fixed point technique was used only to provide the asymptotic upper bound.

## 4 Asymptotic complexity analysis of algorithms and partial metric spaces

Motivated by the usefulness of partial metric spaces in program verification, we wonder if this kind of generalized metric spaces are also useful in asymptotic complexity analysis in the spirit of Schellekens. Of course it seems natural to attempt to apply Theorem 3 (in Section 1) in order to obtain a fixed point technique for asymptotic complexity analysis of algorithms based on the use of partial metric spaces. However, the following reasoning shows that the aforementioned result cannot be applied for this purpose. To this end, let us recall some additional and useful concepts about partial metrics and complexity spaces.

Following  the set $\mathcal{C}$ can be endowed with a partial metric ${p}_{\mathcal{C}}$ defined for all $f,g\in \mathcal{C}$ by
${p}_{\mathcal{C}}\left(f,g\right)=\sum _{n=1}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{f\left(n\right)},\frac{1}{g\left(n\right)}\right\}.$

Obviously, we make again the assumption that $\frac{1}{\mathrm{\infty }}=0$.

Notice that although, in principle, several partial metrics could be defined on $\mathcal{C}$ with the aim of developing a mathematical foundation of asymptotic complexity analysis by means of partial metric spaces, it seems reasonable to consider ${p}_{\mathcal{C}}$ as a (partial metric) complexity distance because of the following reasons.

On the one hand, it allows to retrieve the Schellekens (quasi-metric) complexity distance ${d}_{\mathcal{C}}$. Indeed, the following correspondences between quasi-metric and partial metric spaces was stated in .

Proposition 13 If $\left(X,p\right)$ is a partial metric space, then the function ${d}_{p}:X×X\to {\mathbb{R}}^{+}$ defined by ${d}_{p}\left(x,y\right)=p\left(x,y\right)-p\left(x,x\right)$ is a quasi-metric such that $\mathcal{T}\left(p\right)=\mathcal{T}\left({d}_{p}\right)$.

In the light of Proposition 13, we have that the partial metric ${p}_{\mathcal{C}}$ induces the quasi-metric ${d}_{{p}_{\mathcal{C}}}$ on $\mathcal{C}$ given by
${d}_{{p}_{\mathcal{C}}}\left(f,g\right)={p}_{\mathcal{C}}\left(f,g\right)-{p}_{\mathcal{C}}\left(f,f\right)$
for all $f,g\in \mathcal{C}$. Moreover, it is not hard to see that
${p}_{\mathcal{C}}\left(f,g\right)-{p}_{\mathcal{C}}\left(f,f\right)={d}_{\mathcal{C}}\left(f,g\right),$

$f,g\in \mathcal{C}$ and, thus, that ${d}_{{p}_{\mathcal{C}}}\left(f,g\right)={d}_{\mathcal{C}}\left(f,g\right)$ for all $f,g\in \mathcal{C}$.

On the other hand, the order induced by the partial metric ${p}_{\mathcal{C}}$, ${\le }_{{p}_{\mathcal{C}}}$, is exactly the pointwise order relation defined on $\mathcal{C}$. Indeed, given $f,g\in \mathcal{C}$, we have that
$f{\le }_{{p}_{\mathcal{C}}}g\phantom{\rule{1em}{0ex}}⇔\phantom{\rule{1em}{0ex}}{p}_{\mathcal{C}}\left(f,g\right)={p}_{\mathcal{C}}\left(f,f\right)\phantom{\rule{1em}{0ex}}⇔\phantom{\rule{1em}{0ex}}f\left(n\right){\le }_{\mathrm{\infty }}g\left(n\right)$

for all $n\in \mathbb{N}$. Whence we obtain that $f{\le }_{{p}_{\mathcal{C}}}g$ implies that $f\in \mathcal{O}\left(g\right)$. Observe that the last implication recovers the information yielded by the condition ${d}_{\mathcal{C}}\left(f,g\right)=0$ in the Schellekens approach.

Furthermore, the completeness of the partial metric space $\left(\mathcal{C},{p}_{\mathcal{C}}\right)$ is guaranteed by the bicompleteness of the complexity space $\left(\mathcal{C},{d}_{\mathcal{C}}\right)$ and the following result which was proved in .

Proposition 14 If $\left(X,p\right)$ is a partial metric space, then the below assertions are equivalent:
1. (1)

$\left(X,p\right)$ is complete.

2. (2)

$\left(X,{d}_{p}\right)$ is bicomplete.

Since the partial metric space $\left(\mathcal{C},{p}_{\mathcal{C}}\right)$ is complete, so is the partial metric $\left({\mathcal{C}}_{b,c},{p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\right)$.

Now, for the purpose of applying Theorem 3 to discuss the complexity of Divide and Conquer algorithms whose running time of computing satisfy the Divide and Conquer recurrence equation (1), suppose that there exists $s\in \left[0,1\left[$ such that
${p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left({\mathrm{\Phi }}_{T}\left(f\right),{\mathrm{\Phi }}_{T}\left(g\right)\right)\le s{p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left(f,g\right)$

for all $f,g\in {\mathcal{C}}_{b,c}$, where ${\mathrm{\Phi }}_{T}$ is the functional given by (2).

Of course, we only consider the case of $s\in \phantom{\rule{0.2em}{0ex}}\right]0,1\left[$ because it is evident that the case $s=0$ gives a contradiction.

Take $f,g\in {\mathcal{C}}_{b,c}$ such that $f\left(n\right)=2c$ and $g\left(n\right)=2\left(c+1\right)$ for all $n\in {\mathbb{N}}_{b}$. It is clear that
${p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left({\mathrm{\Phi }}_{T}\left(f\right),{\mathrm{\Phi }}_{T}\left(g\right)\right)=\frac{1}{2c}+\sum _{n=2}^{\mathrm{\infty }}{2}^{-{b}^{n}}max\left\{\frac{1}{2ac+h\left({b}^{n}\right)},\frac{1}{2a\left(c+1\right)+h\left({b}^{n}\right)}\right\}.$
Moreover,
$\begin{array}{rcl}{p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left(f,g\right)& =& \frac{1}{2c}+\sum _{n=2}^{\mathrm{\infty }}{2}^{-{b}^{n}}max\left\{\frac{1}{f\left({b}^{n}\right)},\frac{1}{g\left({b}^{n}\right)}\right\}\le \sum _{n=1}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{2c},\frac{1}{2\left(c+1\right)}\right\}\\ =& \frac{1}{2c}.\end{array}$
Applying our hypothesis, we obtain that
$\frac{1}{2c}={p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left({\mathrm{\Phi }}_{T}\left(f\right),{\mathrm{\Phi }}_{T}\left(g\right)\right)\le s{p}_{\mathcal{C}}{|}_{{\mathcal{C}}_{b,c}}\left(f,g\right)=s\frac{1}{2c}.$

As a result we deduce that $1\le s<1$, which is a contradiction.

Consequently, when we consider the partial metric ${p}_{\mathcal{C}}$ as a complexity distance instead the original quasi-metric ${d}_{\mathcal{C}}$, Theorem 3 cannot be applied to the asymptotic complexity analysis of those algorithms whose running time of computing leads to the Divide and Conquer recurrence equation (1).

We want to point out that the above reasoning was first introduced in  in order to show the impossibility of using Theorem 3 to analyze the Divide and Conquer recurrence equations. As a consequence, in the aforesaid reference a fixed point technique, which differs from the technique that we will introduce in the remainder of this section, was introduced to discuss the complexity of algorithms via the use of partial quasi-metrics, and not partial metrics, and a few aspects of language theory.

### 4.1 The fixed point technique for asymptotic complexity analysis based on partial metric spaces

Inspired by the impossibility of developing a fixed point technique for the asymptotic complexity analysis of algorithms based on the use of Theorem 3, we present a new fixed point technique that respects the spirit of the original Schellekens technique and whose foundation lies in the use of Theorems 4 and 9 in Section 2.

In the complexity analysis of algorithms, Divide and Conquer algorithms belong to the wider class of recursive algorithms. In many cases the running time of imputing of the latter is the solution to the following recurrence equation:
(5)

where $c>0$, $a\ge 1$ and $h\in \mathcal{C}$ with $h\left(n\right){<}_{\mathrm{\infty }}\mathrm{\infty }$ for all $n\in \mathbb{N}$.

Observe that the discussion of the asymptotic complexity of the Divide and Conquer algorithms introduced in Section 3.2 can be carried out from the recurrence equation (5). In fact, as discussed in Section 3.2, the running time of computing of the aforesaid algorithms is the solution to the recurrence equation
Clearly, the preceding Divide and Conquer recurrence equation can be retrieved as a particular case of the recurrence equation (5). Indeed, the Divide and Conquer recurrence equation can be transformed into the following one:
(6)

where $S\left(m\right)=T\left({b}^{m-1}\right)$ and $r\left(m\right)=h\left({b}^{m-1}\right)$ for all $m\in \mathbb{N}$.

The remainder of this section is devoted to introducing, by means of the partial metric space $\left(\mathcal{C},{p}_{\mathcal{C}}\right)$, a new fixed point technique in the spirit of Schellekens for yielding the asymptotic complexity class of those recursive algorithms whose running time is the solution to the recurrence equation (5).

#### 4.1.1 The existence and uniqueness of solution

Consider the subset ${\mathcal{C}}_{c}$ of $\mathcal{C}$ given by
${\mathcal{C}}_{c}=\left\{f\in \mathcal{C}:f\left(1\right)=c\right\}.$
Define the functional ${\mathrm{\Psi }}_{T}:{\mathcal{C}}_{c}\to {\mathcal{C}}_{c}$ by
(7)

for all $f\in {\mathcal{C}}_{c}$. It is clear that a complexity function in ${\mathcal{C}}_{c}$ is a solution to the recurrence equation (5) if and only if it is a fixed point of the functional ${\mathrm{\Psi }}_{T}$.

In order prove the announced existence and uniqueness of solution to the recurrence equation (5), we will need the following auxiliary result.

Lemma 15 Let ${\mathrm{\Psi }}_{T}:{\mathcal{C}}_{c}\to {\mathcal{C}}_{c}$ be the functional given by (7) and let ${f}_{c,\mathrm{\infty }}\in {\mathcal{C}}_{c}$ be the complexity function given by
${f}_{c,\mathrm{\infty }}\left(n\right)=\left\{\begin{array}{cc}c\hfill & \mathit{\text{if}}n=1,\hfill \\ \mathrm{\infty }\hfill & \mathit{\text{if}}n\ge 2.\hfill \end{array}$
Then the following statements hold:
1. (1)

${\mathrm{\Psi }}_{T}$ is monotone.

2. (2)

${\mathrm{\Psi }}_{T}$ is continuous and ${p}^{s}$-continuous.

3. (3)

${\mathrm{\Psi }}_{T}\left({f}_{c,\mathrm{\infty }}\right){\le }_{{p}_{{\mathcal{C}}_{c}}}{f}_{c,\mathrm{\infty }}$.

Proof (1) Consider $f,g\in {\mathcal{C}}_{c}$ such that $f{\le }_{{p}_{{\mathcal{C}}_{c}}}g$. Then $f\left(n\right){\le }_{\mathrm{\infty }}g\left(n\right)$ for all $n\in \mathbb{N}$. Thus we have that ${\mathrm{\Psi }}_{T}\left(f\right)\left(1\right)={\mathrm{\Psi }}_{T}\left(g\right)\left(1\right)=c$ and
${\mathrm{\Psi }}_{T}\left(f\right)\left(n\right)=af\left(n-1\right)+h\left(n\right){\le }_{\mathrm{\infty }}ag\left(n-1\right)+h\left(n\right)={\mathrm{\Psi }}_{T}\left(g\right)\left(n\right)$

for all $n\in \mathbb{N}$ with $n\ge 2$. It follows that ${\mathrm{\Psi }}_{T}\left(f\right){\le }_{{p}_{{\mathcal{C}}_{c}}}{\mathrm{\Psi }}_{T}\left(g\right)$.

(2) First of all we prove that ${\mathrm{\Psi }}_{T}$ is continuous from $\left(X,\mathcal{T}\left(p\right)\right)$ into itself. Indeed, for the purpose of contradiction, assume that there exists a sequence ${\left({f}_{k}\right)}_{k\in \mathbb{N}}$ in ${\mathcal{C}}_{c}$ which converges to $f\in {\mathcal{C}}_{c}$ with respect to $\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}\right)$ and, in addition, the sequence ${\left({\mathrm{\Psi }}_{T}\left({f}_{k}\right)\right)}_{k\in \mathbb{N}}$ does not converge to ${\mathrm{\Psi }}_{T\left(f\right)}$ with respect to $\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}\right)$. Then we have that there exists $\epsilon >0$ such that for each $n\in \mathbb{N}$ there is $m\ge n$ with
$\epsilon \le {p}_{{\mathcal{C}}_{c}}\left({\mathrm{\Psi }}_{T}\left({f}_{m}\right),{\mathrm{\Psi }}_{T}\left(f\right)\right)-{p}_{{\mathcal{C}}_{c}}\left({\mathrm{\Psi }}_{T}\left(f\right),{\mathrm{\Psi }}_{T}\left(f\right)\right)$
and
${p}_{{\mathcal{C}}_{c}}\left(f,{f}_{m}\right)-{p}_{{\mathcal{C}}_{c}}\left(f,f\right)<\epsilon .$
Then we have that
$\begin{array}{rcl}\epsilon & \le & \sum _{n=2}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{a{f}_{m}\left(n-1\right)+h\left(n\right)},\frac{1}{af\left(n-1\right)+h\left(n\right)}\right\}-\sum _{n=2}^{\mathrm{\infty }}{2}^{-n}\frac{1}{af\left(n-1\right)+h\left(n\right)}\\ \le & \frac{1}{2a}\left(\sum _{n=1}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{{f}_{m}\left(n\right)},\frac{1}{f\left(n\right)}\right\}-\frac{1}{f\left(n\right)}\right)\\ =& \frac{1}{2a}\left({p}_{{\mathcal{C}}_{c}}\left(f,{f}_{m}\right)-{p}_{{\mathcal{C}}_{c}}\left(f,f\right)\right)<\epsilon ,\end{array}$

which is a contradiction. It follows that ${\mathrm{\Psi }}_{T}$ is continuous from $\left({\mathcal{C}}_{c},\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}\right)\right)$ into itself.

Next we prove that ${\mathrm{\Psi }}_{T}$ is continuous from $\left({\mathcal{C}}_{c},\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}^{s}\right)\right)$ into itself. To this end, we assume that there exists a sequence ${\left({f}_{k}\right)}_{k\in \mathbb{N}}$ in ${\mathcal{C}}_{c}$ which converges to $f\in {\mathcal{C}}_{c}$ with respect to $\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}^{s}\right)$ and, in addition, the sequence ${\left({\mathrm{\Psi }}_{T}\left({f}_{k}\right)\right)}_{k\in \mathbb{N}}$ does not converge to ${\mathrm{\Psi }}_{T}\left(f\right)$ with respect to $\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}^{s}\right)$. By the continuity of ${\mathrm{\Psi }}_{T}$, we deduce that necessarily there exists $\epsilon >0$ such that for each $n\in \mathbb{N}$ there is $m\ge n$ with
$\epsilon \le {p}_{{\mathcal{C}}_{c}}\left({\mathrm{\Psi }}_{T}\left({f}_{m}\right),{\mathrm{\Psi }}_{T}\left(f\right)\right)-{p}_{{\mathcal{C}}_{c}}\left({\mathrm{\Psi }}_{T}\left({f}_{m}\right),{\mathrm{\Psi }}_{T}\left({f}_{m}\right)\right)$
and
${p}_{{\mathcal{C}}_{c}}^{s}\left(f,{f}_{m}\right)<\epsilon .$
If follows that
$\begin{array}{rcl}\epsilon & \le & \sum _{n=2}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{a{f}_{m}\left(n-1\right)+h\left(n\right)},\frac{1}{af\left(n-1\right)+h\left(n\right)}\right\}-\sum _{n=2}^{\mathrm{\infty }}{2}^{-n}\frac{1}{a{f}_{m}\left(n-1\right)+h\left(n\right)}\\ \le & \frac{1}{2a}\left(\sum _{n=1}^{\mathrm{\infty }}{2}^{-n}max\left\{\frac{1}{{f}_{m}\left(n\right)},\frac{1}{f\left(n\right)}\right\}-\frac{1}{{f}_{m}\left(n\right)}\right)\\ =& \frac{1}{2a}\left({p}_{{\mathcal{C}}_{c}}\left(f,{f}_{m}\right)-{p}_{{\mathcal{C}}_{c}}\left({f}_{m},{f}_{m}\right)\right)\\ \le & \frac{1}{2a}{p}_{{\mathcal{C}}_{c}}^{s}\left(f,{f}_{m}\right)<\epsilon ,\end{array}$

which is a contradiction. Whence we conclude that ${\mathrm{\Psi }}_{T}$ is continuous from $\left({\mathcal{C}}_{c},\mathcal{T}\left({p}_{{\mathcal{C}}_{c}}^{s}\right)\right)$ into itself, i.e., ${\mathrm{\Psi }}_{T}$ is ${p}^{s}$-continuous.

(3) It is clear that ${\mathrm{\Psi }}_{T}\left({f}_{c,\mathrm{\infty }}\right)\left(1\right)=c={f}_{c,\mathrm{\infty }}\left(1\right)$. Moreover,
${\mathrm{\Psi }}_{T}\left({f}_{c,\mathrm{\infty }}\right)\left(2\right)=a{f}_{c,\mathrm{\infty }}\left(1\right)+h\left(2\right)=ac+h\left(2\right){\le }_{\mathrm{\infty }}{f}_{c,\mathrm{\infty }}\left(2\right)=\mathrm{\infty }.$
Finally,
${\mathrm{\Psi }}_{T}\left({f}_{c,\mathrm{\infty }}\right)\left(n\right)=\mathrm{\infty }={f}_{c,\mathrm{\infty }}\left(n\right)$

for all $n\in \mathbb{N}$ with $n>2$. Consequently, we obtain that ${\mathrm{\Psi }}_{T}\left({f}_{c,\mathrm{\infty }}\right)\left(n\right){\le }_{\mathrm{\infty }}{f}_{c,\mathrm{\infty }}\left(n\right)$ for all $n\in \mathbb{N}$. Therefore ${\mathrm{\Psi }}_{T}\left({f}_{c,\mathrm{\infty }}\right){\le }_{{p}_{{\mathcal{C}}_{c}}}{f}_{c,\mathrm{\infty }}$. □

Remark 16 It should be stressed that, given a partial metric space $\left(X,p\right)$, the continuous and ${p}^{s}$-continuous mappings $f:X\to X$ are called properly continuous in . So, the functional ${\mathrm{\Psi }}_{T}$, by assertion (2) in the statement of Lemma 15, is properly continuous.

According to , the quasi-metric space $\left({\mathcal{C}}_{c},{d}_{\mathcal{C}}{|}_{{\mathcal{C}}_{c}}\right)$ is bicomplete. Hence, by Proposition 14, we have that the partial metric space $\left({\mathcal{C}}_{c},{p}_{{\mathcal{C}}_{c}}\right)$ is complete.

Theorem 17 The recurrence equation (5) has a unique solution ${f}_{T}$ in ${\mathcal{C}}_{c}$.

Proof The completeness of $\left({\mathcal{C}}_{c},{p}_{{\mathcal{C}}_{c}}\right)$ and Lemma 15 provide the conditions in the statement of Theorem 9. So, we have that ${\mathrm{\Psi }}_{T}$ has a fixed point in $↓{f}_{c,\mathrm{\infty }}$. Since $↓{f}_{c,\mathrm{\infty }}\cap {\mathcal{C}}_{c}={\mathcal{C}}_{c}$, we obtain the existence of a fixed point of f in ${\mathcal{C}}_{c}$.

It remains to prove the uniqueness of the fixed point. To this end, assume that ${f}_{T},{g}_{T}\in {\mathcal{C}}_{c}$ are solutions to the recurrence equation (5). Next we will prove by induction over n that ${f}_{T}={g}_{T}$. Since ${f}_{T}$, ${g}_{T}$ are solutions to the recurrence equation (5), we have that they are fixed points of the functional ${\mathrm{\Psi }}_{T}$, i.e., ${\mathrm{\Psi }}_{T}\left({f}_{T}\right)={\mathrm{\Psi }}_{T}\left({g}_{T}\right)$. Hence we have that
${f}_{T}\left(1\right)={\mathrm{\Psi }}_{T}\left({f}_{T}\right)\left(1\right)=c={\mathrm{\Psi }}_{T}\left({g}_{T}\right)\left(1\right)={g}_{T}\left(1\right).$
Now assume that $\mathrm{\Psi }\left({f}_{T}\right)\left(n\right)=\mathrm{\Psi }\left({g}_{T}\right)\left(n\right)$ with $n>1$. Then
$\begin{array}{rcl}{f}_{T}\left(n+1\right)& =& {\mathrm{\Psi }}_{T}\left({f}_{T}\right)\left(n+1\right)=a{f}_{T}\left(n\right)+h\left(n+1\right)\\ =& a{g}_{T}\left(n\right)+h\left(n+1\right)={\mathrm{\Psi }}_{T}\left({g}_{T}\right)\left(n+1\right)={g}_{T}\left(n+1\right).\end{array}$

Consequently, ${f}_{T}={g}_{T}$ and, thus, ${\mathrm{\Psi }}_{T}$ has a unique fixed point in ${\mathcal{C}}_{c}$. Therefore the recurrence equation (5) has a unique solution in ${\mathcal{C}}_{c}$. □

#### 4.1.2 The asymptotic complexity class of the solution

In the next result, we obtain the announced method to provide the complexity class of an algorithm whose running time of computing satisfies the recurrence equation (5). To this end, let us recall that, given $C\subseteq \mathcal{C}$, a monotone functional $\mathrm{\Phi }:C\to C$ is called an improver with respect to a function $f\in C$ provided that $\mathrm{\Phi }\left(f\right){\le }_{{p}_{{\mathcal{C}}_{c}}}f$ (see Section 3.2). Furthermore, on account of , a monotone functional $\mathrm{\Phi }:C\to C$ is said to be a worsener with respect to a function $f\in C$ provided that $f{\le }_{{p}_{{\mathcal{C}}_{c}}}\mathrm{\Phi }\left(f\right)$.

Observe that the computational meaning of the improvers, as discussed in , can be interpreted as that this type of functionals correspond to a transformation on programs in such a way that the iterative applications of the transformation yield, from a complexity point of view, an improved program at each step of the iteration. Similarly, the worseners can be interpreted as those functionals which correspond to a transformation on programs in such a way that the iterative applications of the transformation yield a worsened, from a complexity point of view, program at each step of the iteration.

Theorem 18 Let ${f}_{T}\in {\mathcal{C}}_{c}$ be the unique solution to the recurrence equation (5). Then the following assertions hold:
1. (1)

If the functional ${\mathrm{\Psi }}_{T}$ associated to (5), and given by (7), is a worsener with respect to some complexity function $g\in {\mathcal{C}}_{c}$, then ${f}_{T}\in \mathrm{\Omega }\left(g\right)$.

2. (2)

If the functional ${\mathrm{\Psi }}_{T}$ associated to (5), and given by (7), is an improver with respect to some complexity function $g\in {\mathcal{C}}_{c}$, then ${f}_{T}\in \mathcal{O}\left(g\right)$.

Proof (1) Suppose that there exists $g\in {\mathcal{C}}_{c}$ such that ${\mathrm{\Psi }}_{T}\left(g\right){\le }_{{p}_{{\mathcal{C}}_{c}}}g$. Then, by Corollary 8, we deduce the existence of a fixed point ${g}_{T}$ of ${\mathrm{\Psi }}_{T}$ such that ${g}_{T}\in ↑g$, i.e., ${g}_{T}{\le }_{{p}_{{\mathcal{C}}_{c}}}g$ and, thus, ${g}_{T}\left(n\right){\le }_{\mathrm{\infty }}g\left(n\right)$ for all $n\in \mathbb{N}$. So, ${g}_{T}\in \mathrm{\Omega }\left(g\right)$. Since ${f}_{T}$ is the unique fixed point of ${\mathrm{\Psi }}_{T}$ in ${\mathcal{C}}_{c}$, we deduce that ${f}_{T}={g}_{T}$ and, hence, that ${f}_{T}\in \mathrm{\Omega }\left(g\right)$.

(2) Assume that there exists $g\in {\mathcal{C}}_{c}$ such that $g{\le }_{{p}_{{\mathcal{C}}_{c}}}{\mathrm{\Psi }}_{T}\left(g\right)$. Then Theorem 9 gives the existence of a fixed point ${g}_{T}$ of ${\mathrm{\Psi }}_{T}$ such that ${g}_{T}\in ↓g$, i.e., $g{\le }_{{p}_{{\mathcal{C}}_{c}}}{g}_{T}$ and hence $g\left(n\right){\le }_{\mathrm{\infty }}{g}_{T}\left(n\right)$ for all $n\in \mathbb{N}$. So, ${g}_{T}\in \mathcal{O}\left(g\right)$. The uniqueness of a fixed point of ${\mathrm{\Psi }}_{T}$ in ${\mathcal{C}}_{c}$ allows us to deduce that ${f}_{T}={g}_{T}$ and, thus, that ${f}_{T}\in \mathcal{O}\left(g\right)$. □

Remark 19 Notice that, indeed, Theorem 18 yields the complexity class of algorithms whose running time of computing satisfies the recurrence equation (5) because when there exist $l\in {\mathcal{C}}_{c}$, $r,t>0$ and ${n}_{0}\in \mathbb{N}$ such that $g\left(n\right)=rl\left(n\right)$ and $h=tl\left(n\right)$ for all $n>{n}_{0}$ and, besides, ${\mathrm{\Psi }}_{T}$ is an improver and a worsener with respect to g and h, respectively, then ${f}_{T}\in \mathrm{\Theta }\left(l\right)$.

### 4.2 Analyzing the running time computing of two examples

The aim of this section is twofold. On the one hand, we show that the developed method in Section 4.1 is useful to analyze the asymptotic complexity of recursive algorithms. On the other hand, in order to validate the new results, we will retrieve, by means of their application, the complexity class of two well-known algorithms in the literature.

Typical examples of algorithms whose running time of computing is the solution to the recurrence equation (5) are Quicksort (worst case behavior) and Hanoi.

In particular, the running time of computing of Quicksort is the solution to the recurrence equation given exactly as follows:
(8)

with $j>0$ and where c is the time taken by the algorithm in the base case.

Regarding Hanoi, under the uniform cost criterion assumption, its running time of computing is the solution to the recurrence equation given as follows:
(9)

with $c,d>0$ and where, again, c represents the time taken by the algorithm to solve the base case. Note that it does not make sense to distinguish three possible running time behaviors for Hanoi since the distribution of the input data is always the same for each size n.

For a deeper discussion about Quicksort and Hanoi, we refer the reader to [44, 45] and [44, 52], respectively.

Next we discuss the running time of computing of the aforesaid algorithms through our results.

Corollary 20 The running time of computing of Quicksort (worst case behavior) is in the complexity class $\mathrm{\Theta }\left({n}^{2}\right)$.

Proof The running time of computing of Quicksort (worst case behavior) is provided by the solution to the recurrence equation (8). Theorem 17 guarantees the existence and uniqueness of such a solution. Denote it by ${f}_{T}^{Q}$.

Consider the functional ${\mathrm{\Psi }}_{T}^{Q}$ given in (7) and induced by the recurrence equation (8), i.e.,
(10)

for all $f\in {\mathcal{C}}_{c}$.

Next we provide the asymptotic upper bound of ${f}_{T}^{Q}$. With this aim, define the complexity function ${h}_{r}$ as follows:

where $r>0$. Then it is not hard to see that ${\mathrm{\Psi }}_{T}$ is an improver with respect to ${h}_{r}\in {\mathcal{C}}_{c}$ (i.e., ${\mathrm{\Psi }}_{T}^{Q}\left({h}_{r}\right){\le }_{{p}_{{\mathcal{C}}_{c}}}{h}_{r}$) if and only if $r\ge max\left\{\frac{3j}{5},\frac{c}{4}+\frac{j}{2}\right\}$. It follows, by statement (2) in Theorem 18, that ${f}_{T}^{Q}\in \mathcal{O}\left({h}_{max\left\{\frac{3j}{5},\frac{c}{4}+\frac{j}{2}\right\}}\right)$.

In order to provide the asymptotic complexity class, it remains to yield an asymptotic lower bound of ${f}_{T}^{Q}$. Now it is a routine to check that ${\mathrm{\Psi }}_{T}^{Q}$ is a worsener with respect to the complexity function ${h}_{s}$ (i.e., ${h}_{s}{\le }_{{p}_{{\mathcal{C}}_{c}}}{\mathrm{\Psi }}_{T}^{Q}\left({h}_{s}\right)$) if and only if $s\le min\left\{\frac{j}{2},\frac{c}{4}+\frac{j}{2}\right\}$, whence we deduce, by statement (1) in Theorem 18, that ${f}_{T}^{Q}\in \mathrm{\Omega }\left({h}_{min\left\{\frac{j}{2},\frac{c}{4}+\frac{j}{2}\right\}}\right)$.

Therefore we obtain that ${f}_{T}^{Q}\in \mathcal{O}\left({h}_{max\left\{\frac{3j}{5},\frac{c}{4}+\frac{j}{2}\right\}}\right)\cap \mathrm{\Omega }\left({h}_{min\left\{\frac{j}{2},\frac{c}{4}+\frac{j}{2}\right\}}\right)$. Whence we deduce, by Remark 19, that ${f}_{T}^{Q}\in \mathrm{\Theta }\left({n}^{2}\right)$, which is in accordance with the Quicksort (worst case behavior) asymptotic complexity class that can be found in the literature [44, 45]. □

Corollary 21 The running time of computing of Hanoi, under the uniform const criterion, is in the complexity class $\mathrm{\Theta }\left({2}^{n}\right)$.

Proof The running time of computing of Hanoi, under the uniform const criterion, is provided by the solution to the recurrence equation (9). Theorem 17 guarantees the existence and uniqueness of such a solution. Denote it by ${f}_{T}^{H}$.

Consider the functional ${\mathrm{\Psi }}_{T}^{H}$ given in (7) and induced by the recurrence equation (9), i.e.,
(11)

for all $f\in {\mathcal{C}}_{c}$.

Next we provide the asymptotic upper bound of ${f}_{T}^{H}$. With this aim, define the complexity function ${h}_{r}$ as follows:

where $r>0$. It is not hard to check that ${\mathrm{\Psi }}_{T}^{H}$ is an improver with respect to ${h}_{r}$ (i.e., ${\mathrm{\Psi }}_{T}^{H}\left({h}_{r}\right){\le }_{{p}_{{\mathcal{C}}_{c}}}{h}_{r}$) if and only if $r\ge max\left\{d,\frac{2c+d}{3}\right\}$. It follows, by statement (2) in Theorem 18, that ${f}_{T}^{H}\in \mathcal{O}\left({h}_{max\left\{d,\frac{2c+d}{3}\right\}}\right)$.

Next we provide an asymptotic lower bound of ${f}_{T}^{H}$. It is a routine to check that ${\mathrm{\Psi }}_{T}^{H}$ is a worsener with respect to the complexity function ${h}_{s}$ (i.e., ${h}_{s}{\le }_{{p}_{{\mathcal{C}}_{c}}}{\mathrm{\Psi }}_{T}^{H}\left({h}_{s}\right)$) if and only if $s\le min\left\{d,\frac{2c+d}{3}\right\}$, whence we deduce, by statement (1) in Theorem 18, that ${f}_{T}^{H}\in \mathrm{\Omega }\left({h}_{min\left\{d,\frac{2c+d}{3}\right\}}\right)$.

Therefore we obtain that ${f}_{T}^{H}\in \mathcal{O}\left({h}_{max\left\{d,\frac{2c+d}{3}\right\}}\right)\cap \mathrm{\Omega }\left({h}_{min\left\{d,\frac{2c+d}{3}\right\}}\right)$. Thus, by Remark 19, we obtain that ${f}_{T}^{H}\in \mathrm{\Theta }\left({2}^{n}\right)$, which is in accordance with the Hanoi asymptotic complexity class that can be found in the literature [44, 52]. □

## Declarations

### Acknowledgements

This work was funded by the Deanship of Scientific Research (DSR), King Abdulaziz University, Jeddah, under grant No. 363-001-D1433. The authors, therefore, acknowledge with thanks DSR technical and financial support.

## Authors’ Affiliations

(1)
Department of Mathematics, Sciences Faculty for Girls, King Abdulaziz University, P.O. Box 4087, Jeddah, 21491, Saudi Arabia
(2)
Department of Mathematics, King Abdulaziz University, P.O. Box 80203, Jeddah, 21859, Saudi Arabia
(3)
Departamento de Ciencias Matemáticas e Informática, Universidad de las Islas Baleares, Ctra. de Valldemossa km. 7.5, Palma de Mallorca, 07122, Spain

## References 