You are on page 1of 10

International Journal of Computer Mathematics

Vol. 00, No. 00, February 2005, 1–10

From rankings’ collinearity to counting SDR’s via chromatic


list expression

LIVIU P. DINU∗ and IOAN TOMESCU


University of Bucharest, Faculty of Mathematics and Computer Science
Str. Academiei 14, 010014, Bucharest, Romania
Email: ldinu@funinf.cs.unibuc.ro, ioan@fmi.unibuc.ro
(Received May 2006)

The problem of counting rankings satisfying the collinearity condition with respect to two rankings
over the metric spaces of rank distance is treated in this paper by transforming it into finding the
number of systems of distinct representatives (abbreviated as SDR’s) with respect to associated set
systems. A formula for the chromatic list expression of graphs is then given in terms of the inclusion
and exclusion principle, followed by a formula for the number of SDR’s of set systems when the
graphs are complete.

Keywords: metrics, rank distance, collinearity condition, system of distinct representatives, L-


coloring, injective function, chromatic list expression, chromatic polynomial, complete graph

AMS Subject Classifications: 05C15, 68R15, 68N30

1 Introduction

We investigate here how many injections f there are from {1, . . . , n} to


{1, . . . , m} if the image of any integer 1 ≤ i ≤ n is constrained to be in a
subset Ai ⊆ {1, . . . , m}. The n-tuple (f (1), ..., f (n)) is known in the litera-
ture as a system of distinct representatives (abbreviated as SDR’s) of the set
system A1 , . . . , An [15].
More formally, the problem which we are confronted is:

Corresponding author. Email: ldinu@funinf.cs.unibuc.ro

c
International Journal of Computer Mathematics ISSN 0020-7160 print/ ISSN 1029-0265 online °2005 Taylor & Francis Ltd
http://www.tandf.co.uk/journals
DOI: 10.1080/00207160xxxxxxxxxxxxx
2 L.P. Dinu and I. Tomescu

PROBLEM 1.1 Let n and m be two natural numbers and let A1 , A2 , . . . , An


be n nonempty subsets of the set {1, 2, . . . , m}. How many SDR’s has this set
system?
The number of SDR’s of the set system A1 , ..., An ⊆ {1, ..., m} equals the
permanent of the incidence matrix of the elements 1, . . . , m for these subsets
[15].
We shall propose an alternative solution of Problem (1.1) in a more general
setting of graph colorings. First, we show that the fundamental reduction
theorem (FRT) for chromatic polynomials [2, 9] also holds for the chromatic
list expressions and then, by using the inclusion-exclusion principle we deduce
a general formula for the number of L-colorings of a given graph G.
The obtained results are used in the Application section in order to count
the rankings satisfying the collinearity condition with respect to two rankings
over the metric space of a particularly metric, namely rank distance.

2 Preliminaries

Let G be a finite simple graph having vertex set V (G) and edge set E(G).
Suppose that V (G) = {x1 , . . . , xn }. A (vertex) list assignment L on the graph
G associates a set Ai of colors with each vertex xi of G for i = 1, . . . , n. Each
Ai is interpreted as the set of allowed colors for vertex xi [11].
n
S
A mapping ϕ : V (G) → Ai is called a proper coloring of G if ϕ(u) 6= ϕ(v)
i=1
whenever vertices u and v are adjacent in G.
The graph G is said to be L − colorable (or list colorable, when L is under-
stood from context) if it admits a proper vertex-coloring ϕ such that ϕ(xi ) ∈ Ai
for all i = 1, . . . , n. Such a coloring will be called an L-coloring of G.
If |Ai | = k for all i = 1, . . . , n, then the list assignment L is called a k −
assignment.
Two L-colorings ϕ1 and ϕ2 of G are regarded as distinct if ϕ1 (x) 6= ϕ2 (x)
for some vertex x in G.
The number of distinct L-colorings of G will be denoted by E(G; A1 , . . . , An )
and will be referred as the chromatic list expression of G.
If A1 = A2 = . . . = An = {1, . . . , λ}, then the chromatic list expression of G
becomes the chromatic polynomial P (G, λ) of G [1, 2].
Qn
It is clear that if E(G) = ∅ then E(G; A1 , . . . , An ) = |Ai |.
i=1
Let x, y ∈ V (G). We write G|xy to denote the graph obtained from G by
identifying the vertices x and y, i.e., (i) by deleting both x and y and all the
edges incident to them, and (ii) by introducing a new vertex z and joining z to
both all the neighbors of x different from y and all the neighbors of y different
From rankings’ collinearity to counting SDR’s via chromatic list expression 3

from x in G.
Also, if xy ∈
/ E(G), we denote by G + xy the graph obtained by adding a
new edge xy to G.

3 Counting SDR’s via chromatic list expression

The fundamental reduction theorem (FRT) for chromatic polynomials [2, 9]


also holds for the chromatic list expressions in the following way.
Theorem 3.1 Let x1 and x2 be two non-adjacent vertices in a graph G with
list assignment consisting of sets A1 , . . . , An . Then

E(G; A1 , . . . , An ) = E(G + x1 x2 ; A1 , . . . , An ) + E(G|x1 x2 ; A1 ∩ A2 , A3 , . . . , An )


(1)

where the vertex obtained by identifying the vertices x1 and x2 has the set of
allowed colors equal to A1 ∩ A2 .
Proof Denote by F the graph G + xy with the sets of colors A1 , . . . , An and
by H the graph G|xy with the sets of colors A1 ∩ A2 , A3 , . . . , An defined as
above.
Let ϕ be an L-coloring of G. We have either (i) ϕ(x1 ) 6= ϕ(x2 ) or (ii)
ϕ(x1 ) = ϕ(x2 ).
The L-colorings of G in which x1 and x2 get distinct colors are in bijec-
n
S
tive correspondence with the L-colorings of F . Indeed, ϕ : V (G) → Ai
i=1
is an L-coloring of G with ϕ(x1 ) 6= ϕ(x2 ) if and only if ϕ is an L-coloring
of F . Thus, the number of L-colorings of G for which (i) holds equals
E(G + x1 x2 ; A1 , . . . , An ).
Similarly, the L-colorings of G in which x1 and x2 get the same color (that
belongs to the set A1 ∩A2 ) are in bijective correspondence with the L-colorings
of H, hence their number equals E(G|x1 x2 ; A1 ∩A2 , A3 , . . . , An ). The result thus
follows. ¤

Example 3.2 For example, let G = K1,2 with V (G) = {x1 , x2 , x3 }, E(G) =
{x1 x2 , x1 x3 } and the sets of colors A1 , A2 and A3 , respectively (see Figure 1).
By FRT (1) we have:
E(G; A1 , A2 , A3 ) = E(G1 ; A1 , A2 , A3 ) − E(G2 ; A1 ∩ A2 , A3 ) =
E(G3 ; A1 , A2 , A3 ) − E(G4 ; A1 ∩ A3 , A2 ) − (E(G5 ; A1 ∩ A2 , A3 ) − E(G6 ; A1 ∩
A2 ∩ A3 )) = |A1 ||A2 ||A3 | − |A2 ||A1 ∩ A3 | − |A3 ||A1 ∩ A2 | + |A1 ∩ A2 ∩ A3 |.
In Figure 1 vertices y1 , w1 and t1 were produced by contracting x1 and x2 , x1
and x3 , and y1 and x3 , respectively.
4 L.P. Dinu and I. Tomescu

Figure 1. Example

By using the inclusion-exclusion principle we can deduce a general formula


for the number of L-colorings of G.
Theorem 3.3 We have

X r
Y \
|W |
E(G; A1 , . . . , An ) = (−1) | Ai |, (2)
W ⊂E(G) k=1 xi ∈Ck

where C1 , . . . , Cr are the connected components of the spanning subgraph of G


induced by W .
Proof For each edge v = xi xj ∈ E(G), denote by Xv the set of all mappings
n
S
ϕ : V (G) → Ai such that ϕ(xs ) ∈ As for every s = 1, . . . , n and ϕ(xi ) =
i=1
ϕ(xj ) ∈ Ai ∩ Aj . It is clear that
n
Y [
E(G; A1 , . . . , An ) = |Ai | − | Xv | (3)
i=1 v∈E(G)

By the inclusion-exclusion principle we get


[ X \
| Xv | = (−1)|W |−1 | Xv |
v∈E(G) W ⊂ E(G) v∈W

W 6= ∅

If the edge set W 6= ∅ induces a spanning subgraph of G having connected


n
S
components C1 , . . . , Cr (1 ≤ r ≤ n − 1), each mapping ϕ : V (G) → Ai ,
i=1
From rankings’ collinearity to counting SDR’s via chromatic list expression 5

T
ϕ∈ Xv has the property that it has the same value on the vertices of each
v∈W T
component Ck (1 ≤ k ≤ r) and this value can be chosen in | Ai | ways.
xi ∈Ck
T r
Q T
It follows that | Xv | = | Ai | and (2) is a consequence of (3) be-
v∈W k=1 xi ∈Ck
n
Q
cause the term |Ai | is deduced for W = ∅, when r = n and Ci = {xi } for
i=1
i = 1, . . . , n. ¤

The first terms in the development of E(G; A1 , . . . , An ) are deduced for W = ∅


and for |W | = 1, respectively:
n
Y X n
Y
E(G; A1 , . . . , An ) = |Ai | − |Ai ∩ Aj | |Ak | + . . .
i=1 xi xj ∈E(G) k=1
k 6= i, j

For the graph G of Figure 1 the four terms in E(G; A1 , A2 , A3 ) correspond


to the cases when W = ∅, {x1 x2 }, {x1 x3 } and {x1 x2 , x1 x3 }, respectively.

To solve Problem 1.1 it may be observed that the SDR’s of the set sys-
tem A1 , . . . , An are L-colorings
µ ¶ of the complete graph Kn having vertex set
n
V (Kn ) = {1, . . . n} and edges, with list assignment L associating the set
2
Ai of colors with each vertex i for i = 1, . . . , n. Thus, we have the following:
Corollary 3.4 Let A1 , . . . , An be n sets. The number of SDR’s of this set
system is equal to

X X r
Y \
E(Kn ; A1 , . . . , An ) = (−1)k | Aj |, (4)
k≥0 W ⊂ E(Kn ) i=1 j∈Ci

|W | = k

where C1 , . . . , Cr (1 ≤ r ≤ n) denote the connected components of the spanning


subgraph of Kn induced by the edge set W ⊂ E(Kn ).
Note that Ph.Hall theorem provides a necessary and sufficient condition that
E(Kn ; A1 , ..., An ) 6= 0 [15].
r
Q T
If A1 , . . . An are pairwise disjoint then | Aj | = 0 unless W = ∅ and in
i=1 j∈Ci
6 L.P. Dinu and I. Tomescu

n
Q
this case E(Kn ; A1 , . . . , An ) = |Ai |. If A1 = . . . = An = A and |A| = m we
i=1
deduce E(Kn ; A, . . . , A)P= (m)n = m(m − 1) . . . (m − n + 1) since in this case
E(Kn ; A, . . . , A) = (−1)|W | mc(W ) , where c(W ) denotes the number
W ⊂E(Kn )
of connected components of the spanning subgraph of Kn induced by W . But
the last expression equals P (Kn , m) = (m)n , since the chromatic polynomial
of Kn is P (Kn , λ) = λ(λ − 1) . . . (λ − n + 1).

Of course, the algorithms of computing the chromatic list expression of a graph


of order n suggested by Theorems 3.1 and 3.3 are not polynomial in n and no
polynomial algorithm is known for calculating the chromatic polynomial of a
finite graph.

4 Application

The starting point of our application is the analysis of the situations when
the triangle inequality becomes equality in the case of rank distance. Rank
distance [5] is an ordinal metric able to compare different rankings of a set of
objects. It is tightly related to the Spearman’s footrule [4], and it had already
been successfully used in computational linguistics, in such problems as the
similarity of Romance languages [6], or in computational biology, in DNA
sequence comparison problem [8].
The problem of counting rankings satisfying the collinearity condition with
respect to two rankings over the metric spaces of rank distance is treated in
this section by transforming it into finding the number of systems of distinct
representatives with respect to associated set systems.
To measure the distance between two strings, the following strategy is used:
we scan (from left to right ) both strings and for each letter from the first
string we count the number of elements between its position in the first string
and the position of its first occurrence in the second string. Finally, we sum
all these scores and obtain the rank distance.

4.1 Rank distance

For its complete formalization, a few preliminary notations are defined below.
Let σ = (x1 > x2 > . . . > xn ) be a partial ranking over the universe U ; we say
that n is the length of σ. For an element x ∈ U ∩ σ one defines the order of
the object x in the ranking σ as ord(x | σ) = n + 1 − σ(x) (in other words one
assigns different weights to each element of the ranking, in decreasing order
from top to bottom, in the Borda sense -i.e., one assigns to the first element of
From rankings’ collinearity to counting SDR’s via chromatic list expression 7

the ranking the highest rank, i.e., n, to the second one n − 1, and so on, to the
final element the lowest rank, i.e., 1 ) ; if x ∈ U \ σ, we have ord(x | σ) = 0.
Definition 4.1 Given two partial rankings σ and τ over the same
universe, the rank distance between them is defined by: ∆(σ, τ ) =
P
|ord(x | σ) − ord(x | τ )| .
x∈σ∪τ

Example 4.2 Let σ = (1 > 2 > 3 > 4) and τ = (5 > 1 > 2) be rankings over the
universe U = {1, 2, 3, 4, 5}. According to Definition 4.1, we have:
P
∆(σ, τ ) = |ord(x | σ)−ord(x | τ )| = |4−2|+|3−1|+|2−0|+|1−0|+|0−3| =
x∈{1,...,5}
10.

4.2 On the collinearity condition

Let us consider U = {1, 2, . . . , n}. Let f and g be two rankings over U such
that |f | = |g| (f and g have the same length).
Firstly, we show in what circumstances is the collinearity condition satisfied:
Proposition 4.3 (collinearity condition) Let f, h, g be three rankings over
U such that |f | = |g| = |h|. The collinearity condition (∆(f, h) + ∆(h, g) =
∆(f, g)) is satisfied if and only if for every x ∈ f ∪ g ∪ h, one of the following
two conditions is satisfied:
(i) ord(x|f ) ≤ ord(x|h) ≤ ord(x|g);
(ii) ord(x|f ) ≥ ord(x|h) ≥ ord(x|g).
Proof In order to prove this result we use Definition 4.1 and the fact that
|a − b| + |b − c| = |a − c| if and only of a ≤ b ≤ c or a ≥ b ≥ c, for any
a, b, c ∈ R. ⊓

In other words, the collinearity is satisfied if and only if we do not have
peaks or valleys, i.e., when does not exist an element x with ord(x | h) <
min(ord(x | f ), ord(x | g)) or ord(x | h) > max(ord(x | f ), ord(x | g)).
Further, we investigate the density of rankings which satisfy this condition.
Actually, we have two problems:
PROBLEM 4.4 (First collinearity problem) Given two rankings f and g over
U with |f | = |g|, how many rankings h over U are there, such that ∆(f, g) +
∆(g, h) = ∆(f, h) and |f | = |g| = |h|.

PROBLEM 4.5 (Second collinearity problem) Given two rankings f and g


over U with |f | = |g|, how many rankings h over U are there, such that
∆(f, h) + ∆(h, g) = ∆(f, g) and |f | = |g| = |h| (in other words, how dense is
the segment [f, g] with respect to rank distance).
8 L.P. Dinu and I. Tomescu

x ord(x | f ) ord(x | g) ord(x | h) h(x)


1 4 2 2,3,4 1,2,3
2 3 4 3,4 1,2
3 2 1 1,2 3,4
4 1 3 1,2,3 2,3,4
Table 1. The collinearity example

The second problem supports an algorithmic treatment, given by the fol-


lowing proposition:
Proposition 4.6 Given three rankings f, h, g over U , such that |f | = |h| =
|g| then ∆(f, h)+∆(h, g) = ∆(f, g) if and only if h is a ranking which minimize
∆(f, h) + ∆(h, g).
Proof The proof is obvious (∆ is a metric, so ∆(f, h) + ∆(h, g) ≥ ∆(f, g)
for any three rankings f, g, h); the set of all rankings h which minimize
∆(f, h) + ∆(h, g) can be computed cf. [7]. On the other hand, at least two
rankings h minimize the sum ∆(f, h) + ∆(h, g), namely h = f and h = g. ¤

Proposition 4.3 shows that to find rankings h such that ∆(f, h) + ∆(g, h) =
∆(f, g) (i.e. Problem 4.5 ) is equivalent to find SDR’s h such ord(x | h) is
included in the interval between ord(x | f ) and ord(x | g) for each x ∈ f ∪g ∪h.
To find rankings h such that ∆(f, g) + ∆(g, h) = ∆(f, h) (i.e. Problem 4.4 )
is equivalent to find SDR’s h such that ord(x | h) is included in the interval
between 0 and ord(x | g) if ord(x | f ) ≥ ord(x | g) or ord(x | h) is included
in the interval between ord(x | g) and |g| if ord(x | f ) ≤ ord(x | g) for each
x ∈ f ∪ g ∪ h.

Example 4.7 Let f = (1, 2, 3, 4) and g = (2, 4, 1, 3) be two permutations


from S4 . To compute how many permutations h ∈ S4 are such that ∆(f, h) +
∆(h, g) = ∆(f, g) (i.e., the second collinearity problem), we proceed as follows:
• First, we determine the sets A1 , A2 , A3 , A4 , respectively.
Hence entry 1 may occur in positions 1, 2, or 3; entry 2 may occur in
positions 1, 2; entry 3 may occur in positions 3, 4; and entry 4 may occur
in positions 2, 3 or 4; dually, the candidates for position 1 constitute the
set A1 = {1, 2} and similarly we get A2 = {1, 2, 4}, A3 = {1, 3, 4} and
A4 = {3, 4} (Table 1). The rankings h such that ∆(f, h) + ∆(g, h) = ∆(f, g)
with |f | = |g| = |h| are identical to SDR’s of the set system A1 = {1, 2},
A2 = {1, 2, 4}, A3 = {1, 3, 4} and A4 = {3, 4}.
• Now, we have to compute the number of SDR’s of A1 , A2 , A3 , A4 . By Corol-
lary 3.4, this number is:
From rankings’ collinearity to counting SDR’s via chromatic list expression 9

4
Q
E(K4 ; A1 , A2 , A3 , A4 ) = |Ai | − (|A1 ∩ A2 ||A3 ||A4 | + |A1 ∩ A3 ||A2 ||A4 | +
i=1
|A1 ∩A4 ||A2 ||A3 |+|A2 ∩A3 ||A1 ||A4 |+|A2 ∩A4 ||A1 ||A3 |+|A3 ∩A4 ||A1 ||A2 |)+
((|A1 ∩A2 ∩A3 ||A4 |+|A1 ∩A2 ∩A4 ||A3 |+|A1 ∩A2 ∩A3 ||A4 |+|A1 ∩A2 ∩A4 ||A3 |+
|A1 ∩A2 ||A3 ∩A4 |+(|A1 ∩A3 ∩A4 ||A2 |+|A1 ∩A3 ||A2 ∩A4 |+|A1 ∩A3 ∩A4 ||A2 |+
|A1 ∩ A3 ∩ A2 ||A4 |) + (|A1 ∩ A2 ∩ A4 ||A3 | + |A1 ∩ A3 ∩ A4 ||A2 | + |A1 ∩ A4 ||A2 ∩
A3 |)+(|A2 ∩A3 ∩A4 ||A1 |+|A2 ∩A3 ∩A4 ||A1 |)+|A2 ∩A3 ∩A4 ||A1 |)−(|A1 ∩A2 ∩
A3 ||A4 | + |A2 ∩ A3 ∩ A4 ||A1 | + . . . (all the remaining terms are vanishing)) =
36 − (2 · 3 · 2 + 1 · 3 · 2 + 2 · 2 · 2 + 1 · 2 · 3 + 2 · 2 · 3) + 17 − 4 = 5.
So, there are 5 permutations which satisfy the second collinearity condition,
and they are: (1, 2, 3, 4), (1, 2, 4, 3), (2, 1, 3, 4), (2, 1, 4, 3) and (2, 4, 1, 3).

5 Conclusion

In this paper we proposed an alternative solution to the problem of finding the


number of systems of distinct representatives with respect to associated set
systems in a more general setting of graph colorings. The solution was used in
exploiting and counting cases in which the inequality triangle became equality
over the metric space of rank distance.

Acknowledgements
The authors wish to thank the referees for their comments and many help-
ful suggestions concerning the first version of this paper. The first author is
indebted to MEdC-ANCS and PNII-Idei which supported this research.

References
[1] Birkhoff, G.D., 1912, A determinantal formula for the number of ways of coloring a map. Ann.
Math. (2), 14, 42-46.
[2] Bollobás, B., 1998, Modern graph theory. Springer-Verlag.
[3] Deza, M. and Huang, T., 1998, Metrics on permutations. A survey. J. Combinatorics, Informa-
tion and System Sciences, 23, 173-185.
[4] Diaconis, P. and Graham, R.L, 1977, Spearman footrule as a measure of disarray. Journal of
Royal Statistical Society. Series B (Methodological), Vol. 39, No. 2, 262-268.
[5] Dinu, L.P., 2003, On the classification and aggregation of hierarchies with different constitutive
elements. Fundamenta Informaticae, 55(1), 39-50.
[6] Dinu, A. and Dinu, L.P., 2005, On the syllabic similarities of Romance languages. Lecture Notes
in Computer Science, Vol. 3406, pp. 785-789.
[7] Dinu, L.P. and Manea, F., 2006, An efficient approach for the rank aggregation problem. Theo-
retical Computer Science, vol 359 (1-3), pp. 455-461.
[8] Dinu, L.P. and Sgarro, A., 2006, A low-complexity distance for DNA strings. Fundamenta In-
formaticae, 73(3), 361-372.
[9] Dong, F.M., Koh, K.M. and Teo, K.L., 2005, Chromatic polynomials and chromaticity of graphs.
World Scientific, Singapore.
10 L.P. Dinu and I. Tomescu

[10] Dwork, C., Kumar, R., Naor, M. and Sivakumar, D., 2001, Rank aggregation methods for the
web. Proc. of the 10th International WWW Conference, 613-622.
[11] Gross, J.L. and Yellen, J. (editors), 2004, Handbook of graph theory. CRC Press, Boca Raton.
[12] C. de la Higuera and Casacuberta, F., 2000, Topology of strings: Median string is NP- complete.
Theoretical Computer Science, 230:39-48.
[13] Kohonen, T., 1985, Median strings. Pattern Recognition Letters, 3:309-313.
[14] Marcus, S., 1974, Linguistic structures and generative devices in molecular genetics. Cahiers
Ling. Theor. Appl., 11, 77-104.
[15] Ryser, H.J., 1963, Combinatorial mathematics. The Carus Mathematical Monographs, MAA.

You might also like