**Francisco Pedroche 1,\* and J. Alberto Conejero <sup>2</sup>**


Received: 23 September 2020; Accepted: 11 October 2020; Published: 18 October 2020

**Abstract:** Mathematical analysis of rankings is essential for a wide range of scientific, public, and industrial applications (e.g., group decision-making, organizational methods, R&D sponsorship, recommender systems, voter systems, sports competitions, grant proposals rankings, web searchers, Internet streaming-on-demand media providers, etc.). Recently, some methods for incomplete aggregate rankings (rankings in which not all the elements are ranked) with ties, based on the classic Kendall's tau coefficient, have been presented. We are interested in ordinal rankings (that is, we can order the elements to be the first, the second, etc.) allowing ties between the elements (e.g., two elements may be in the first position). We extend a previous coefficient for comparing a series of complete rankings with ties to two new coefficients for comparing a series of incomplete rankings with ties. We make use of the newest definitions of Kendall's tau extensions. We also offer a theoretical result to interpret these coefficients in terms of the type of interactions that the elements of two consecutive rankings may show (e.g., they preserve their positions, cross their positions, and they are tied in one ranking but untied in the other ranking, etc.). We give some small examples to illustrate all the newly presented parameters and coefficients. We also apply our coefficients to compare some series of Spotify charts, both Top 200 and Viral 50, showing the applicability and utility of the proposed measures.

**Keywords:** incomplete rankings; Kendall's tau; permutation graph; competitive balance; Spotify

### **1. Introduction**

The analysis of rankings of scores (*cardinal rankings*) or, particularly, rankings composed of natural numbers (*ordinal rankings*), have been studied from different perspectives attending to the ultimate goal of the researchers or practitioners (see [1]). When the interest is on obtaining a *consensus* score that summarizes the opinion of various judges, the used mathematical tools are usually aimed to find a ranking that minimizes a given *distance metric* (see the seminal paper [2,3] for some properties of different metrics). In such a case, we say that a *distance metric* minimizes disagreement. We can place in this area the methods called *voter systems*, *ranking aggregation*, and others (see the detailed review in [4]).

When the interest is focused on comparing two series of rankings, one of the key points is to obtain a measure that describes the *evolution* of the series. In this case, we have a series of rankings such that each one of them prioritizes the elements based on the scores obtained at a particular time (see [5]). For example, *sports rankings* belong to this category. Obviously, at the end of a season, there is no need to find a consensus ranking since, by the nature of sports leagues, it is the last ranking that serves

to summarize the result of the overall season. The same happens with the Stock Market, the richest people rankings made by the Fortune magazine [6], university rankings (e.g., [7,8]), songs rankings based on the number of downloads, streaming, or sales (see [9]), etc. Our work is focused on a series of rankings behavior.

The terminology applied to rankings is not unique. For example, in [10] the term *partial* is used to indicate rankings in which ties are presented, while in [11] the term *partial* indicates that not all the objects are compared. In this paper, we use the terminology coined in [4,12]. We talk of *complete* rankings when all the objects are compared (as in a football league) and *incomplete* when there are absent objects (as in a Top k ranking). We explicitly use the terms *with ties* or *without ties* to indicate whether we consider the presence of tied objects in the rankings. We recall that in [11] the term *linear order* is used when all objects are compared and no ties are allowed (that is, for us, *complete rankings with no ties*) and the term *weak ordering* when all objects are compared, but ties are allowed (that is, for us, *complete rankings with ties*).

Incomplete rankings appear in multiple areas. For example, in national or European grant calls, judges evaluate only a subset of the applications, and therefore each judge handles an incomplete ranking. The same happens in literary contests, where each judge only reads a small number of manuscripts. In the case of the results shown by search engines, it is clear that only the first Top k web pages are displayed, being, as a consequence, an incomplete ranking.

We use, and extend, the results of some previous papers. Some concepts are taken from [5], where a method to compare series of complete rankings with no ties was presented, and from [13], where a method to compare series of complete rankings with ties was analyzed. We also make reference to [14], where some theoretical aspects where studied. In all these works, there are two main ingredients:


Regarding to extensions of Kendall's *τ* coefficient, the first attempt to incorporate an axiomatic distance metric was in [2], followed by the works [11,18,19].

More recently, in [4] these previous works were revised and a new axiomatic framework for incomplete rankings was introduced. To the best of our knowledge, the last paper devoted to an axiomatic study for incomplete rankings is [12], where it is shown as an extension of Kendall's *τ* coefficient to the case of incomplete rankings with ties.

Kendall's *τ* has been extensively used, and some extensions can be found in the literature up to the present day on [10,12,20]. In particular, Kendall's *τ* has been recently reviewed for ophthalmic research in [21] and it is a tool used in neuroscience studies—e.g., [22]—and in bioinformatics [23].

Regarding the use of graphs to represent a series of rankings, we recall, in particular, that a graph can be used to describe the crossings between two rankings. This graph is called a *permutation graph* (see [24,25]). When a graph is defined to show the *consecutive crossings* between a series of *m* rankings, it is called a *Competitivity graph* [5]. This concept corresponds to that of *intersection graph of a concatenation of permutation diagrams* in graph theory (see [26]). For more relations on graphs associated with rankings, see [14].

In this paper, we take some results of [4,12] as our starting point to develop two coefficients to describe the evolution of a series of *m* ≥ 2 incomplete rankings with ties. When applied to the case of only two rankings, our measures reduce to the measures given in [4,12].

We also extend the study of a series of complete rankings with ties developed in [13] to the case of incomplete rankings with ties. We make use of the standard modern notation in the field of rankings mainly based on [10,12,27], among others.

We take as our starting point the definition of *τ<sup>x</sup>* of [12] that is based on the computation of a certain sum of the form ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij* that involves the terms of some matrix *<sup>A</sup>* and *<sup>B</sup>* that indicate the relative positions of the elements of two rankings. In Theorem 1, we give an expression of this sum as a function of the type of interactions between a pair of elements {*i*, *j*} from one ranking to the next one (e.g., interchanges from tie to untie, absence of one of the elements in one ranking, crossings, etc.). This result allows for writing *<sup>τ</sup><sup>x</sup>* (and *<sup>τ</sup>x*) in terms of the interactions of the elements of the rankings.

On the one hand, this theoretical result also allows a computation of the sum ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij* without computing explicitly the involved matrices. On the other hand, it allows for interpreting the interactions of a series of rankings by using a permutation graph or, more generally speaking, a competitivity graph. The edges are weighted to represent the weight of the corresponding interactions and the whole series of rankings.

We define two coefficients *τ*• *ev* and *<sup>τ</sup>*-• *ev* for series of incomplete rankings with ties by using an analogy based on previous well-established definitions. We recall that, in the field of incomplete rankings, "intuition" is usually used for some measures over others since when you handle an incomplete ranking, there is no unique form to interpret the results (see this kind of reasoning in [4,12]). In our case, our measures' behaviour is checked by ensuring that they are well normalized and that they reduce to well-known cases in limit situations.

Finally, other contributions of the paper are placed on a practical field. We give a methodology to study the movements of rankings (of songs) in Spotify by using two different approaches: the cases of series of incomplete rankings without ties and series of incomplete rankings with ties.

The structure of the paper is as follows. In Section 2, we recall Kendall's *τ* and give the fundamental relations that will be useful throughout the paper. In Section 3, we recall the notation and basic results for the case of two incomplete rankings with ties allowed.

In Section 4, we give the fundamental theoretical result of the paper and some remarks that give insight both into the validity and application of this result. In Section 5, we recall some definitions from [13] to measure the evolution of *m* complete rankings with ties. In Section 6, we present two coefficients, denoted as *τ*• *ev* and *<sup>τ</sup>*-• *ev* to characterize the evolution of *m* incomplete rankings with ties and some examples are given. In Section 7, we illustrate the applicability of the new coefficients by using some real data obtained from Spotify charts. Finally, in Section 8, we outline the main conclusions of the paper.

#### **2. Preliminaries**

In [16] it is shown that Kendall's *τ* coefficient (also called *measure of disarray*) associated with two rankings with the same number of elements *n*, can be written in the form

$$\tau = 1 - \frac{2s}{\frac{1}{2}n(n-1)}\tag{1}$$

where *s* is the minimum number of interchanges required to transform one ranking into the other. This coefficient is a measure of the intensity of rank correlation. The coefficient can also be written as

$$
\tau = \frac{P - Q}{\frac{1}{2}n(n-1)}\tag{2}
$$

where *P* is the number of pair of elements that maintain its relative order when passing from the first ranking to the second one (that is, the first element is above or below the second in both rankings) and *Q* is the number of pairs of elements that interchange its order (that is, in one ranking, the first element is above the second and, in the other ranking, the first element is below the second, or vice-versa).

Note that *Q* and *s* are equal. Furthermore, this quantity can be identified with the number of *crossings* or *inversions* when passing from the first ranking to the second. For this reason, throughout the paper, we will keep in mind that Equation (1) gives the equivalence between the number of crossings and the associated *τ*. This will be important in what follows since we will deal with different extensions of Kendall's *τ* coefficient and since one of our preferred tools will be counting the number of crossings, as in [5].

We recall from [27] that a *distance metric <sup>d</sup>*(**a**, **<sup>b</sup>**) can be transformed into a correlation coefficient *<sup>τ</sup>*(**a**, **<sup>b</sup>**) by the formula

$$\pi(\mathbf{a}, \mathbf{b}) = 1 - \frac{2d(\mathbf{a}, \mathbf{b})}{d\_{\max}(\mathbf{a}, \mathbf{b})} \tag{3}$$

where *dmax*(**a**, **<sup>b</sup>**) is the maximum possible distance between two rankings. We recall that a distance metric between two rankings **a** and **b** is a non-negative real function *f* , such that it is *symmetric* (*f*(**a**, **<sup>b</sup>**) = *<sup>f</sup>*(**b**, **<sup>a</sup>**), for any pair of rankings), *regular* (*f*(**a**, **<sup>b</sup>**) = <sup>0</sup> <sup>↔</sup> **<sup>a</sup>** = **<sup>b</sup>**) and satisfying the *triangle inequality* (*f*(**a**, **<sup>c</sup>**) <sup>≤</sup> *<sup>f</sup>*(**a**, **<sup>b</sup>**) + *<sup>f</sup>*(**b**, **<sup>c</sup>**), for any rankings **<sup>a</sup>**, **<sup>b</sup>**, and **<sup>c</sup>**). Note that Equation (1) is of this form, since *<sup>n</sup>*(*<sup>n</sup>* <sup>−</sup> <sup>1</sup>)/2 is the maximum number of crossings between two given rankings. The same happens with the Spearman's *ρ* coefficient. In [16] the Spearman's *ρ* for two ordinal complete rankings **<sup>x</sup>** = (*x*1, *<sup>x</sup>*2,..., *xn*) and **<sup>y</sup>** = (*y*1, *<sup>y</sup>*2,..., *yn*) with *xi*, *yi* <sup>∈</sup> <sup>N</sup> is defined by

$$\rho = 1 - \frac{6\sum\_{i=1}^{n} (x\_i - y\_i)^2}{n^3 - n}$$

and this is of the form (3) since it is easy to show that the maximum value of ∑*<sup>n</sup> <sup>i</sup>*=1(*xi* <sup>−</sup> *yi*)<sup>2</sup> occurs when one ranking is the reverse of the other and, as a consequence, the maximum value of the *distance metric d*(**x**, **<sup>y</sup>**) = <sup>∑</sup>*<sup>n</sup> <sup>i</sup>*=1(*xi* <sup>−</sup> *yi*)<sup>2</sup> is <sup>1</sup> <sup>3</sup> (*n*<sup>3</sup> <sup>−</sup> *<sup>n</sup>*) (see [3] for this and other properties of distance metrics).

We also recall that a permutation graph (called *competitivity graph* in [5]) is associated with two rankings over the same elements in such a way that the nodes represent the elements and two nodes and are connected with an edge if they cross their positions when passing from one ranking to the other.

In this way, it is clear that the number of edges of this graph is, precisely, *s*. Furthermore, another quantity (borrowed from graph theory) is also introduced in [5]: the *Normalized Mean Strength NS*; that is, the normalized sum of the weights of the edges of a weighted graph. When considering only two rankings and its corresponding *competitivity graph*, we have the following relation

$$\text{NS} = \frac{1-\tau}{2} \tag{4}$$

that gives the equivalence between the *Normalized Mean Strength* and Kendall's *τ* for two rankings. Note that *<sup>τ</sup>* <sup>∈</sup> [−1, 1] and *NS* <sup>∈</sup> [0, 1]. We consider that the measure *NS* is more intuitive than *<sup>τ</sup>* since it allows us to interpret the movements or *activity* of a series of rankings as a percentage.

### **3. Coefficients for Two Incomplete Rankings with Ties**

In this section, we recall some definitions used in [4,12]. We will use the next three ingredients in order to define a coefficient to compare two rankings:


Let *<sup>V</sup>* <sup>=</sup> {*v*1, *<sup>v</sup>*2, ··· , *vn*} be the objects to be ranked, with *<sup>n</sup>* <sup>&</sup>gt; 1. The ranking is given by

$$\mathbf{a} = [a\_1, a\_2, \dots, a\_n] \tag{5}$$

where *ai* is the position of *vi* in the ranking. Note that if *ai* <sup>=</sup> *aj*, then *vi* and *vj* are tied. If *vi* is not ranked, then it is denoted as *ai* <sup>=</sup> •. We also define the set

$$V\_{\mathbf{a}} = \{ v\_i \in V \mid a\_i \neq \bullet \}.$$

We define an *<sup>n</sup>* <sup>×</sup> *<sup>n</sup>* matrix *<sup>A</sup>* = (*Aij*), with entries *Aij* associated to **<sup>a</sup>** as follows:

$$A\_{ij} = \begin{cases} 1 & \text{if } a\_i \le a\_j \\ -1 & \text{if } a\_i > a\_j \\ 0 & \text{if } i = j, a\_i = \bullet, \text{ or } a\_j = \bullet \end{cases} \tag{6}$$

According to [12], we define the coefficients

$$\pi\_{\mathbf{x}}(\mathbf{a}, \mathbf{b}) = \frac{\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{ij} B\_{ij}}{n(n-1)} \tag{7}$$

and, when *n* > 1

$$
\hat{\pi}\_{\mathcal{X}}(\mathbf{a}, \mathbf{b}) = \frac{n(n-1)}{\overline{n}(\overline{n}-1)} \tau\_{\mathcal{X}}(\mathbf{a}, \mathbf{b}) \tag{8}
$$

where *n* is the number of common ranked elements *vi* to **a** and **b**. That is:

$$\overline{n} = |V\_a \cap V\_b| \tag{9}$$

**Example 1.** *Let <sup>V</sup>* <sup>=</sup> {1, 2, 3, 4, 5, 6, 7, 8}*, and let us consider two rankings* **<sup>a</sup>** *and* **<sup>b</sup>***. Then,* **<sup>a</sup>** <sup>=</sup> [6, 4, 5, 5, •, 2, 1, 3] *represents the incomplete ranking with ties* (7, 6, 8, 2, 3−4, 1)*, where* <sup>3</sup>−<sup>4</sup> *indicate tied elements. Analogously,* **<sup>b</sup>** = [3, 3, 2, 2, •, 1, •, 4] *represents the ranking* (6, 3−4, 1−2, 8)*. Note that n* = <sup>8</sup> *and <sup>n</sup>* = <sup>6</sup>*.*

Note that *τ<sup>x</sup>* with complete rankings and no ties reduces to the classic Kendall's *τ* given by (1), while *<sup>τ</sup><sup>x</sup>* is a renormalization of *<sup>τ</sup>x*, verifying <sup>|</sup>*τ<sup>x</sup>*|≥|*τx*|.

As we will see, Definition 6 in Section 6, is based on an analogy with Equation (1). To that end, it will be necessary to count all the possible cases when passing from **a** to **b** (interactions between the relative positions of pair of elements such as crossings, pass from tie to untie, from being in the ranking to quitting it, etc.). We do this in the next section.

#### **4. Main Result**

The following result is the fundamental theoretical result of this paper. This result will allow us to write *<sup>τ</sup><sup>x</sup>* and *<sup>τ</sup><sup>x</sup>* in terms of the interactions of the rankings' elements. It opens the possibility of giving weights to the interactions, as is a common practice in modern definitions of Kendall's tau [10]. This result also constitutes our starting point to define a coefficient for a series of more than two incomplete rankings. This theorem also allows giving insight into the differences between *<sup>τ</sup><sup>x</sup>* and *<sup>τ</sup>x*. Some other consequences are detailed in the remarks below and in Corollary 1.

**Theorem 1.** *Given two vectors* **a***,* **b** *representing incomplete rankings of n elements with ties, represented as in* (5)*, and their corresponding matrices A* = (*Aij*) *and B* = (*Bij*) *defined by* (6)*, it holds that*

$$\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{i\bar{j}} B\_{i\bar{j}} = n(n-1) - 4s - 2n\_{lu} - 2N\_{inc} \tag{10}$$

*where*

$$N\_{\rm inc} = \binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} + n\_{\bullet \bullet}(n\_{\bullet \bullet} + n\_{\bullet \bullet} + n\_{\bullet \bullet}) + n\_{\bullet \bullet}(n\_{\bullet \bullet} + n\_{\bullet \bullet}) + n\_{\bullet \bullet}n\_{\bullet \bullet} \tag{11}$$

*s is the number of crossings—that is, the number of pairs* {*i*, *j*}*—such that ai* < *aj and bi* > *bj, or ai* > *aj and bi* < *bj.*

*ntu is the number of pairs that are tied in only one ranking (*from tie to untie or viceversa*), that is, such that ai* <sup>=</sup> *aj and bi* <sup>=</sup> *bj, or ai* <sup>=</sup> *aj and bi* <sup>=</sup> *bj.*

*In the definitions of s, and ntu, it is assumed that ai and bi are different from* •*. For the cases when one or more* • *may appear, the following notation holds:*

*<sup>n</sup>*•• *is the number of entries such that ai* <sup>=</sup> *bi* <sup>=</sup> •*; <sup>n</sup>*•∗ *is the number of entries, such that ai* <sup>=</sup> • *and bi* <sup>=</sup> •*; <sup>n</sup>*∗• *is the number of entries, such that ai* <sup>=</sup> • *and bi* <sup>=</sup> •*.*

*Finally, it is also needed to define n*∗∗ *as the number of entries, such that ai* <sup>=</sup> • *and bi* <sup>=</sup> •*.*

**Proof of Theorem 1.** For each pair {*i*, *<sup>j</sup>*} we will evaluate each term *AijBij* <sup>+</sup> *AjiBji* in the expression ∑*n <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij*. The case *<sup>i</sup>* <sup>=</sup> *<sup>j</sup>* gives *AiiBii* <sup>+</sup> *AiiBii* <sup>=</sup> 0.

Thus, we focus on pairs {*i*, *<sup>j</sup>*} with *<sup>i</sup>* = *<sup>j</sup>*. There is a total number of *<sup>n</sup>*(*<sup>n</sup>* <sup>−</sup> <sup>1</sup>)/2 of these pairs. It is useful to consider the basic cell of the pair {*i*, *j*} with *i* < *j*.

$$
\begin{pmatrix} a\_i & b\_i \\ -a\_j & b\_j \end{pmatrix}
$$

where *ak* and *bk* can be natural numbers or a • if the element *k* is not ranked in **a** or **b**.

Let us study first the cases that can appear when no • is present in the basic cell.

#### **The Complete Case (C):**

That is *ak* <sup>=</sup> •, *bk* <sup>=</sup> •, for all *<sup>k</sup>* ∈ {1, 2, . . . *<sup>n</sup>*}. We distinguish four types of basic cells.

*Type C.1: Not crossing, and no ties in* **a** *nor in* **b**.

For example:

$$
\begin{pmatrix} 1 & 3 \\ 2 & 4 \end{pmatrix} \quad \text{or} \quad \begin{pmatrix} 2 & 4 \\ 1 & 3 \end{pmatrix}.
$$

So that, we have *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj* and two cases can appear:

C.1.1. If *ai* <sup>&</sup>lt; *aj* and *bi* <sup>&</sup>lt; *bj*, then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · <sup>1</sup> + (−1) · (−1) = 2. C.1.2. If *ai* <sup>&</sup>gt; *aj* and *bi* <sup>&</sup>gt; *bj*, then *AijBij* <sup>+</sup> *AjiBji* = (−1) · (−1) + <sup>1</sup> · <sup>1</sup> <sup>=</sup> 2.

*Type C.2: Crossing*.

For example:

$$
\left(\begin{array}{ccc} 1 & 4 \\ 2 & 3 \end{array}\right) \quad \text{or} \quad \left(\begin{array}{ccc} 2 & 3 \\ 1 & 4 \end{array}\right) \dots
$$

Again, we have *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj* and two more cases can appear:

C.2.1. If *ai* <sup>&</sup>lt; *aj* and *bi* <sup>&</sup>gt; *bj*, then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · (−1)+(−1) · <sup>1</sup> <sup>=</sup> <sup>−</sup>2. C.2.2. If *ai* <sup>&</sup>gt; *aj* and *bi* <sup>&</sup>lt; *bj*, then *AijBij* <sup>+</sup> *AjiBji* = (−1) · (1) + <sup>1</sup> · (−1) = <sup>−</sup>2.

*Type C.3: From tie to untie or viceversa*.

For example:

$$
\begin{pmatrix} 1 & 3 \\ 1 & 4 \end{pmatrix}, \quad \begin{pmatrix} 1 & 4 \\ 1 & 3 \end{pmatrix}, \quad \begin{pmatrix} 3 & 1 \\ 4 & 1 \end{pmatrix}, \quad \text{or} \quad \begin{pmatrix} 4 & 1 \\ 3 & 1 \end{pmatrix}.
$$

We have *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj* or *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj*. Therefore, four cases can appear:

C.3.1. If *ai* <sup>=</sup> *aj* and *bi* <sup>&</sup>lt; *bj* then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · <sup>1</sup> <sup>+</sup> <sup>1</sup> · (−1) = 0. C.3.2. If *ai* <sup>=</sup> *aj* and *bi* <sup>&</sup>gt; *bj* then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · (−1) + <sup>1</sup> · <sup>1</sup> <sup>=</sup> 0. C.3.3. If *ai* <sup>&</sup>lt; *aj* and *bi* <sup>=</sup> *bj* then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · <sup>1</sup> + (−1) · <sup>1</sup> <sup>=</sup> 0. C.3.4. If *ai* <sup>&</sup>gt; *aj* and *bi* <sup>=</sup> *bj* then *AijBij* <sup>+</sup> *AjiBji* = (−1) · <sup>1</sup> <sup>+</sup> <sup>1</sup> · <sup>1</sup> <sup>=</sup> 0.

*Type C.4: From tie to tie*.

For example:

$$
\begin{pmatrix} 1 & 2 \\ -1 & 2 \end{pmatrix}
$$

That is, we have: *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj*, and then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · <sup>1</sup> <sup>+</sup> <sup>1</sup> · <sup>1</sup> <sup>=</sup> 2.

We denote the number of pairs of each case using the terminology of Table 1. Note that *ntt* is *the number of pairs that are tied in both rankings*, that is, such that *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj*. Note also that *ntu* is the number of pairs that go from tie to untie or viceversa.

**Table 1.** Number of pairs {*i*, *j*} corresponding to each type for the complete cases.


#### **The Incomplete Case (I):**

There is at least one • in the basic cell. In other words, there is some *<sup>k</sup>* such that *ak* <sup>=</sup> •, or *bk* <sup>=</sup> •, or both. We distinguish seven cases:

*Type I.1: Four* • That is *ai* <sup>=</sup> *aj* <sup>=</sup> *bi* <sup>=</sup> *bj* <sup>=</sup> •, or graphically

$$(:,:)$$

Then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>0</sup> · <sup>0</sup> <sup>+</sup> <sup>0</sup> · <sup>0</sup> <sup>=</sup> 0. Let us denote by *<sup>n</sup>*•• the number of null rows that appear in the matrix with columns **<sup>a</sup>** and **<sup>b</sup>**. Therefore, we have ( *n*•• <sup>2</sup> ) pairs {*i*, *<sup>j</sup>*} of this type.

*Type I.2: Three* •. That is, a cell of one of these forms

$$(\bullet,\bullet)\cdot(\bullet,\bullet)\cdot(\bullet,\bullet),\quad\text{or}\quad(\bullet,\bullet)$$

where <sup>∗</sup> is a number (not a •). Therefore, we have four cases, but all are similar to this one: *ai* <sup>=</sup> • and *aj* <sup>=</sup> *bi* <sup>=</sup> *bj* <sup>=</sup> 0. Then, *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>0</sup> · <sup>0</sup> <sup>+</sup> <sup>0</sup> · <sup>0</sup> <sup>=</sup> 0.

Denoting *<sup>n</sup>*∗• the number of rows of the form (∗ •) in the *<sup>n</sup>* <sup>×</sup> 2 matrix (**a b**), and *<sup>n</sup>*•∗ the number of rows of the form (• ∗) in the same matrix, it is clear that the number of pairs {*i*, *<sup>j</sup>*} of this type is: *<sup>n</sup>*••(*n*∗• <sup>+</sup> *<sup>n</sup>*•∗).

*Type I.3: Two* •*, one on each ranking*. That is, any cell of one of these forms

$$
\begin{pmatrix} \begin{pmatrix} \bullet & \bullet \\ \bullet & \bullet \end{pmatrix} \end{pmatrix} \cdot \begin{pmatrix} \begin{pmatrix} \bullet & \bullet \\ \bullet & \bullet \end{pmatrix} \end{pmatrix} \cdot \begin{pmatrix} \begin{pmatrix} \bullet & \bullet \\ \bullet & \bullet \end{pmatrix} \end{pmatrix}, \quad \text{or} \quad \begin{pmatrix} \begin{pmatrix} \bullet & \bullet \\ \bullet & \bullet \end{pmatrix} \end{pmatrix}.
$$

These four cases can be reduced to two:

$$\begin{array}{ll} \text{1.3.1.} & \text{If } a\_{\text{i}} = b\_{\text{i}} = \bullet, a\_{\text{i}} \neq \bullet \text{ and } b\_{\text{j}} \neq \bullet \text{, then } A\_{\text{i}\bar{j}} B\_{\text{i}\bar{j}} + A\_{\text{j}\bar{i}} B\_{\text{j}\bar{i}} = 0 \cdot 0 + 0 \cdot 0 = 0. \\\ \text{1.3.2.} & \text{If } a\_{\text{i}} = \bullet, a\_{\text{j}} \neq \bullet, b\_{\text{i}} \neq \bullet \text{ and } b\_{\text{j}} = \bullet \text{, then } A\_{\text{i}\bar{j}} B\_{\text{i}\bar{j}} + A\_{\text{j}\bar{i}} B\_{\text{j}\bar{i}} = 0 \cdot 0 + 0 \cdot 0 = 0. \end{array}$$

Denoting by *<sup>n</sup>*∗∗ the number of rows of the form (∗ ∗) in the *<sup>n</sup>* <sup>×</sup> 2 matrix (**a b**), it is clear that the number of pairs {*i*, *<sup>j</sup>*} of this type is *<sup>n</sup>*••*n*∗∗ <sup>+</sup> *<sup>n</sup>*∗•*n*•∗.

*Type I.4: Tied in one ranking and two* • *in the other*. For example,

$$
\begin{pmatrix} \begin{smallmatrix} 1 & \bullet \\ 1 & \bullet \end{smallmatrix} \end{pmatrix} \cdot \begin{pmatrix} \begin{smallmatrix} \bullet & 1 \\ \bullet & 1 \end{smallmatrix} \end{pmatrix}
$$

That is, we have two cases, which are similar to this *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj* <sup>=</sup> •, and then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>0</sup> · <sup>0</sup> + <sup>0</sup> · <sup>0</sup> = 0.

Let us denote by *na* the number of different natural numbers in **a** and by *nb* be the number of different natural numbers in **<sup>b</sup>**. Let *ni*• be the number of rows of the form (*i*, •) in that matrix, for *<sup>i</sup>* <sup>=</sup> 1, ... , *na* and, analogoulsly, let *<sup>n</sup>*•*<sup>i</sup>* be the number of rows of the form (•, *<sup>i</sup>*) in the matrix (**ab**) for *<sup>i</sup>* = 1, . . . , *nb*. Then, it is straightforward to see that the number of cases of this type is given by

$$\sum\_{i=1}^{n\_a} \binom{n\_{i\bullet}}{2} + \sum\_{i=1}^{n\_b} \binom{n\_{\bullet i}}{2} \dots$$

*Type I.5: Tied in one ranking, one* • *in the other*. For example

 1 • 1 2 , 1 2 1 • , • 1 2 1 , 2 1 • 1 .

We have the following 4 cases:


Let *ni*<sup>∗</sup> be the number of rows of the form (*i*, <sup>∗</sup>) (where <sup>∗</sup> can be *<sup>i</sup>*) in the same matrix, with *<sup>i</sup>* <sup>∈</sup> {1, 2, . . . *na*}.

Analogously, let *<sup>n</sup>*∗*<sup>i</sup>* be the number of rows of the form (∗, *<sup>i</sup>*) (where <sup>∗</sup> can be *<sup>i</sup>*) in the matrix (**a b**). Then, it is straightforward to see that the number of cases of this type is given by

$$\sum\_{i=1}^{n\_{\bullet}} n\_{i\bullet} n\_{i\bullet} + \sum\_{i=1}^{n\_b} n\_{\ast i} n\_{\bullet i} \dots$$

*Type I.6: Two* • *in one ranking and different numbers in the other*.

For example

$$
\begin{pmatrix} \begin{matrix} 1 & \bullet \\ 2 & \bullet \end{matrix} \end{pmatrix} \cdot \begin{pmatrix} \begin{matrix} \bullet & \circ \\ \bullet & 1 \end{matrix} \end{pmatrix}
$$

We have here only two cases:

I.6.1. If *ai* <sup>=</sup> *aj* and *bi* <sup>=</sup> *bj* <sup>=</sup> • then *AijBij* <sup>+</sup> *AjiBji* = (±1) · <sup>0</sup> + (±1) · <sup>0</sup> <sup>=</sup> 0. I.6.2. If *ai* <sup>=</sup> *aj* <sup>=</sup> • and *bi* <sup>=</sup> *bj* then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>0</sup> · (±1) + <sup>0</sup> · (±1) = 0.

Then, it is easy to see that the number of pairs {*i*, *j*} of this type is

$$
\binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} - \sum\_{i=1}^{n\_{\bullet}} n\_{i \bullet} n\_{i \bullet} - \sum\_{i=1}^{n\_b} n\_{\bullet i} n\_{\bullet i} i
$$

where we have subtracted the number of cases of the type I.4.

*Type I.7: Only one* • *and no ties*.

For example, they are cases of the form

$$
\begin{pmatrix} 1 & 1 \\ 2 & \bullet \end{pmatrix} \, \cdot \, \cdot \, \begin{pmatrix} 1 & \bullet \\ 2 & 1 \end{pmatrix} \, \cdot \, \cdot \begin{pmatrix} 1 & 1 \\ \bullet & 2 \end{pmatrix} \, \cdot \, \cdot \begin{pmatrix} \bullet & 2 \\ 1 & 1 \end{pmatrix}
$$

We can have four cases that are similar to these

**If** *ai* <sup>&</sup>lt; *aj* and *bi* <sup>=</sup> •, *bj* <sup>=</sup> • then *AijBij* <sup>+</sup> *AjiBji* <sup>=</sup> <sup>1</sup> · <sup>0</sup> + (−1) · <sup>0</sup> <sup>=</sup> 0. **If** *ai* <sup>&</sup>gt; *aj* and *bi* <sup>=</sup> •, *bj* <sup>=</sup> • then *AijBij* <sup>+</sup> *AjiBji* = (−1) · <sup>0</sup> <sup>+</sup> <sup>1</sup> · <sup>0</sup> <sup>=</sup> 0.

Let *ni*<sup>∗</sup> be number of rows of the form (*i*, <sup>∗</sup>) (where <sup>∗</sup> can be *<sup>i</sup>*) in the same matrix, with *<sup>i</sup>* ∈ {1, 2, . . . , *na*} and, analogously, let *<sup>n</sup>*∗*<sup>i</sup>* be the number of rows of the form (∗, *<sup>i</sup>*) (where <sup>∗</sup> can be *<sup>i</sup>*) in the matrix (**a b**), with *<sup>i</sup>* ∈ {1, 2, ... , *na*}. Then, the number of pairs {*i*, *<sup>j</sup>*} of this type is given by

$$n\_{\ast\ast}(n\_{\ast\bullet}+n\_{\bullet\ast}) - \sum\_{i=1}^{n\_{\ast}} n\_{i\ast}n\_{i\bullet} - \sum\_{i=1}^{n\_b} n\_{\ast i}n\_{\bullet i}$$

where we have subtracted the number of cases of the type I.5.

In Table 2 we overview the number of cases for each type of the incomplete case.

**Table 2.** Number of pairs {*i*, *j*} corresponding to each type for the incomplete cases.


To end the proof, we add the contributions for all the cases, complete (C) and incomplete (I), to the sum ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij* and we obtain

$$\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{ij} B\_{ij} = 2n\_{nc} - 2s + 2n\_{tt} \tag{12}$$

*Mathematics* **2020**, *8*, 1828

Now, taking into account that all the cases must amount up to the total number of pairs we have

$$\frac{n(n-1)}{2} = n\_{nc} + s + n\_{tt} + n\_{tu} + N\_{inc} \tag{13}$$

where *Ninc* is the sum of all the cases in Table 2. By plugging *nnc* <sup>=</sup> *<sup>n</sup>*(*n*−1) <sup>2</sup> − *s* − *ntt* − *ntu* − *Ninc* into (12), we finally get

$$\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{ij} B\_{ij} = n(n-1) - 4s - 2n\_{\text{full}} - 2N\_{\text{inc}}$$

where

$$N\_{\rm inc} = \binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} + n\_{\bullet \bullet}(n\_{\bullet \bullet} + n\_{\bullet \bullet} + n\_{\bullet \bullet}) + n\_{\bullet \bullet}(n\_{\bullet \bullet} + n\_{\bullet \bullet}) + n\_{\bullet \bullet}n\_{\bullet \bullet}$$

In the next example, we illustrate the previous result.

**Example 2.** *Given the rankings* **<sup>a</sup>** = [1, •, 2, •, 3, 2, •, •, •, 1] *and* **<sup>b</sup>** = [2, •, 4, 2, •, 1, 3, 3, •, 2]*, then <sup>n</sup>* <sup>=</sup> <sup>10</sup>*, <sup>n</sup>*•• <sup>=</sup> <sup>2</sup>*, <sup>n</sup>*•∗ <sup>=</sup> <sup>3</sup>*, <sup>n</sup>*∗• <sup>=</sup> <sup>1</sup>*, <sup>n</sup>*∗∗ <sup>=</sup> <sup>4</sup>*, <sup>s</sup>* <sup>=</sup> <sup>2</sup> *(corresponding to the pairs* {1, 6} *and* {6, 10}*), ntu* <sup>=</sup> <sup>1</sup> *(corresponding to the pair* {3, 6}*) , ntt* <sup>=</sup> <sup>1</sup> *(corresponding to the pair* {1, 10}*), na* <sup>=</sup> <sup>3</sup>*, nb* <sup>=</sup> <sup>4</sup>*, <sup>n</sup>*1• <sup>=</sup> *<sup>n</sup>*2• <sup>=</sup> <sup>0</sup>*, <sup>n</sup>*3• <sup>=</sup> <sup>1</sup>*, <sup>n</sup>*•<sup>1</sup> <sup>=</sup> 0, *<sup>n</sup>*•<sup>2</sup> <sup>=</sup> <sup>1</sup>*, <sup>n</sup>*•<sup>3</sup> <sup>=</sup> <sup>2</sup>*, <sup>n</sup>*•<sup>4</sup> <sup>=</sup> <sup>0</sup>*, <sup>n</sup>*1<sup>∗</sup> <sup>=</sup> 2, *<sup>n</sup>*2<sup>∗</sup> <sup>=</sup> <sup>2</sup>*, <sup>n</sup>*3<sup>∗</sup> <sup>=</sup> <sup>0</sup>*, <sup>n</sup>*∗<sup>1</sup> <sup>=</sup> 1, *<sup>n</sup>*∗<sup>2</sup> <sup>=</sup> <sup>2</sup>*, <sup>n</sup>*∗<sup>3</sup> <sup>=</sup> <sup>0</sup>*, and, <sup>n</sup>*∗<sup>4</sup> <sup>=</sup> <sup>1</sup>*.*

*From the parameters of Table 3, we obtain Ninc* <sup>=</sup> <sup>39</sup>*. Thus, it is easy to check that* <sup>∑</sup>*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij* <sup>=</sup> *<sup>n</sup>*(*<sup>n</sup>* <sup>−</sup> <sup>1</sup>) <sup>−</sup> <sup>4</sup>*<sup>s</sup>* <sup>−</sup> <sup>2</sup>*ntu* <sup>−</sup> <sup>2</sup>*Ninc* <sup>=</sup> <sup>2</sup> *as stated in Theorem 1.*

*The number of pairs* {*i*, *j*} *is* 45*, corresponding to the following cells*

 1 2 • • , 1 2 2 4 , 1 2 • 2 , 1 2 3 • , 1 2 2 1 , 1 2 • 3 , 1 2 • 3 , 1 2 • • 1 2 1 2 , • • 2 4 , • • • 2 , • • 3 • , • • 2 1 , • • • 3 , • • • 3 , • • • • • • 1 2 , 2 4 • 2 , 2 4 3 • , 2 4 2 1 , 2 4 • 3 , 2 4 • 3 , 2 4 • • , 2 4 1 2 • 2 3 • , • 2 2 1 , • 2 • 3 , • 2 • 3 , • 2 • • , • 2 1 2 , 3 • 2 1 , 3 • • 3 3 • • 3 , 3 • • • , 3 • 1 2 , 2 1 • 3 , 2 1 • 3 , 2 1 • • , 2 1 1 2 , • 3 • 3 • 3 • • , • 3 1 2 , • 3 • • , • 3 1 2 , • • 1 2 

*and the number of cases of each type for the incomplete case appearing on Theorem 1 are shown in Table 3.*

**Table 3.** Number of pairs {*i*, *j*} that have some •, corresponding to Example 2. Note that the sum of all the types is, by definition in (11), *Ninc*.


**Remark 1.** *By using* (10) *and* (7) *we obtain*

$$\pi\_{\mathfrak{X}} = 1 - \frac{4(s + \frac{1}{2}n\_{tu}) + 2N\_{inc}}{n(n-1)} \tag{14}$$

*that can be thought of an extension of* (1) *to the case of two incomplete rankings with ties. This formula is one of the original contributions of this paper. Note that the term Ninc is known since it is given by* (11)*. This formula will be useful in Section 6 to define our measure of correlation for a series of incomplete rankings with ties.*

**Remark 2.** *For two complete rankings with ties allowed, Equation* (10) *simplifies to*

$$\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{ij} B\_{ij} = n(n-1) - 4s - 2n\_{tu} \tag{15}$$

*If we recall the definition of the distance of Kemeny and Snell [2] depending on a matrix <sup>C</sup>*(**a**) = *Cij*(**a**) *such that*

$$\mathbf{C}\_{ij}(\mathbf{a}) = \begin{cases} 1 & \text{if element i is preferred to element j} \\ -1 & \text{if element j is preferred to element i} \\ 0 & \text{if } i = j \text{, or if both elements i and j are tied} \end{cases} \tag{16}$$

*by following a similar procedure as in the proof of Theorem 1 it is easy to show that*

$$\sum\_{i\neq} |\mathcal{C}\_{ij}(\mathbf{a}) - \mathcal{C}\_{ji}(\mathbf{b})| = 4s + 2n\_{l\ell} \tag{17}$$

*and by using* (15) *we get*

$$\sum\_{i=1}^{n}\sum\_{j=1}^{n}A\_{i\bar{j}}B\_{i\bar{j}} = n(n-1) - \sum\_{i\bar{j}}|\mathcal{C}\_{i\bar{j}}(\mathbf{a}) - \mathcal{C}\_{\bar{j}\bar{i}}(\mathbf{b})|\tag{18}$$

*that it is in agreement with the results shown in [27], but we obtain it as a particular case of Theorem 1.*

**Remark 3.** *The common number of ranked elements in* **a** *and* **b** *that we denote as n in* (9) *is precisely n*∗∗*. Moreover, by using that*

$$n\_{\bullet\bullet} + n\_{\bullet\bullet} + n\_{\bullet\bullet} = n - \overline{n}$$

*Mathematics* **2020**, *8*, 1828

*Let us check that Ninc given by* (11) *can be rewritten as*

$$N\_{\rm inc} = \binom{n}{2} - \binom{\overline{n}}{2} \tag{19}$$

*To that end, it is needed to use that n*∗∗ <sup>=</sup> *n and*

$$n\_{\bullet\bullet} + n\_{\bullet\bullet} + n\_{\bullet\bullet} = n - \overline{n} \tag{20}$$

*To see how it is, we first note that*

$$\begin{aligned} \binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} + \binom{n\_{\bullet \bullet}}{2} &= \frac{1}{2} \left[ n\_{\bullet \bullet}^2 + n\_{\bullet \bullet}^2 + n\_{\bullet \bullet}^2 - (n\_{\bullet \bullet} + n\_{\bullet \bullet} + n\_{\bullet \bullet}) \right] \\ &= \frac{1}{2} \left[ n\_{\bullet \bullet}^2 + n\_{\bullet \bullet}^2 + n\_{\bullet \bullet}^2 - n + \overline{n} \right] \end{aligned} \tag{21}$$

*Second, we can simplify, by using* (20)

$$n\_{\bullet\bullet}(n\_{\bullet\bullet} + n\_{\bullet\bullet} + n\_{\bullet\bullet}) = n\_{\bullet\bullet}(n - n\_{\bullet\bullet})\tag{22}$$

*Third, note that, by using* (20)*,*

$$m\_{\ast\ast}(n\_{\ast\bullet} + n\_{\bullet\ast}) = \overline{m}n - \overline{n}^2 - \overline{m}n\_{\bullet\bullet} \tag{23}$$

*Now, by using* (21)*–*(23) *we have that Ninc given by* (11) *becomes*

$$N\_{\rm inc} = \frac{1}{2} n\_{\bullet \bullet}^2 + \frac{1}{2} (n\_{\bullet \bullet} + n\_{\bullet \bullet})^2 + \frac{1}{2} (\overline{n} - n) + n\_{\bullet \bullet} (n - n\_{\bullet \bullet} - \overline{n}) + \overline{n} (n - \overline{n})$$

*and since*

$$\frac{1}{2}(n\_{\bullet\bullet} + n\_{\bullet\bullet})^2 = \frac{1}{2}\left(n^2 - 2n\overline{n} + \overline{n}^2 + 2\overline{n}n\_{\bullet\bullet} - 2nn\_{\bullet\bullet} + n\_{\bullet\bullet}^2\right)$$

*we get*

$$N\_{\rm inc} = \frac{1}{2}(\overline{n} - n) + \frac{1}{2}\left(n^2 - 2n\overline{n} + \overline{n}^2\right) + \overline{m} - \overline{n}^2 = \frac{n(n-1)}{2} + \frac{\overline{n} - \overline{n}^2}{2}$$

*that is to say*

$$N\_{\rm inc} = \binom{n}{2} - \binom{\overline{n}}{2}$$

*and the proof is done. Note also that, by using* (13)*, we have:* ( *n* <sup>2</sup>) <sup>=</sup> *nnc* <sup>+</sup> *<sup>s</sup>* <sup>+</sup> *ntt* <sup>+</sup> *ntu.*

This last remark motivates the next result.

**Corollary 1.** *Given two vectors* **a***,* **b** *representing incomplete rankings of n elements with ties and their corresponding matrices A* = (*Aij*) *and B* = (*Bij*)*, it holds that*

$$\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{i\bar{j}} B\_{i\bar{j}} = \overline{n}(\overline{n} - 1) - 4s - 2n\_{\text{flu}} \tag{24}$$

*where n is the number of common ranked elements in both rankings—see* (9)*—s is the number of crossings, that is, the number of pairs* {*i*, *j*}*, such that ai* < *aj and bi* > *bj or ai* > *aj and bi* < *bj, and ntu is the number of pairs that are tied in only one ranking (*from tie to untie or viceversa*), that is, such that ai* <sup>=</sup> *aj and bi* <sup>=</sup> *bj, or ai* <sup>=</sup> *aj and bi* <sup>=</sup> *bj.*

With (24), it is easy to obtain the maximum and minimum of the expression ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij*. When *<sup>s</sup>* <sup>=</sup> 0 and *ntu* <sup>=</sup> 0 we have *<sup>n</sup>*

$$\sum\_{i=1}^{n} \sum\_{j=1}^{n} A\_{i\bar{j}} B\_{i\bar{j}} = \overline{n}(\overline{n} - 1)$$

that is the maximum value of ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij*. Analogously, by taking *<sup>s</sup>* <sup>=</sup> ( *n* <sup>2</sup>), that is the maximum number of crossings and consequently *ntu* <sup>=</sup> 0, we obtain from (24)

$$\sum\_{i=1}^{n}\sum\_{j=1}^{n}A\_{ij}B\_{ij} = \overline{n}(\overline{n}-1) - 4\binom{\overline{n}}{2} = -\overline{n}(\overline{n}-1)$$

that is the minimum value of ∑*<sup>n</sup> <sup>i</sup>*=<sup>1</sup> <sup>∑</sup>*<sup>n</sup> <sup>j</sup>*=<sup>1</sup> *AijBij*. These facts, that are in agreement with the results shown in [12], explain why *<sup>τ</sup><sup>x</sup>* defined by (8) takes values in [−1, 1].

**Remark 4.** *By using* (7) *and* (24) *we obtain*

$$\pi\_{\mathfrak{X}} = \frac{\overline{n}(\overline{n} - 1)}{n(n - 1)} - \frac{4s + 2n\_{th}}{n(n - 1)} \tag{25}$$

*and from* (8) *and* (25) *we get*

$$
\hat{\pi}\_{\mathcal{X}} = 1 - \frac{4s + 2n\_{tu}}{\overline{n}(\overline{n} - 1)} \tag{26}
$$

**Remark 5.** *As we have pointed out in* (3)*, a* distance metric *<sup>d</sup>*(**a**, **<sup>b</sup>**) *can be transformed into a correlation coefficient <sup>τ</sup>*(**a**, **<sup>b</sup>**) *by the formula*

$$\tau(\mathbf{a}, \mathbf{b}) = 1 - \frac{2d(\mathbf{a}, \mathbf{b})}{d\_{\max}(\mathbf{a}, \mathbf{b})} \tag{27}$$

*Note that in expression* (14)*, when Ninc* <sup>=</sup> <sup>0</sup>*, the quantity <sup>n</sup>*(*<sup>n</sup>* <sup>−</sup> <sup>1</sup>) *is not the maximum value of the* distance metric *<sup>d</sup>*(**a**, **<sup>b</sup>**) = <sup>2</sup>*<sup>s</sup>* <sup>+</sup> *ntu* <sup>+</sup> *Ninc (see Example 6). This problem does not appear with the use of <sup>τ</sup>x since, by using* (26) *we can identify a "distance metric" given by d* -(**a**, **<sup>b</sup>**) = <sup>2</sup>*<sup>s</sup>* <sup>+</sup> *ntu and its maximum value is achieved when s* <sup>=</sup> *<sup>n</sup>*(*<sup>n</sup>* <sup>−</sup> <sup>1</sup>)/2 *(and consequently ntu* <sup>=</sup> <sup>0</sup>*) and has the value of*

$$\bar{d}\_{\max} = \overline{\pi} (\overline{\pi} - 1) / 2$$

*Therefore, <sup>τ</sup><sup>x</sup> should be preferred over τ<sup>x</sup> in terms of normalization (see [12] for other considerations). This fact will be useful for the definition that we will introduce in Section 6.*

In the next examples, we illustrate the two previous remarks. Note that when *<sup>s</sup>* <sup>=</sup> 0 and *ntu* <sup>=</sup> <sup>0</sup> then, by (26), *<sup>τ</sup><sup>x</sup>* <sup>=</sup> 1 and it is not affected by the presence of • in the rankings. By analogy with (4), we denote the *Normalized Mean Strength* of **a** and **b** as

$$NS(\mathbf{a}\_1, \mathbf{a}\_2) = \frac{(1 - \tau\_{\mathbf{x}})}{2}, \quad \text{and} \quad \widehat{NS}(\mathbf{a}\_1, \mathbf{a}\_2) = \frac{(1 - \widehat{\tau}\_{\mathbf{x}})}{2}.$$

**Example 3.** *Let* **<sup>a</sup>**<sup>1</sup> = [1, 2, 3, •, •, •] *and* **<sup>a</sup>**<sup>2</sup> = [1, •, 2, 3, •, •]*. It is easy to obtain: Ninc*(**a**1, **<sup>a</sup>**2) = <sup>14</sup>*, <sup>τ</sup>x*(**a**1, **<sup>a</sup>**2) = 0.1556*, NS*(**a**1, **<sup>a</sup>**2) = 0.4222*, <sup>τ</sup><sup>x</sup>*(**a**1, **<sup>a</sup>**2) = <sup>1</sup>*, and NS* (**a**1, **<sup>a</sup>**2) = 0.0*.*

**Example 4.** *Let* **<sup>a</sup>**<sup>1</sup> = [1, 2, 3, 4, •, •] *and* **<sup>a</sup>**<sup>2</sup> = [1, •, 2, 3, 4, •]*. It is easy to obtain: Ninc*(**a**1, **<sup>a</sup>**2) = <sup>12</sup>*, <sup>τ</sup>x*(**a**1, **<sup>a</sup>**2) = 0.2*, NS*(**a**1, **<sup>a</sup>**2) = 0.4*, <sup>τ</sup><sup>x</sup>*(**a**1, **<sup>a</sup>**2) = <sup>1</sup>*, and NS* (**a**1, **<sup>a</sup>**2) = 0.0*.*

The next example shows the results when a ranking is compared to itself and its reverse ranking for the case of complete rankings (note that *<sup>τ</sup><sup>x</sup>* <sup>=</sup> *<sup>τ</sup><sup>x</sup>* since *<sup>n</sup>* <sup>=</sup> *<sup>n</sup>*).

**Example 5.** *Let* **<sup>a</sup>**<sup>1</sup> = [1, 2, 3, 4, 5, 6] *and* **<sup>a</sup>**<sup>2</sup> = [6, 5, 4, 3, 2, 1]*. Then*


The next example shows that *τ<sup>x</sup>* does not take its limit values when the rankings are incomplete and that *<sup>τ</sup>x* is not defined when there are no elements in common in both rankings.

**Example 6.** *Let* **<sup>a</sup>**<sup>1</sup> = [1, 2, 3, •, •, •]*,* **<sup>a</sup>**<sup>2</sup> = [•, •, •, 3, 2, 1]*,* **<sup>a</sup>**<sup>3</sup> = [1, 2, 3, 4, •, •]*, and* **<sup>a</sup>**<sup>4</sup> <sup>=</sup> [•, •, 4, 3, 2, 1]*, Then*


Our main practical result in this paper is *the definition of a measure to deal not only with two rankings* **a**<sup>1</sup> *and* **a**2*, as we have seen so far, but with a series of incomplete rankings with ties* {**a**1, **a**2, ... **a***m*} *in which, in practical situations, some kind of time evolution is presented* (e.g., a sport ranking during a session where there may be ties or inclusion/elimination of teams, charts of songs ordered on a daily/weekly basis, etc.). In order to define this measure, it will be useful to recall some concepts defined for complete rankings.

#### **5. Treatment of More Than Two Complete Rankings. Known Results**

To study the evolution of more than two rankings we will use the concept of Kendall distance defined in [10], where some weights were introduced to measure the changes when passing from one ranking to the next. After that, we will recall how to extend this definition to a series of *m* complete rankings, as in [13].

#### *5.1. Kendall Distance for Complete Rankings with Penalty Parameters*

We recall the definition of Kendall distance with penalty parameters *p* and *q* from [10,13].

**Definition 1.** *Let* **<sup>a</sup>** *and* **<sup>b</sup>** *be two complete rankings with ties of the set <sup>N</sup>* <sup>=</sup> {1, ... , *<sup>n</sup>*}*, and penalty parameters p* <sup>∈</sup> [0, <sup>1</sup> <sup>2</sup> ] *and q* <sup>∈</sup> [0, <sup>1</sup> <sup>2</sup> ]*. The Kendall distance with penalty parameters p and q is defined as*

$$K^{(p,q)}(\mathbf{a}, \mathbf{b}) = \sum\_{\{i,j\} \in \mathcal{N}} \mathcal{K}^{(p,q)}\_{i,j}(\mathbf{a}, \mathbf{b}) \tag{28}$$

*where K*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* (**a**, **<sup>b</sup>**) *is computed according to the following cases:*

*Case 1: If i and j are not tied in* **a***, nor in* **b***. If they cross their positions when passing from* **a** *to* **b** *then K*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* <sup>=</sup> <sup>1</sup>*. Otherwise, <sup>K</sup>*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* <sup>=</sup> <sup>0</sup>*.*

*Case 2: If i and j are tied in both* **a** *and* **b***. Then K*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* <sup>=</sup> *q.*

*Case 3: If i and j are tied only in one ranking. Then K*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* <sup>=</sup> *p.* **Remark 6.** *The penalty parameters p and q are bounded and take into account the cases where there exist tied elements in* **a***, in* **b***, or in both. For our purposes of measuring competitiveness, it is reasonable to assign <sup>p</sup>* = 1/2*, to represent that they are tied in one ranking, and <sup>q</sup>* = <sup>0</sup> *to represent that they are tied in both of them. These assignments are inspired by [10]. In particular, they proved that <sup>p</sup>* <sup>∈</sup> [0.5, 1] *in order to get that <sup>K</sup>*(*p*,0) *was a metric.*

**Remark 7.** *Note that, by using the notation introduced in Theorem 1, it is easy to see that*

$$K\_{i,j}^{(p,q)}(\mathbf{a}, \mathbf{b}) = s + p \, n\_{tu} + q \, n\_{ft}$$

*where ntt is the number of pairs* {*i*, *<sup>j</sup>*} *that go from tie to tie. Therefore, by using* (14) *with Ninc* <sup>=</sup> <sup>0</sup> *we get*

$$\tau\_{\mathbf{x}}(\mathbf{a}, \mathbf{b}) = 1 - \frac{4K^{(0.5, 0)}(\mathbf{a}, \mathbf{b})}{n(n-1)} \tag{29}$$

*that is, once more, a relation of the form* (3)*. We see here another consequence of Theorem 1: it opens the possibility of defining new metrics based on putting penalties to the cases n*••*, n*•∗*, etc. since it gives an explicit expression on these cases.*

With the previous definitions, we can deal with the general case of the study of a series of complete rankings. We do this in the next section.

### *5.2. Series of Complete Rankings with Ties*

In [13], it was shown how to extend Definition 1 to *m* complete rankings with ties in a natural way. We recall these definitions here because they will be extended in Section 6 to a series of incomplete rankings.

**Definition 2.** *Given m complete rankings with ties* **a**1, **a**2, ... **a***<sup>m</sup> of n elements, we define the evolutive Kendall distance with penalty parameters p and q as*

$$K\_{\varepsilon\upsilon}^{(p,q)}(\mathbf{a}\_1, \mathbf{a}\_2, \dots, \mathbf{a}\_m) = \sum\_{i=1}^{m-1} K^{(p,q)}(\mathbf{a}\_i, \mathbf{a}\_{i+1}) \,. \tag{30}$$

When handling *m* rankings it is natural to include a new case (see [13]) that consists of a series of ties between a crossing (see Example 7 further on). Thus it is convenient to define a new case in the definition of *<sup>K</sup>*(*p*,*q*) *ev* (**a**1, **<sup>a</sup>**2,..., **<sup>a</sup>***m*) according to the following rule.

**Definition 3.** *Given m complete rankings with ties* **a**1, **a**2, ... **a***<sup>m</sup> of n elements, we define the* crossing after ties *coefficient K*¯ *cat <sup>i</sup>*,*<sup>j</sup>* (**a**1, **<sup>a</sup>**2,..., **<sup>a</sup>***m*) *following the rule*

*Case 4. If there exists a maximal set of rankings* **<sup>a</sup>***t*<sup>1</sup> , ... , **<sup>a</sup>***tk such that for each* <sup>=</sup> 1, ... , *<sup>k</sup> the pair* {*i*, *<sup>j</sup>*} *is not tied in* **<sup>a</sup>***t , but is tied in* **<sup>a</sup>***t*+1, **<sup>a</sup>***t*+2, ... , **<sup>a</sup>***t*+*s, with <sup>s</sup>* <sup>≥</sup> <sup>1</sup>*, it is not tied in* **<sup>a</sup>***t*+*s*+<sup>1</sup> *and, moreover,* {*i*, *<sup>j</sup>*} *exchange their relative positions between* **<sup>a</sup>***t and* **<sup>a</sup>***t*+*s*+1*. In this case <sup>K</sup>*¯ *cat <sup>i</sup>*,*<sup>j</sup>* (**a**1, **<sup>a</sup>**2, ... , **<sup>a</sup>***m*) = *k, where k is the number of rankings in the maximal set of rankings* **a***t*<sup>1</sup> , ... , **a***tk verifying the aforementioned property.*

**Example 7.** *Given the rankings with ties*


*the corresponding* **a***<sup>i</sup> are*


*we have that the only nonzero* crossing after ties *coefficient is*

$$
\bar{K}\_{1,2}^{\mathrm{cut}}(\mathbf{a}\_1, \mathbf{a}\_2, \dots, \mathbf{a}\_6) = 2
$$

*since we have the appearance of the two series*


*that show a series of ties between a crossing of the pair* {*<sup>i</sup>* = 1, *<sup>j</sup>* = <sup>2</sup>}*.*

By including the cases given by Definition 3 in the sum defined in Definition 2, in [13] a *corrected* evolutive distance in the following form is defined.

**Definition 4.** *Given m complete rankings with ties* **a**1, **a**2, ... **a***<sup>m</sup> of n elements we define the corrected evolutive Kendall distance with penalty parameters p and q as follows:*

$$K\_{\rm ccv}^{(p,q)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m) = K\_{\rm ccv}^{(p,q)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m) + \sum\_{\{i,j\}} \mathcal{K}\_{i,j}^{cat}(\mathbf{a}\_1, \dots, \mathbf{a}\_m),\tag{31}$$

*where the summation is over the pairs* {*i*, *j*} *that verify Case 4 in Definition 3.*

Following the same argument as in [13], it is easy to show that

$$\max \left[ K\_{\text{cv}}^{(0.5,0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m) \right] = \frac{1}{2} (m-1) n(n-1) \tag{32}$$

Now, in analogy with (3) and (14), the Kendall's evolutive coefficient *τev* for a series of *m* complete rankings with ties can be defined as

$$\pi\_{\text{cv}}(\mathbf{a}\_1, \mathbf{a}\_2, \dots, \mathbf{a}\_{\text{wl}}) = 1 - \frac{4K\_{\text{ccv}}^{(0.5, 0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_{\text{ll}})}{(m - 1)n(n - 1)} \quad \in [-1, 1] \tag{33}$$

With these previous definitions we can present the new coefficients for incomplete rankings with ties.

#### **6. New Coefficients for Series of Incomplete Rankings with Ties**

Given a series {**a**1, **a**2, ... , **a***m*} of incomplete rankings with ties, for each pair of rankings **a***<sup>i</sup>* and **a***<sup>j</sup>* we can use Definitions 1–4 straightforwardly to also apply for a series of incomplete rankings by assuming that there is no penalty for the case of absent elements (regarding Definitions 1 and 2) and that these absent elements (denoted by '•') do not contribute to either ties or to *crossings after ties* (regarding Definitions 3 and 4). That is, those definitions are applied as they are, ignoring the effect of the absent elements.

Keeping this in mind and, in analogy with (14), given a series of *m* incomplete rankings we could include the effect of the incomplete cases by defining

$$\pi\_{cv}^\* = 1 - \frac{2d\_{cvol}(\mathbf{a}\_1, \mathbf{a}\_2, \dots, \mathbf{a}\_m)}{\max(d\_{cvol})} \tag{34}$$

with

$$d\_{\rm evol}(\mathbf{a}\_1, \mathbf{a}\_2, \dots, \mathbf{a}\_m) = 2K\_{\rm cav}^{(p=0.5, q=0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m) + \sum\_{i=1}^{m-1} N\_{\rm inc}(\mathbf{a}\_i, \mathbf{a}\_{i+1})$$

where *Ninc*(**a***i*, **<sup>a</sup>***i*+1) is the number of incomplete cases when passing from ranking **<sup>a</sup>***<sup>i</sup>* to ranking **<sup>a</sup>***i*+1. Note that the explicit form of *Ninc*(**a***i*, **<sup>a</sup>***i*+1) for each pair of consecutive rankings is given by (11) in Theorem <sup>1</sup> and Corollary 1. The value of max(*devol*) depends on *Ninc*(**a***i*, **<sup>a</sup>***i*+1). We have seen in Remark <sup>5</sup> that the definition of *<sup>τ</sup><sup>x</sup>* corresponds to take *dmax*(**a**, **<sup>b</sup>**) as the value corresponding to *Ninc* <sup>=</sup> <sup>0</sup> (and that is the reason why *τ<sup>x</sup>* is not well normalized). We can translate here the same reasoning and formalize it in the next definition.

**Definition 5.** *Given m incomplete rankings with ties* **a**1, **a**2, ... **a***<sup>m</sup> of n elements we define the corrected evolutive Kendall's <sup>τ</sup> coefficient for the series with penalty parameters p* = 0.5 *and q* = <sup>0</sup> *as follows:*

$$\tau\_{cv}^{\bullet} = 1 - \frac{4K\_{cvv}^{(0.5,0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m) + 2\sum\_{i=1}^{m-1} N\_{inc}(\mathbf{a}\_i, \mathbf{a}\_{i+1})}{(m-1)n(n-1)} \tag{35}$$

*where K*(0.5,0) *cev* (**a**1,..., **<sup>a</sup>***m*) *is given by Definition 4, and Ninc*(**a***i*, **<sup>a</sup>***i*+1) *is given by* (11)*.*

Here we have the same drawback as we showed for *τ<sup>x</sup>* in Remark 5: *τ*• *ev* is not properly normalized and it cannot get the values <sup>±</sup>1 if any *Ninc*(**a***i*, **<sup>a</sup>***i*+1) <sup>=</sup> 0. Therefore, in analogy with (26), we introduce a new coefficient in the following definition.

**Definition 6.** *Given <sup>m</sup> incomplete rankings with ties* **<sup>a</sup>**1, **<sup>a</sup>**2, ... **<sup>a</sup>***<sup>m</sup> of <sup>n</sup> elements, such that ni*,*i*+<sup>1</sup> <sup>&</sup>gt; <sup>1</sup>*, for all <sup>i</sup>* = 1, 2, ... , *<sup>m</sup>* <sup>−</sup> <sup>1</sup>*, we define the scaled corrected evolutive Kendall's <sup>τ</sup> coefficient for the series with penalty parameters p* = 0.5 *and q* = <sup>0</sup> *as follows:*

$$\hat{\mathbf{r}}\_{cv}^{\bullet} = 1 - \frac{2\mathcal{K}\_{cvv}^{(0.5,0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m)}{\max(\mathcal{K}\_{cvv}^{(0.5,0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m))}\tag{36}$$

*where K*(0.5,0) *cev* (**a**1,..., **<sup>a</sup>***m*) *is given by Definition <sup>4</sup> and with*

$$\max\left[\mathbb{K}\_{\text{cvv}}^{(0.5,0)}(\mathbf{a}\_1, \dots, \mathbf{a}\_m)\right] = \frac{1}{2} \sum\_{i=1}^{m-1} \overline{\eta}\_{i,i+1} (\overline{\eta}\_{i,i+1} - 1) \tag{37}$$

*where ni*,*i*+<sup>1</sup> *denotes the common ranked elements between* **<sup>a</sup>***<sup>i</sup> and* **<sup>a</sup>***i*+1*.*

Note that we need that, for some *<sup>i</sup>*, *ni*,*i*+<sup>1</sup> <sup>=</sup> 0.

**Remark 8.** *In the limit case of m complete rankings with ties, note that Equation* (37) *collapses to Equation* (32)*. Note also that <sup>τ</sup>*-• *ev is affected by the crossings, the pass from tie to untie (or viceversa) and the* long crossings *(crossings after ties given by K*¯ *cat <sup>i</sup>*,*<sup>j</sup>* (**a**1, **<sup>a</sup>**2, ... , **<sup>a</sup>***m*)*, given by Definition 3), due to the term* <sup>2</sup>*K*(*p*=0.5,*q*=0) *cev* (**a**1, ... , **<sup>a</sup>***m*)*. The effect of the elements that are out of the rankings appear explicitly by the term ni*,*i*+<sup>1</sup> *that does not take into account the position in* **<sup>a</sup>***<sup>i</sup> nor in* **<sup>a</sup>***i*+1*. <sup>τ</sup>*-• *ev is well normalized, that is <sup>τ</sup>*-• *ev* <sup>∈</sup> [−1, 1]*.*

**Example 8.** *Let <sup>n</sup>* <sup>=</sup> <sup>6</sup>*. Given the series of incomplete rankings with ties* **<sup>a</sup>**<sup>1</sup> = [1, 2, 3, 4, 5, 6]*,* **<sup>a</sup>**<sup>2</sup> <sup>=</sup> [1, 2, 3, •, •, •]*, and* **<sup>a</sup>**<sup>3</sup> = [1, 2, •, •, •, •]*, an easy computation shows Kcev*(**a**1, **<sup>a</sup>**2, **<sup>a</sup>**3) = <sup>0</sup> *and thus <sup>τ</sup>*-• *ev* <sup>=</sup> <sup>1</sup>*. Note that τ*• *ev* <sup>=</sup> 0.1333*.*

**Example 9.** *Let <sup>n</sup>* <sup>=</sup> <sup>6</sup>*. Given the series of incomplete rankings with ties* **<sup>a</sup>**<sup>1</sup> = [1, 2, 3, 4, 5, 6]*,* **<sup>a</sup>**<sup>2</sup> <sup>=</sup> [3, 2, 1, •, •, •]*, and* **<sup>a</sup>**<sup>3</sup> = [1, 2, •, •, •, •]*, it is easy to obtain that Kcev*(**a**1, **<sup>a</sup>**2, **<sup>a</sup>**3) = <sup>4</sup> <sup>=</sup> max(*Kcev*) *and thus τ*-• *ev* <sup>=</sup> <sup>−</sup>1*. Note that <sup>τ</sup>*• *ev* <sup>=</sup> <sup>−</sup>0.1333*.*

As we have seen in the above definitions, the importance of Theorem 1 and Corollary 1 consists of giving the explicit formula for *Ninc*(**a***i*, **<sup>a</sup>***i*+1) to allow for the computation of the coefficient *<sup>τ</sup>*-• *ev* for the series of *<sup>m</sup>* incomplete rankings with ties. Note that *<sup>τ</sup>*-• *ev* <sup>∈</sup> [−1, 1]. For the particular case when the rankings are complete, we have *Ninc*(**a***i*, **<sup>a</sup>***i*+1) = 0 for all the pairs of consecutive rankings and *ni*,*i*+<sup>1</sup> <sup>=</sup> *<sup>n</sup>*, for *<sup>i</sup>* <sup>=</sup> 1, 2, ... , *<sup>m</sup>* <sup>−</sup> 1, and therefore Equation (36) reduces to the complete case given by Equation (33), that is, *<sup>τ</sup>*-• *ev* collapses to *τev*.

Another contribution of Theorem 1 and Definition 6 is that they are useful to describe the behavior of the series of *m* rankings in terms of a competitivity graph. We can define a weighted graph for each one of the interactions between the elements when passing from **<sup>a</sup>***<sup>i</sup>* to **<sup>a</sup>***i*+1: crossings, passing from tie to untie (or vice-versa), and crossing after ties. Moreover, for each kind of graph, we can add the contributions of all the pairs of consecutive rankings to obtain a *projected graph* for any interaction (crossings, passing from tie to untie (or vice-versa), and crossing after ties). The procedure is the following: First, we construct an undirected graph for each pair of rankings **<sup>a</sup>***k*, **<sup>a</sup>***k*+<sup>1</sup> by identifying each element *i* as a node and defining an edge between *i* and *j* by the rule: there is an edge connecting {*i*, *<sup>j</sup>*} with weight *<sup>K</sup>*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* (**a***k*, **<sup>a</sup>***k*+1) when this weight is nonzero. By adding the *<sup>m</sup>* <sup>−</sup> 1 pairs of undirected graphs we obtain a projected graph with a total sum of weights *<sup>K</sup>*(*p*=0.5,*q*=0) *cev* (**a**1, ... , **<sup>a</sup>***m*). By adding the *crossing after ties* term to the projected graph we have all the ingredients appearing on Definition 6. We show this procedure by using the next example with *<sup>m</sup>* = 6 and *<sup>n</sup>* = 8.

**Example 10.** *Given the series of incomplete rankings with ties*


*the corresponding* **a***<sup>i</sup> are*


*In this example we have <sup>n</sup>* = <sup>8</sup>*, and an easy computation leads to the parameters shown in Table 4. For each pair of consecutive rankings it is easy to compute the parameters defined in Theorem 1: n*••*, n*•∗*, n*∗•*, n*∗∗*, s, ntu, and ntt. Then, by using Equation* (10) *in Theorem 1 we can obtain, for any pair of rankings, the value Ninc. n is the number of common elements, given by* (9)*. The coefficient τ*• *ev is given by* (35)*, and the coefficient <sup>τ</sup>*-• *ev is given by* (36)*. In analogy with* (4) *we can define the corresponding normalized mean strengths given by*

$$NS^\bullet = \frac{(1 - \tau\_{ev}^\bullet)}{2} \tag{38}$$

*and*

$$
\widehat{NS}^{\bullet} = \frac{(1 - \widehat{\tau}\_{cv}^{\bullet})}{2} \tag{39}
$$

*Finally, in Table <sup>4</sup> we include the coefficients <sup>τ</sup><sup>x</sup> and <sup>τ</sup>x given by* (7) *and* (8)*, respectively. These last coefficients are included to show that our new coefficients τ*• *ev and <sup>τ</sup>*-• *ev reduce to them when only a pair of rankings are considered.*


**Table 4.** Parameters for pairs of consecutive rankings. Example 10.

To compute our new coefficients *τ*• *ev* and *<sup>τ</sup>*-• *ev* for the whole series of rankings **a**<sup>1</sup> to **a**<sup>6</sup> we need some previous parameters. First, we need the value

$$\sum\_{i=1}^{5} N\_{\text{inc}} \left( \mathbf{a}\_{i\prime} \,\mathbf{a}\_{i+1} \right) = 52$$

To compute *<sup>K</sup>*(*p*=0.5,*q*=0) *cev* (**a**1, ... , **<sup>a</sup>**6), given by (31), we need to know, previously, the value of the *crossing after ties* coefficients *K*¯ *cat <sup>i</sup>*,*<sup>j</sup>* (**a**1, ... , **<sup>a</sup>**6), given by Definition 3. Note that the unique long crossing occurs for the pair {1, 4}: the elements tagged as 1 and 4 are such that 4 is above 1 in **r3**, both elements are tied in rankings **r**<sup>4</sup> and **r**5, and, finally, 4 is below 1 in ranking **r**6. Note, for example, that the pair {5, 7} does not accomplish the conditions of crossing after ties. Therefore the only term that contributes to <sup>∑</sup>{*i*,*j*} *<sup>K</sup>*¯ *cat <sup>i</sup>*,*<sup>j</sup>* is *<sup>K</sup>*¯ *cat* 1,4 (**a**1,..., **<sup>a</sup>**6) = 1.

With respect to *<sup>K</sup>*(*p*=0.5,*q*=0) *ev* (**a**1, ... , **<sup>a</sup>**6), given by (30), we need to compute the terms *K*¯(*p*, *<sup>q</sup>*) *<sup>i</sup>*,*<sup>j</sup>* (**ai**, **ai**+**1**), given by (28), for any pair of consecutive rankings. A detailed computation shows that, in this example, we have 42 *crossings* and 6 cases of *tie to untie or viceversa*. The precise pairs of elements that contribute to these cases are shown in the corresponding projected weighted graphs in Figure 1. The *crossing after ties* case is represented in Figure 2.

**Figure 1.** Projected weighted graphs representing the pairs of elements that contribute to *crossings* (**left panel**) and the pairs corresponding to the case *tie to untie or viceversa* (**right panel**), occurring in Example 10.

**Figure 2.** Projected weighted graph representing the *crossing after ties* cases occurred in Example 10. Therefore we have all the ingredients to compute *<sup>K</sup>*(*p*=0.5,*q*=0) *cev* . That is

$$\begin{aligned} K\_{\mathrm{cev}}^{(p=0.5,q=0)}(\mathbf{a}\_1,\ldots,\mathbf{a}\_6) &= \, ^t K\_{\mathrm{cev}}^{(p=0.5,q=0)}(\mathbf{a}\_1,\ldots,\mathbf{a}\_6) + \sum\_{\{i,j\}} \mathcal{R}\_{i,j}^{\mathrm{cut}}(\mathbf{a}\_1,\ldots,\mathbf{a}\_6) \\ &= \, ^t \sum\_{i=1}^5 K^{(p,q)}(\mathbf{a}\_i,\mathbf{a}\_{i+1}) + \sum\_{\{i,j\}} \mathcal{R}\_{i,j}^{\mathrm{cut}}(\mathbf{a}\_1,\ldots,\mathbf{a}\_6) \end{aligned}$$

and, by Remark (7), we know that

$$K\_{i, \vec{l}}^{(p, q)}(\mathbf{a}, \mathbf{b}) = \mathbf{s} + p \, n\_{\rm tr} + q \, n\_{\rm tr}$$

Therefore, we have

$$\begin{aligned} K\_{\text{ctr}}^{(p=0.5,q=0)}(\mathbf{a}\_1,\dots,\mathbf{a}\_6) &= \begin{array}{c} (9+12+8+9+4) + 0.5(2+0+2+1+1) + \bar{K}\_{1,4}^{\text{cat}}(\mathbf{a}\_1,\dots,\mathbf{a}\_6) \\ &= \ 42+3+1 = 46. \end{array} \end{aligned}$$

By using (35), we obtain

$$\tau\_{cv}^{\bullet} = 1 - \frac{4 \cdot 46 + 2 \cdot 52}{(6 - 1)8 \cdot 7} = 1 - 1.0286 = -0.0286$$

that corresponds to an equivalent normalized mean strength

$$NS^\bullet = \frac{(1 - \tau\_{\rm ev}^\bullet)}{2} = 0.5143$$

Finally, regarding *<sup>τ</sup>*-• *ev*, we have

$$\hat{\mathbf{r}}\_{ev}^{\bullet} = 1 - \frac{2 \cdot 46}{\frac{1}{2}(6 \cdot 5 + 7 \cdot 6 + 7 \cdot 6 + 7 \cdot 6 + 5 \cdot 4)} = 1 - \frac{4 \cdot 46}{176} = -0.0455$$

that corresponds to

$$\text{\(\%\}}^{\bullet} = 0.5227...$$

All in all, we conclude that *<sup>τ</sup>*-• *ev* is a proper coefficient for the evaluation of *m* incomplete rankings with ties and can be considered as a natural extension of the coefficient *<sup>τ</sup>x* presented in [12]. In the next section we apply the new coefficients *τ*• *ev* and *<sup>τ</sup>*-• *ev* to real rankings appearing on Spotify charts.

#### **7. Results**

Spotify is one of the major music streaming services worldwide, with 299 million monthly active users, as of July 2020 [28]. The company Spotify Technology S.A. has been listed on the New York Stock Exchange since 2018. As of September 2020, the company offers a catalog of 60 million tracks and operates in 92 countries from Albania to Vietnam [29]. Spotify divides the monthly active users into four regions [30]: Europe (35%), North America (26%), Latin America (22%) and rest of the world (17%). The app is available on several devices, such as computers, smartphones, tablets, wearable devices, etc. The users can choose between a free service (called *Freemium* or *Ad-Supported*) or a *Premium* service. In any case, the user can listen by streaming any song of the catalog (that is, the user does not own the song's digital file, but can listen to it). It is accepted that music streaming services have transformed the entire music market—see [31]—and they have evolved very fast, changing their services and capabilities. For example, Spotify has signed some partnerships with Microsoft [32], Sony [33] and Facebook [34] among other big companies. There exists a large amount of literature about Spotify, but it is mainly focused on Economics and Music. To the best of our knowledge, a small number of papers are devoted to the mathematical aspects of the rankings produced by Spotify. Among these papers, we have [35,36]. A paper that studies the relationship between personality and type of music is [37]. See [38] for more details about Spotify.

Like other services on the Internet, Spotify provides some chart lists (song rankings) based on the platform's number of streamings. To this kind of rankings belongs the Top 200 (see [39–41]), that is one of the topics of our study. Another ranking that we are interested in is called *Viral 50* which is an evolution of the original Social 50 ranking (see [42–44]) that incorporated in the song chart the effect of the social sharing of a track by Spotify users. This sharing included platforms such as Facebook and Twitter. It is not completely clear for us how this rank is computed, but it aims to gather *fresh* songs that acquire high impact on social networks by new release promotions, special apparitions on tv-shows, music festivals, tours, etc. (see [45] for an example of how a viral song transformed into a Top 100 song in 2013).

Due to the situation caused by the COVID-19 pandemic, the live music business reflected some drawbacks, such as festivals being cancelled worldwide, a reduction in public-performance licensing, and other related factors—see [46]. As an example, Warner Music Group Corp showed a total revenue fall of 1.7% in the first quarter of 2020 compared to the first quarter of 2019 [47]. Spotify also reported some impact on their business, but in the first quarter of 2020, it seemed that the consumption recovered and monthly active users increased faster in the first quarter of 2020 than in the same period of 2019 [30]. Some perturbations in Spotify streaming were also reported by the music analytic company Chartmetric that observed a change in the type of consumption of Spotify streamings by music genre in the period between 3 March 2020 to 9 April 2020, concluding that it seemed that it had been a *pandemic-induced lifestyle change* [48].

With regard to the Top 50 viral, it is reasonable to think that the fact that many artists (such as Lady Gaga, Alicia Keys, and Cardi B. [46]) have postponed big releases may have decreased the movements in these charts.

#### *7.1. Method to Convert Spotify Lists into Incomplete Rankings*

Both Spotify Top 200 and Viral 50 lists can be treated as incomplete rankings since some elements (songs) quit the list and some others that appear on the list (new songs). Let us call any of these rankings as Top *k* rankings. In order to handle these Top *k* rankings, our methodology consists of the following steps:

	- (a) The first *k* entries of **r***<sup>i</sup>* are copied from **t***i*;
	- (b) The rest of the entries form a vector **s***<sup>i</sup>* and come from the the elements that quit from **t***i*−<sup>1</sup> plus the elements that, being in **s***i*−1, are not included in **t***i*.

These *n* − *k* elements preserve their relative order. This order is not important since these elements are not included in the Top *k* ranking **t***i*.

5. From each **t***i*, we construct the corresponding incomplete ranking **a***<sup>i</sup>* given by (5).

**Example 11.** *Let us consider three Top 4 lists (***v**1, **v**2, **v**3*) and construct the corresponding three rankings (***a**1, **<sup>a</sup>**2, **<sup>a</sup>**3*). Here we have m* = <sup>3</sup> *and k* = <sup>4</sup>*.*


*We have denoted as* **s***<sup>i</sup> the elements beyond the k position in each ranking* **r***i. The rankings* **a***<sup>i</sup> are constructed looking at* **r***<sup>i</sup> from positions* 1 *to* 4*. Since the elements that do no belong to* **t***<sup>i</sup> are in* **s***i, we tagged them as* •*.*

#### *7.2. Comparison of Two Series of Top 200 Rankings*

From the site [49] we downloaded the series of Top 200 (Global) rankings corresponding to the following time intervals:


The term *Global* means that the charts were produced from streaming on Spotify from all over the world. By using the methodology explained in the previous section, we convert the 18 downloaded rankings to a series of incomplete rankings (with no ties) **a**1, ... , **a**18, and we compute our parameters. This is repeated for each considered year. The results are shown in Table 5.

**Table 5.** Parameters for two series of incomplete rankings obtained from Spotify Top 200 lists.


In Table <sup>5</sup> we have denoted by <sup>&</sup>lt; *ni*,*i*+<sup>1</sup> <sup>&</sup>gt; the average of {*ni*,*i*+1} for *<sup>i</sup>* <sup>=</sup> 1, 2, ... , 17, that is the mean number of common elements from each pair of consecutive rankings. We see that the number of songs involved in the 2019 series is *<sup>n</sup>* = 474, which is lower than the 2020 series number. This fact could indicate that there was more *activity* in the 2020 series since more new songs appeared than the previous year. By extension, we can also conclude that the *activity* on Spotify of the users was higher in the 2020 series.

The same tendency is observed by looking at *Ninc* and *ni*,*i*+1. Our coefficients *NS*• and *NS* • corroborate this intuition since they take higher values in the 2020 Series than in the 2019 Series. Analogously, by looking at *τ*• *ev* and *<sup>τ</sup>*-• *ev*, we see a decrease when comparing the 2019 Series with the 2020 Series. Recall that the coefficients *NS*• and *NS* • introduced in this paper offer a measure of the *movements* in the rankings, since they take into account the number of crossings and, in this case, that we do not have ties, due to the effect of absent elements.

In the same manner, as we did in Example 10, we can construct the projected graph corresponding to the crossings for each series. We show these graphs in Figure 3, that have been plotted with MATLAB by using the option "subspace".

**Figure 3.** Graph based on crossings corresponding to the giant connected component of Top 200 2019 Series (**left panel**, 360 nodes, 16,115 edges) and Top 200 2020 Series (**right panel**, 374 nodes, 16,564 edges).

#### *7.3. Comparison of Two Series of Viral-50 Rankings*

From the site [50], we downloaded the series of Viral 50 (Global) weekly rankings corresponding to the following periods:


For each considered year, we convert the 18 downloaded rankings to a series of incomplete rankings (with no ties) **a**1, ... , **a**18, and we computed again the aforementioned parameters. The results are shown in Table 6.



The number of songs involved in the 2019 series is *<sup>n</sup>* = 315, that is greater than the number involved in the 2020 series. This fact could indicate that there was less viral *activity* in the 2020 series since fewer new songs appeared than the previous year. The same tendency is observed at *Ninc*. This intuition is corroborated by our coefficients. *NS*• and *NS* • since they take lower values in the 2020 series than in the 2019 series. We also see an increase in *τ*• *ev* and *<sup>τ</sup>*-• *ev* when comparing the 2019 series with the 2020 series.

If we compare these results with those obtained in the previous section, we conclude that Spotify's viral activity was negatively affected by the Pandemic. This may seem reasonable since many events that produce sharing in Social Networks, such as shows, new releases, and performances, were postponed during these months, as we have already discussed. We again plot the projected graph corresponding to the crossings for each series in Figure 4.

**Figure 4.** Graph based on crossings corresponding to the giant connected component of Viral-50 2019 Series (**left panel**, 185 nodes, 1685 edges) and Viral-50 2020 Series (**right panel**, 186 nodes, 1447 edges).

### *7.4. Comparison of a Series of Top 200 and a Series of Viral 50 Rankings*

Given that our coefficients *τ*• *ev*, *<sup>τ</sup>*-• *ev*, *NS*•, and *NS* • are normalized, we can compare series of rankings of different type. Looking at Tables <sup>5</sup> and 6, we conclude (e.g., looking at *NS* • ) that the Viral-50 rankings present more activity than the Top 200 rankings. For example in the 2019 series the value of *NS* • is 0.1982 for the Viral-50 rankings, and only 0.0730 for the Top 200 rankings. This conclusion seems reasonable, taking into account that the Viral-50 rankings are constructed by looking at the behaviours of songs that may rapidly change, since they are viral phenomena.

#### *7.5. Comparison of the Evolution of Two Series of Incomplete Ranking with Ties*

Spotify charts Top 200 do not present ties, but we can construct incomplete rankings with ties if we take into account the Top 200 ranking and the rest of the songs that appear in the whole studied interval. In detail, to obtain a series of incomplete rankings with ties from a Top 200 series on Spotify, we will consider the whole list of tracks along with the *m* rankings and focus on what happens in positions greater than 200. Using the terminology used in Example 11 we consider the elements that appear on the rankings, denoted as **s**1, **s**2, . . .. In this ranking we consider the following:


The next example with a series of *<sup>m</sup>* = 7 Top 4 charts illustrates this methodology.

**Example 12.** *Let us consider the series of seven Top 4 tracks* **<sup>v</sup>***<sup>i</sup> with <sup>n</sup>* <sup>=</sup> <sup>10</sup> *elements* {*A*, *<sup>B</sup>*, ... , *<sup>J</sup>*} *given by the rankings*


*from these rankings we construct the rankings* **t***<sup>i</sup> and* **s***<sup>i</sup> to obtain the rankings in the form*


*Now, we consider the rankings* **s***<sup>i</sup> as a series of incomplete rankings with ties with the convention explained above and we compute the corresponding* **a***<sup>i</sup> vectors to obtain the rankings*


*Note that, since there are at most two buckets, the entries of* **a***<sup>i</sup> belong to the set* {1, 2, •}*. Note also that in* **s**<sup>5</sup> *there is only one bucket.*

By using this methodology, we have converted the series of rankings studied in Section 7.2 to the corresponding series **a***<sup>i</sup>* with ties. The parameters obtained are shown in Table 7.


**Table 7.** Series of incomplete rankings with ties obtained from Spotify Top 200 charts.

If we look at *<sup>n</sup>*, *Ninc*, <sup>&</sup>lt; *ni*,*i*+<sup>1</sup> <sup>&</sup>gt;, and *NS* • in Table 7, we conclude that there has been more activity in the 2020 Series than in the 2019 Series. However, by looking at *NS*• (and *τ*• *ev*), the conclusion seems to be the reverse. Here we see, therefore, that *τ*• *ev* and *<sup>τ</sup>*-• *ev* can present different tendencies. This is related to the form in which they are normalized, as we have commented in Remark 5 and in Section 6. These results provide an example of how the transformation from *τ*• *ev* to *<sup>τ</sup>*-• *ev* is not linear, since *τ*• *ev* increases from 2019 to 2020 but *<sup>τ</sup>*-• *ev* decreases in the same period.

In Figure 5, we show the plot of the giant component corresponding to the projected graph showing the interactions of the form *tie to untie or viceversa*. That is, there is a link between elements (nodes) *i* and *j* when the pair {*i*, *j*} goes from tie to untie (or vice versa) in any pair of consecutive rankings **<sup>a</sup>***<sup>i</sup>* and **<sup>a</sup>***i*+1. We see many more interactions of this type in the 2020 series than in the 2019 series.

**Figure 5.** Graph based on crossings of the type *from tie to untie or vice versa* corresponding to the giant connected component of 2019 Series (**left**, 377 nodes, 49,915 edges) and 2020 Series (**right**, 457 nodes, 82,051 edges). We also have 97 isolated nodes in the 2019 Series and 99 in the 2020 Series.

In Figure 6, we show the plot of the giant component corresponding to the projected graph showing the interactions of the form *tie to tie*, that is, there is a link between elements (nodes) *i* and *j* when the pair {*i*, *<sup>j</sup>*} goes from tie to tie in any pair of consecutive rankings **<sup>a</sup>***<sup>i</sup>* and **<sup>a</sup>***i*+1. We also see many more interactions of this type in the 2020 series than in the 2019 series.

Therefore, and taking into account the values of Table 7, we can conclude (for this artificial model of incomplete ranking with ties) that there was more activity in the 2020 series than in the 2019 series.

**Figure 6.** Graph based on crossings of the type *from tie to tie* corresponding to the giant connected component of 2019 Series (**left**, 382 nodes, 65,269 edges) and 2020 Series (**right**, 462 nodes, 101,101 edges).

We have shown the application of the new coefficients introduced in this work, as long as the utility of the visualizations based on the projected graph plots of the (evolutive) competitive graph associated to a series of incomplete rankings with or without ties.
