# MSSUTop-k: Determining the Minimum Scan Scope for UTop-k Query over Uncertain Data

Authors: Zhibin Zhao; Lan Yao; Ge Yu; Yubin Bao; Zhengbing Ma
Journal: International Journal of Distributed Sensor Networks
 (2015)

---

## Abstract

The semantics of UTop-k query is based on the possible world model, and the greatest challenge in processing UTop-k queries is the explosion of possible world space. In this direction, several optimized algorithms have been developed. However, uncertain databases are different in data distributions under different scoring functions, which has significant influence on the performance of the existing optimizing algorithms. In this paper, we propose two novel algorithms, MSSUTop-k and quick MSSUTop-k, for determining the minimum scan scope for UTop-k query processing. This work is important because before UTop-k query processing is started, users hope to know in advance how many and which tuples will be involved in UTop-k query processing. Then, they can make a balance between result precision and processing cost. So, it should be the prerequisite for answering UTop-k queries. MSSUTop-k can achieve accurate results but is relatively more costly in time complexity. Oppositely, quick MSSUTop-k can only achieve approximate results but performs better in time cost. We conduct comprehensive experiments to evaluate the performance of our proposed algorithms and analyze the relationship between the data distribution and the minimum scan scope of UTop-k queries.


---

## Body

## 1. Introduction

Sensor networks have widespread range of applications these days, such as industrial process monitoring and control, personal health monitoring, environmental monitoring, and moving object tracking. The view of sensor network as a distributed database and the sensor node as a table is being widely accepted by the database community. However, data readings collected from sensors are often inevitably imprecise, and thus they are called uncertain data in academic circles. The uncertainty in the sensed data can arise from multiple sources, including measurement errors due to sensing instruments, transmission delay, and discrete sampling of measurements. Therefore, it is necessary for the sensor database to record the imprecision and also to take it into account when the sensor data is processed. Handling the uncertainty in the data raises great challenges in almost all aspects of sensor data management.UTop-k query is a crucial application in uncertain database and attracts a lot of attentions in academic circles. UTop-k query answer is a tuple vector with the maximum aggregated probability of being Top-k across all possible worlds. Let us take the uncertain databases in Table 1 as an example. Table 1(a) is a database storing the velocities of vehicles measured by radar. Each reading is associated with a confidence level associated with the corresponding measuring or statistic error. Exclusiveness rules are prior knowledge and are derived from the specific application. In this example, event t2 is exclusive to t3 because the car Y-245 cannot be at two different speeds at the same time. Generally, researchers employ possible world (PW) model to describe uncertain database. All possible instances derived from the corresponding uncertain database compose the possible world space. Table 1(b) is the possible worlds space of Table 1(a).Table 1
Example of uncertain databases and UTop-k results.
(a)
Uncertain database 1
ID
Time
Radar
Plate
Speed
Conf.
t
1
1145
L1
X-123
115
1.0
t
2
1150
L2
Y-245
120
0.7
t
3
1150
L3
Y-245
80
0.3
t
4
1210
L4
W-541
90
0.4
t
5
1210
L5
W-541
110
0.6
t
6
1215
L6
L-105
105
1.0
t
7
1230
L
7
L-048
40
0.5
t
8
1230
L8
L-048
55
0.5
Exclusiveness rules:t2⊕t3, t4⊕t5, t7⊕t8
(b)
Utop-k answer based on uncertain database 1
Possible World
Top-2
Top-3
Conf.
P
W
1
=
{
t
1, t2, t4, t6, t7}
{
t
2, t1}
{
t
2, t1, t6}
0.14
P
W
2
=
{
t
1, t2, t4, t6, t8}
{
t
2, t1}
{
t
2, t1, t6}
0.14
P
W
3
=
{
t
1, t2, t5, t6, t7}
{
t
2, t1}
{
t
2, t1, t5}
0.21
P
W
4
=
{
t
1, t2, t5, t6,t8}
{
t
2, t1}
{
t
2, t1, t5}
0.21
P
W
5
=
{
t
1, t3, t4, t6, t7}
{
t
1, t6}
{
t
1, t6, t4}
0.06
P
W
6
=
{
t
1, t3, t4, t6, t8}
{
t
1, t6}
{
t
1, t6, t4}
0.06
P
W
7
=
{
t
1, t3, t5, t6, t7}
{
t
1, t5}
{
t
1, t5, t6}
0.09
P
W
8
=
{
t
1, t3, t5, t6, t8}
{
t
1, t5}
{
t
1, t5, t6}
0.09
UTop-2 =〈{t2, t1}, 0.7〉; UTop-3 = 〈{t2, t1, t5}, 0.42〉
(c)
Uncertain database 2
ID
Time
Radar
Plate
Speed
Conf.
t
1
1145
L1
X-123
115
1.0
t
2
1150
L2
Y-245
120
0.7
t
3
1150
L3
Y-245
80
0.3
t
4
1210
L4
W-541
90
0.4
t
5
1210
L5
W-541
110
0.6
t
6
1215
L6
L-105
105
1.0
t
7
1230
L
7
L-048
117
0.5
t
8
1230
L8
L-048
55
0.5
Exclusiveness rules:t2⊕t3, t4⊕t5, t7⊕t8
(d)
Utop-k answer based on uncertain database 2
Possible World
Top-2
Top-3
Conf.
P
W
1
=
{
t
1, t2, t4, t6, t7}
{
t
2, t7}
{
t
2, t7, t1}
0.14
P
W
2
=
{
t
1, t2, t4, t6, t8}
{
t
2, t1}
{
t
2, t1, t6}
0.14
P
W
3
=
{
t
1, t2, t5, t6, t7}
{
t
2, t7}
{
t
2, t7, t1}
0.21
P
W
4
=
{
t
1, t2, t5, t6, t8}
{
t
2, t1}
{
t
2, t1, t5}
0.21
P
W
5
=
{
t
1, t3, t4, t6, t7}
{
t
7, t1}
{
t
7, t1, t6}
0.06
P
W
6
=
{
t
1, t3, t4, t6, t8}
{
t
1, t6}
{
t
1, t6, t4}
0.06
P
W
7
=
{
t
1, t3, t5, t6, t7}
{
t
7, t1}
{
t
7, t1, t6}
0.09
P
W
8
=
{
t
1, t3, t5, t6, t8}
{
t
1, t5}
{
t
1, t5, t6}
0.09
UTop-2 =〈{t2, t1}/{t2, t7}, 0.35〉; UTop-3 = 〈{t2, t7, t1}, 0.35〉Given an uncertain database as Table1(a), according to the definition of UTop-k [1], the UTop-2 answer is {t2,t1}. The reason is that the combination of {t2,t1}, as the top-2 answer, appears in four possible worlds: PW1, PW2, PW3, and PW4, and aggregated probability is Pr⁡(PW1)+Pr⁡(PW2)+Pr⁡(PW3)+Pr⁡(PW4)=0.7. This probability is larger than that of {t1,t6} and {t1,t5}, which are the top-2 answers in the other four possible worlds and with the probability of 0.12 and 0.18, respectively. Similarly, the UTop-3 answer is {t2,t1,t5} with probability 0.42. In Table 1(a), there are totally 8 tuples in the uncertain database. According to the exclusive rules, the possible world space is composed of 8 possible world instances. Theoretically, given an uncertain dataset containing M groups of mutually exclusive tuples, the cardinality of the possible world space will be at least 2M. It implies that the possible world space grows quite faster than the uncertain dataset itself. This poses a great challenge on UTop-k processing.Basically, we can use the naive algorithm to process UTop-k queries, in which the possible world space is comletely produced and then the aggregated probability of each UTop-k answer can be obtained. However, the naive algorithm is prohibitively expensive in space and time cost. Actually, in many cases we can achieve the Utop-k answers by reading part of the uncertain dataset. Let us examine the possible world space in Table 1(b). The UTop-2 answer candidates are {t2,t1}, {t1,t6}, and {t1,t5}. The UTop-3 answer candidates are {t2,t1,t6}, {t2,t1,t5}, {t1,t6,t4}, and {t1,t5,t6}. The tuples t7 and t8 in Table 1(a) do not appear either in any of UTop-2 answer candidates or in that of UTop-3 answer candidates. In other words, the subset {t7,t8}, as a group containing two mutually exclusive tuples, only enlarges the possible world space but has no contrition to the final UTop-k answer. So, if we remove the subset of {t7,t8} from the original uncertain dataset, that is, we set {t1,t2,t3,t4,t5,t6} as the minimum scan scope for UTop-k processing, we can obtain accurate UTop-2 and UTop-3 answers while only four possible worlds are generated. Generally, if we eliminate a group with l mutually exclusive tuples, the possible world space will decrease l times. However, in some other cases, the entire uncertain dataset should be scanned for processing UTop-k queries. Let us take Table 1(c) as an example. It is just a little different from Table 1(a) in the value of t7. Table 1(d) is the possible world space and UTop-2 and UTop-3 answers for Table 1(c). In this example, all the tuples must be considered. From the two examples in Table 1, we can see that, given an uncertain dataset, a user-predefined scoring function, and a parameter k, the number of tuples that are necessarily involved in processing UTop-k queries is different. It should be reduced as much as possible for its great influence on processing time.In this paper, we propose two different methods to determine scan scope of tuples for UTop-k query processing. According to the minimum scan scope for accurate result, users can make a balance between the result precision with processing time cost. Towards this end, our contributions are summarized as follows:(i)
We propose our basic MSS4UTop-k algorithm for determining the minimum scan scope when UTop-k queries are handled. MSS4UTop-k can obtain the exact minimum scan scope.(ii)
In order to promote the efficiency in scan scope determination, we study some special cases in uncertain dataset and propose the algorithm of Quick MSS4UTop-k. It enlarges the minimum scan scope but can perform better than MSS4UTop-k in time cost.(iii)
We conducted an extensive experimental study on real uncertain dataset to test the performance of our algorithms. At the same time, we analyze the relationship between the data distribution and the minimum scan scope.


## 2. Problem Definitions

UTop-k semantics is based on the model of possible worlds [1]. Assume that there is a user-specified scoring function F, under which the tuples in an uncertain database can be sorted. UTop-k query answer is a tuple vector with the maximum aggregated probability of being top-k across all possible worlds.Definition 1 (UTop-k query).
LetD={t1,t2,…,tN} be an uncertain database with the possible world space PW={PW1,PW2,…,PWn}. Let T={T1,T2,…,Tm} be a set of k-length tuple vectors, where for each Ti∈T (1) tuples of Ti are ordered according to the scoring function F and (2) Ti is the top-k answer for a nonempty set of possible worlds PW(Ti)⊆PW. U-Topk query over D, based on F, return T∗∈T, where T∗=argmaxTi∈T⁡(∑Pr⁡(PW(Ti))).Definition 2 (X-tuple bucketB).
X-tuple [2] bucket consists of one or more alternatives, where each alternative is a regular tuple exclusive to the others according to the exclusiveness rules derived from applications. Therefore, given an uncertain database D={t1,t2,…,tN}, the X-tuple bucket B is a subset of D, that is, B⊆D, and B={t∣(∀t′∈B,t⊕t′)∧(∀t′∉B,¬(t⊕t′))}.Tuples in uncertain datasetD can be divided into two categories: (1) tuples with probability 1, which is called deterministic tuples, and (2) tuples with probability less than 1. Tuples in the first category appear in all possible worlds deterministically, while those in the second category appear in some of possible worlds at their own probability. Furthermore, we can divide the tuples into subsets according to the exclusiveness rules. Each deterministic tuple compose a subset itself, and the mutually exclusive tuples are organized into one X-tuple bucket. Then, the uncertain dataset can also be denoted as D=B1∪B2∪,…,∪BM, where each Bi is X-tuple bucket.Definition 3 (UTop-k minimum scan scope Ds).
Given an uncertain databaseD={t1,t2,…,tN}, the minimum scan scope Ds for UTop-k processing is a subset of D and satisfies the following two criteria: (1) Ds includes the minimum X-tuple buckets and (2) Ds-based UTop-k answer is the same as D-based UTop-k answer.Obviously,Ds is related to k and data distribution of uncertain dataset. The word “minimum” here has two meanings: (1) tuples in D-Ds will not enter any Top-k candidate set across the possible world space based on D; (2) Ds includes sufficient tuples to avoid possible errors.In this paper, we aim at determiningDs. For convenience of later discussion, we summarize our notations in Notations.


## 3. Related Work

Top-k queries in deterministic database is always a hot topic in academia, and several efficient methods for optimizing Top-k queries have been proposed [3–5]. However, in recent years it is noticed that physical data is usually uncertain and/or fuzzy [6–11]. The marriage of Top-k and uncertain data starts a novel research issue: Top-k queries in uncertain database. There are several semantics of Top-k queries in uncertain database: UTop-k [1], U-kRanks [1], PT-k [12], PKTop-k [13], Expected Ranks [14, 15], and other recent research works in [16–20].In this paper, we focus on the semantics of UTop-k. The work in [1] is the first to introduce the definition of UTop-k. It proposed the OptUTop-k framework for UTop-k processing as well. Its basic idea is based on the following two assumptions: (1) tuples in uncertain database is accessed one by one sequentially; that is, no random access is allowed; (2) the global exclusiveness rules are unknown in advance. OptUTop-k maintains a priority state queue which is ordered on probability. Then, it reads tuples one by one sequentially. Each time when a new tuple arrives, the top state in the priority state queue will be extended into two new states, with the newly seen tuple and without the newly seen tuple. By searching all possible states, OptUTop-k can obtain the most probable top-k answers.Another important work in UTop-k processing is introduced in [21]. The basic idea in [21] is based on the following two assumptions: (1) tuples in uncertain dataset are ordered according to the scoring function; (2) the global exclusiveness rules are known in advance. Based on these two assumptions, the optimizing framework reads the tuples one by one in sequence of scores. Each time when a new tuple arrives, the possible world space will be produced based on all seen tuples. This procedure repeats until the scan depth is reached. Then, the Top-k candidate set in the possible worlds with the highest probability is the final UTop-k answer.Our work in this paper is different from the two works above. Firstly, they are different in preconditions. Our work is based on the following two assumptions:(1) the global exclusiveness rules are known and (2) the whole uncertain dataset can be traversed in advance; that is, N is known. The justification for our first assumption is that the exclusiveness rules come from applications, and with the help of domain experts we can translate this prior knowledge into user-defined constraints in database at the very beginning. The justification for our second assumption is that uncertain data is usually stored in RDBMS, in which traversing a table is a common operation. Secondly, they are different in goals. The two works above aim at optimizing UTop-k processing. However, we view our work as a prerequisite step for UTop-k processing. We emphasize that before we start any optimized algorithm, we must determine the necessary scan scope in uncertain database for processing UTop-k query; that is, how many and which tuples are necessarily involved for query processing? It is important because in some cases all the uncertain tuples may be involved in answering UTop-k queries. In such scenarios, any effort seeking for precision results will lead to failure, and the approximate algorithms are the best (or say the only) choice.Scoring function is another interesting research point in rank queries. Soliman et al. [22] notice that in many cases users cannot precisely specify their scoring functions, which means that in such scenarios the scoring function is uncertain or incomplete. This work is different from ours for two aspects: (1) they are different in data model. In the work of [22], data is determined, while the scoring function it is uncertain. Therefore, they model their data with traditional database (deterministic database). Oppositely, in our work, we assume that data gathered from application field is with uncertainty, while the scoring function is determined. Researchers are inclined to make use of probability database and possible world model to describe uncertain dataset. (2) They are different in query semantics. Soliman et al. set their focus on the “uncertain/incomplete scoring functions” in Top-k queries. The question is that “Can we adopt a score function with weight ranges and partially specified weight for different data sources to capture the preferences of users so as to give them a personalized Top-k result?”. Furthermore, they analyze the sensitivity of the computed order with respect to changes in weights. In our work, we aim at the semantic of UTop-k over uncertain data. The most challenging problem in processing UTop-k queries is the explosion of possible world space, which makes it unfeasible for its quite expensive cost in processing time. However, in our paper we demonstrate that in many cases not all tuples in uncertain database are necessarily involved in answering UTop-k queries. So, we set our goal to conclude that “which is the minimum necessary scan scope of tuples in uncertain data for UTop-k query processing?”. In summary, although these two works are both about “uncertainty” and “Top-k queries,” they are essentially different.Besides, query result evaluation and data cleaning are always an attractive research problem in the field of uncertain data management. Given the data uncertainty, a query answer is inherently inexact. Paper [23] puts forward the measurement method of the ambiguity of the query results. If users are not satisfied with the quality of query answer, a cleaning process will be launched. Ideally, all X-tuples should be cleaned. However, this cleaning process is limited by power resource, bandwidth, budget, successfulness, and so on, which makes it an optimization problem for users. Xu et al. [24] set their focus on the problem of automatically selecting an extractive summary from entire set of objects as its representatives. Practically, objects may have multiple uncertain attributes. So, paper [24] proposes a general framework that models the information contained in objects and optimizes a probabilistic coverage property of the summary. Although all these works are based on uncertain data, their research point is not about the semantic and processing of UTop-k queries.


## 4.
MSS4UTop-k Framework

In this section, we will introduce our algorithms to determine the minimum scan scope for UTop-k query processing in uncertain databases. In most cases, k is far less than N. It implies that some of, or maybe most of, tuples have no influence on any Top-k candidates. According to this basic idea, we believe that some of tuples in uncertain dataset can be safely pruned when UTop-k query is processed. Then, the remaining part is the minimum scan scope. The challenge is that how we can distinguish those “useless” tuples.


### 4.1. Phrases of MSS4UTop-k

MSS4UTop-k has three phrases: first, we traverse the uncertain dataset, group the tuples in D according to exclusiveness rules, and choose one representative tuple for each X-tuple group. We sort these representative tuples under the scoring function F and select top-k representative tuples to compose our representative tuple set Tr. Next, we extend the representative set. In some possible worlds, some tuples in the representative set may be absent from the top-k candidates and replaced by others. So, we extend the representative set to make sure that all the tuples that have chance to enter any top-k result set, no matter in which possible world, must be included. Finally, We determine the minimum scan scope based on the extended representative tuple set.


#### 4.1.1. Initializing the Representative Tuple SetTr

First, as we mentioned in Section2, we assign all the tuples in D into X-tuple buckets; that is, D=B1∪B2∪,…,∪BM. Our distribution rules are (1) each deterministic tuple has one bucket by itself and (2) tuples that conflict with each other under exclusiveness rules are put into the same bucket. Next, for each bucket, we select the top-1 tuple under the scoring function F as the representative tuple. We use tBimax⁡ to denote the representative tuple for the bucket Bi. Obviously, for ∀tj∈Bi,F(tBimax⁡)>F(tj). We sort all the representative tuples according to their scores under F. Without loss of generality, the sorted representative tuples can be denoted as fully ordered vector T′=tB1max⁡⪯FtB2max⁡⪯F⋯⪯FtBimax⁡⋯⪯FtBMmax⁡, and the corresponding buckets behind also have their order: B1⪯FB2⪯F⋯⪯FBi⋯⪯FBM. For simplicity of discussion, we assume that all the scores of the tuples in T′ are distinct. Figure 1 illustrates how T′ is generated under uncertain dataset in Table 1(c).Figure 1
T
′ under uncertain dataset in Table 1(c).When a UTop-k query is initiated, we first locate the kth element in T′. Then, the elements from tB1max⁡ to tBkmax⁡ compose our initial representative tuple set Tr=tB1max⁡,tB2max⁡,…,tBkmax⁡. Obviously, Tr⊆T′. Next, we need to extend Tr so that it can cover all the X-tuple buckets that contain the tuples with chance to enter any Ti in T. We define a lower bound tuple tlbmax⁡. It is always assigned with the element next to the last element of Tr in T′. Undoubtedly, tlbmax⁡ is corresponding to the X-tuple bucket Blb, and initially tlbmax⁡=tBk+1max⁡; that is, lb=k+1 because tBkmax⁡ is the last element of Tr in the very beginning.


#### 4.1.2. Extending the Representative Tuple SetTr

We start to traverseTr from the beginning to the end. Before we reach the element tBkmax⁡, we may meet the following two cases.Case 1.
We meet a deterministic tupletBimax⁡(i≤k).Theorem 4.
Assume thattBimax⁡ is a deterministic tuple in Tr. Then, one can conclude the following: (1) ∀Ti(Ti∈T), tBimax⁡∈Ti, and (2) tBimax⁡∈T∗.Proof.
SincetBimax⁡∈Tr⊆T′ and T′ is ordered under scoring function F, it can be inferred that F(tBimax⁡)>F(tlbmax⁡)>⋯>F(tBMmax⁡). Moreover, according to the definition, F(tBmax⁡) is the maximum in any X-tuple bucket B; then we can conclude that F(tBimax⁡) is larger than any F(t), where t∈Bj(k+1≤j≤M). This means that tBimax⁡ must appear in the top-k answer sets of all possible worlds. Furthermore, its rank under scoring function F is at most i(i≤k). So, (1)∀Ti(Ti∈T), tBimax⁡∈Ti, and (2)tBimax⁡∈T∗ are proved.According to Theorem4, a deterministic tuple tBimax⁡(i≤k) must have a position in T∗. So, in this scenario, we keep Tr unextended. This is illustrated in Figure 2.Figure 2
T
r keeps unchanged if Pr⁡(tBimax⁡)=1 or min⁡(Ft∈Bi(t))≥F(tlbmax⁡).Case 2.
We meet a tuple with probability less than 1; that is,Pr⁡(tBimax⁡)<1(i≤k).In this case, the bucketBi contains more than one tuples, and ∑t∈Bi(Pr⁡(t)=1). Essentially, there are two more specific cases here: (1)min⁡(Ft∈Bi(t))>F(tlbmax⁡) and (2)∃t,Ft∈Bi(t)≤F(tlbmax⁡). We discuss these two scenarios in detail, respectively.Case 2.1  (
min
⁡
(
F
t
∈
B
i
(
t
)
)
≥
t
lb
max
⁡
). This case is quite similar to Case 1. We call it the best situation. Since min⁡(Ft∈Bi(t))≥tlbmax⁡, we can conclude that min⁡(Ft∈Bi(t))>Ft∈Bj(k+1≤j≤M)(t). It implies that Bi must devote one tuple to the top-k candidate answer set in any of the possible worlds. Similarly, in this scenario, we still keep Tr unextended, as depicted in Figure 2.Case 2.2  (
∃
t
,
F
t
∈
B
i
(
t
)
≤
F
(
t
lb
max
⁡
)
). Assume that there are l elements in Bi, including tBimax⁡; that is, Bi={tBi1,Pr⁡tBi1,…,tBimax⁡,Pr⁡tBimax⁡,…,tBil,Pr⁡(tBil)}. We consider the worst situation ∀t(t≠tBimax⁡), Ft∈Bi(t)≤F(tlbmax⁡). Under this worst assumption, tBimax⁡ will appear in n/l possible worlds, and it undoubtedly must take a position in top-k set in the n/l possible worlds. However, in the other n(1-1/l) possible worlds, tuples from Bi are kicked out of the top-k set and replaced by tuples from other buckets such as Blb. So, we have to extend Tr in order to make sure that it can cover all the representative tuples whose corresponding buckets contain the tuples with chance to enter top-k candidate sets. Extension of Tr as well as its start and stop principles are as follows.(i)
Extension Start Principle. If ∃t∈Bi,F(t)≤F(tlbmax⁡), Tr extension starts.(ii)
Extension Principle. Tr=Tr∪{tlbmax⁡}, and tlbmax⁡ will be placed to the tail of Tr.(iii)
Extension Stop Principle 1. If tlbmax⁡ is a deterministic tuple, Tr extension stops.(iv)
Extension Stop Principle 2. If, ∀t∈Blb,F(t)>F(tBlb+1max⁡), Tr extension stops.(v)
Extension Stop Principle 3. If, ∀t∈Bi,F(t)>F(tBlb+1max⁡), Tr extension stops.(vi)
Extension Stop Principle 4. If the end of T′ is reached, that is, lb=M, Tr extension stops.Besides Cases 2.1 and 2.2, there are still another situation which is between the best one and the worst one, more than one tuple whose score is larger than F(tlbmax⁡), and others are the opposite. We call it the intermediate situation. This intermediate situation should be handled in the same way as the worst one because, as we mentioned above, we must guarantee that all the tuples with chance to enter top-k candidate set have their bucket representative in Tr. So, the extension of Tr is necessary in this intermediate case.In the above cases, we listed all of the possible situations oftBimax⁡. After tBimax⁡ is handled, we move to the next element in Tr. We keep traversing Tr until the element tBkmax⁡ is handled. Tr becomes larger and larger in this process. Figure 3 illustrates how Tr is extended with tlbmax⁡.Figure 3
The extension ofTr:Tr=Tr∪tBlbmax⁡.


#### 4.1.3. Determine the Minimum Scan ScopeDs

After being extended,Tr is 〈tB1max⁡,…,tBkmax⁡,…,tBjmax⁡〉. According to the Extension Principle and the Extension Stop Principles, we can conclude that the buckets corresponding to the tuples in the current Tr, that is, B1,…,Bk,…,Bj, contain all the tuples that have chance to enter the Top-k result sets of some possible worlds. We combine all the tuples in B1,…,Bk,…,Bj, and the minimum scan scope is obtained; that is, Ds=⋃tBimax⁡∈TrBi. Algorithm 1 describes how Ds is generated in detail.Algorithm 1:The MSS4UTop-k algorithm.
Require:
The uncertain datasetD including exclusiveness rules;
The parameterk;
Ensure:
The reduced uncertain datasetDs;
(1) Initialize:T′=ϕ, Tr=ϕ, Ds=ϕ, tlbmax=null;
(2) Re-organizeD: D←{B1,B2,…,BM}; //exclusiveness rules
(3) for (eachBi in D)
(4)tBimax↔Bi;
(5)T′←T′∪tBimax;
(6) end for //T′ is obtained
(7) SortT′;
(8)Tr←{tB1max,tB2max,…,tBkmax}; //the original Tr
(9)tlbmax←tk+1max//⇔lb←k+1
(10) for (i=0; i<k; i++)
(11)  if (Pr(tBimax)=1) then
(12)   continue;
(13)  else
(14)   if (min(Ft∈Bi(t))>F(tlb)) then
(15)    continue;
(16)   else
(17)    while (lb≤M)
(18)  Tr←Tr∪tlbmax;
(19)  if (Pr(tlbmax) = 1) then
(20)   break;
(21)  else
(22)   if ((min(Ft∈Blb(t))>F(tBlb+1max)) ∥ (min(Ft∈Bi(t))>F(tBlb+1max)))
(23)    break;
(24)   else
(25)    lb←lb+1;
(26)   end if
(27)  end if
(28) end while
(29)   end if
(30)  end if
(31) end for //the extendedTr.
(32) for (tBimax∈Tr)
(33)Ds←Ds∪Bi; //using tBimax↔Bi
(34) end for //Ds is obtained.
(35)returnDs;


#### 4.1.4. Correctness

In this section, we will prove that theDs-based UTop-k result equals the D-based UTop-k result.Theorem 5.
Assume that the original uncertain dataset isD. Ds is the minimum scan scope for UTop-k queries on D. PWDs is the Ds-based possible world space, and TDs is all the top-k candidates derived from PWDs. TDs∗ is the UTop-k answer based on PWDs. Then, T∗=TDs∗.Proof.
P
W
=
{
PW
1
,
PW
2
,
…
,
PW
n
} is the D-base possible world space, and T is k-length tuple vectors, where each Ti∈T is a possible top-k solution derived from PW. Definitely, if the naive approach is adopted, we can get the correct UTop-k answer T∗=argmaxTi∈T⁡(∑Pr⁡(PW(Ti))). If we use the proposed MSS4UTop-k, we can get Ds=⋃i=1j(j≤M)Bi. It implies that any tuples from the set Bj+1,Bj+2,…,BM have no chance to enter any Ti(Ti∈T).
Case 1  (
j
=
M
). Consider(1)j=M⟹Ds=D⟹T∗=TDs∗.
Case 2  (
M
-
j
=
1
). Consider(2)M-j=1⟹D=Ds∪BM.Suppose BM={tBM1,tBM2,…,tBMl}; then(3)PW=PWDsi∪tBMj∣1≤i≤ml,1≤j≤l.For any tBMj, it has no chance to enter the top-k result set, so we can conclude that Top-k(PW)=Top-k(PWDs); that is,(4)T=TDs.Assume that TDsi∈TDs, according to (4), ∃Tj∈T, and TDsi=Tj. Since the tuples from BM have no influence on the top-k record set in any of the possible worlds, PW(Tj)={PWDs(TDsi)∪tBmx∣1≤x≤l}. So,(5)Pr⁡PWTj=Pr⁡PWDsTDsi∪tBmx∣1≤x≤l.In addition, ∑x=1lPr⁡(tBmx)=1. Then, we have(6)Pr⁡TDsi=Pr⁡Tj.Finally, with the formula (4) and (6), we can conclude(7)T∗=TDs∗.
Case 3  (
M
-
j
>
1
). Consider(8)M-j>1⟹D=Ds∪Bj+1∪Bj+2∪⋯∪BM=⋯Ds∪Bj+1∪Bj+2∪⋯∪BM.Essentially, Case 3 is the extension of Case 2, and it can be proved by repeating the steps in Case 2.In this section, we describe our basic MSS4UTop-k algorithm in detail. Considering the different features of original uncertain dataset, the efficiency of MSS4UTop-k varies. In next section, we will introduce a variation of the MSS4UTop-k algorithm, called Quick MSS4UTop-k. The goal of Quick MSS4UTop-k is to balance the accuracy of minimum scan scope and the efficiency of MSS4UTop-k.


### 4.2. The Quick MSS4UTop-k Algorithm

In the basic MSS4UTop-k algorithm, we traverse T′ from the element tB1max⁡ to the element tBkmax⁡, and for each element we judge its possibility to be in Top-k record set so as to determine whether Tr should be extended. This procedure may result in a large amount of comparison operations and decrease the efficiency of MSS4UTop-k. So, we propose the Quick MSS4UTop-k algorithm to simplify the generation procedure of Tr.Given a uncertain databaseD and a UTop-k query on D, we denote Dd as the set composed of the deterministic tuples in D; that is, Bd={tBi∣tBi∈DandPr⁡(tBi)=1}. The quick MSS4UTop-k algorithm is suitable in the situations where (1)Dd>k and (2) the deterministic tuples are uniformly distributed in D. The quick MSS4UTop-k algorithm is also composed of three phrases.(i) Phrase 1 (determineT′). In this phrase, the sorted representative tuple set T′ is produced. We omit it because this procedure is totally the same as that in the basic MSS4UTop-k algorithm.(ii) Phrase 2 (determineTr). In this phrase, the quick MSS4UTop-k algorithm is different from the basic one. In the quick MSS4UTop-k algorithm, we locate the kth deterministic tuple in T′. We denote it as tBk′max⁡. Obviously, k′≥k and Pr⁡(tBk′max⁡)=1. Then, Tr={tB1max⁡,tB2max⁡,…,tBkmax⁡,…,tBk′max⁡}.(iii) Phrase 3 (determineDs). This phrase is also the same as that of the basic MSS4UTop-k algorithm; that is, Ds=⋃tBimax⁡∈TrBi.Compared with that in the basic MSS4UTop-k algorithm, Tr in the quick MSS4UTop-k algorithm might be enlarged. However, if the deterministic tuples are uniformly distributed in D and Dd is close to D, the number of redundant tuples in Tr will be rational and acceptable. Algorithm 2 describes the detailed procedure of the algorithm Quick MSS4UTop-k.Algorithm 2:The quick MSS4UTop-k algorithm.
Require:
The uncertain datasetD including exclusiveness rules;
The parameterk;
Ensure:
The reduced uncertain datasetDs;
(1) Initialize:T′=ϕ, Tr=ϕ, Ds=ϕ, tlbmax=null;
(2)   Re-organizeD: D←{B1,B2,…,BM}; //exclusiveness rules.
(3)  for (eachBi in D)
(4)tBimax↔Bi;
(5)T′←T′∪tBimax;
(6) end for //T′ is obtained
(7)  SortT′;
(8)i←1;
(9)j←0;
(10)  while (j≤k)
(11)  if (Pr(tBimax)=1) then
(12)j←j+1;
(13)  end if
(14)Tr←Tr∪{tBimax};
(15)i←i+1
(16)  end while //Tr is obtained.
(17)  for (tBimax∈Tr)
(18)Ds←Ds∪Bi; //using tBimax↔Bi.
(19) end for //Ds is obtained.
(20)returnDs;


## 4.1. Phrases of MSS4UTop-k

MSS4UTop-k has three phrases: first, we traverse the uncertain dataset, group the tuples in D according to exclusiveness rules, and choose one representative tuple for each X-tuple group. We sort these representative tuples under the scoring function F and select top-k representative tuples to compose our representative tuple set Tr. Next, we extend the representative set. In some possible worlds, some tuples in the representative set may be absent from the top-k candidates and replaced by others. So, we extend the representative set to make sure that all the tuples that have chance to enter any top-k result set, no matter in which possible world, must be included. Finally, We determine the minimum scan scope based on the extended representative tuple set.


### 4.1.1. Initializing the Representative Tuple SetTr

First, as we mentioned in Section2, we assign all the tuples in D into X-tuple buckets; that is, D=B1∪B2∪,…,∪BM. Our distribution rules are (1) each deterministic tuple has one bucket by itself and (2) tuples that conflict with each other under exclusiveness rules are put into the same bucket. Next, for each bucket, we select the top-1 tuple under the scoring function F as the representative tuple. We use tBimax⁡ to denote the representative tuple for the bucket Bi. Obviously, for ∀tj∈Bi,F(tBimax⁡)>F(tj). We sort all the representative tuples according to their scores under F. Without loss of generality, the sorted representative tuples can be denoted as fully ordered vector T′=tB1max⁡⪯FtB2max⁡⪯F⋯⪯FtBimax⁡⋯⪯FtBMmax⁡, and the corresponding buckets behind also have their order: B1⪯FB2⪯F⋯⪯FBi⋯⪯FBM. For simplicity of discussion, we assume that all the scores of the tuples in T′ are distinct. Figure 1 illustrates how T′ is generated under uncertain dataset in Table 1(c).Figure 1
T
′ under uncertain dataset in Table 1(c).When a UTop-k query is initiated, we first locate the kth element in T′. Then, the elements from tB1max⁡ to tBkmax⁡ compose our initial representative tuple set Tr=tB1max⁡,tB2max⁡,…,tBkmax⁡. Obviously, Tr⊆T′. Next, we need to extend Tr so that it can cover all the X-tuple buckets that contain the tuples with chance to enter any Ti in T. We define a lower bound tuple tlbmax⁡. It is always assigned with the element next to the last element of Tr in T′. Undoubtedly, tlbmax⁡ is corresponding to the X-tuple bucket Blb, and initially tlbmax⁡=tBk+1max⁡; that is, lb=k+1 because tBkmax⁡ is the last element of Tr in the very beginning.


### 4.1.2. Extending the Representative Tuple SetTr

We start to traverseTr from the beginning to the end. Before we reach the element tBkmax⁡, we may meet the following two cases.Case 1.
We meet a deterministic tupletBimax⁡(i≤k).Theorem 4.
Assume thattBimax⁡ is a deterministic tuple in Tr. Then, one can conclude the following: (1) ∀Ti(Ti∈T), tBimax⁡∈Ti, and (2) tBimax⁡∈T∗.Proof.
SincetBimax⁡∈Tr⊆T′ and T′ is ordered under scoring function F, it can be inferred that F(tBimax⁡)>F(tlbmax⁡)>⋯>F(tBMmax⁡). Moreover, according to the definition, F(tBmax⁡) is the maximum in any X-tuple bucket B; then we can conclude that F(tBimax⁡) is larger than any F(t), where t∈Bj(k+1≤j≤M). This means that tBimax⁡ must appear in the top-k answer sets of all possible worlds. Furthermore, its rank under scoring function F is at most i(i≤k). So, (1)∀Ti(Ti∈T), tBimax⁡∈Ti, and (2)tBimax⁡∈T∗ are proved.According to Theorem4, a deterministic tuple tBimax⁡(i≤k) must have a position in T∗. So, in this scenario, we keep Tr unextended. This is illustrated in Figure 2.Figure 2
T
r keeps unchanged if Pr⁡(tBimax⁡)=1 or min⁡(Ft∈Bi(t))≥F(tlbmax⁡).Case 2.
We meet a tuple with probability less than 1; that is,Pr⁡(tBimax⁡)<1(i≤k).In this case, the bucketBi contains more than one tuples, and ∑t∈Bi(Pr⁡(t)=1). Essentially, there are two more specific cases here: (1)min⁡(Ft∈Bi(t))>F(tlbmax⁡) and (2)∃t,Ft∈Bi(t)≤F(tlbmax⁡). We discuss these two scenarios in detail, respectively.Case 2.1  (
min
⁡
(
F
t
∈
B
i
(
t
)
)
≥
t
lb
max
⁡
). This case is quite similar to Case 1. We call it the best situation. Since min⁡(Ft∈Bi(t))≥tlbmax⁡, we can conclude that min⁡(Ft∈Bi(t))>Ft∈Bj(k+1≤j≤M)(t). It implies that Bi must devote one tuple to the top-k candidate answer set in any of the possible worlds. Similarly, in this scenario, we still keep Tr unextended, as depicted in Figure 2.Case 2.2  (
∃
t
,
F
t
∈
B
i
(
t
)
≤
F
(
t
lb
max
⁡
)
). Assume that there are l elements in Bi, including tBimax⁡; that is, Bi={tBi1,Pr⁡tBi1,…,tBimax⁡,Pr⁡tBimax⁡,…,tBil,Pr⁡(tBil)}. We consider the worst situation ∀t(t≠tBimax⁡), Ft∈Bi(t)≤F(tlbmax⁡). Under this worst assumption, tBimax⁡ will appear in n/l possible worlds, and it undoubtedly must take a position in top-k set in the n/l possible worlds. However, in the other n(1-1/l) possible worlds, tuples from Bi are kicked out of the top-k set and replaced by tuples from other buckets such as Blb. So, we have to extend Tr in order to make sure that it can cover all the representative tuples whose corresponding buckets contain the tuples with chance to enter top-k candidate sets. Extension of Tr as well as its start and stop principles are as follows.(i)
Extension Start Principle. If ∃t∈Bi,F(t)≤F(tlbmax⁡), Tr extension starts.(ii)
Extension Principle. Tr=Tr∪{tlbmax⁡}, and tlbmax⁡ will be placed to the tail of Tr.(iii)
Extension Stop Principle 1. If tlbmax⁡ is a deterministic tuple, Tr extension stops.(iv)
Extension Stop Principle 2. If, ∀t∈Blb,F(t)>F(tBlb+1max⁡), Tr extension stops.(v)
Extension Stop Principle 3. If, ∀t∈Bi,F(t)>F(tBlb+1max⁡), Tr extension stops.(vi)
Extension Stop Principle 4. If the end of T′ is reached, that is, lb=M, Tr extension stops.Besides Cases 2.1 and 2.2, there are still another situation which is between the best one and the worst one, more than one tuple whose score is larger than F(tlbmax⁡), and others are the opposite. We call it the intermediate situation. This intermediate situation should be handled in the same way as the worst one because, as we mentioned above, we must guarantee that all the tuples with chance to enter top-k candidate set have their bucket representative in Tr. So, the extension of Tr is necessary in this intermediate case.In the above cases, we listed all of the possible situations oftBimax⁡. After tBimax⁡ is handled, we move to the next element in Tr. We keep traversing Tr until the element tBkmax⁡ is handled. Tr becomes larger and larger in this process. Figure 3 illustrates how Tr is extended with tlbmax⁡.Figure 3
The extension ofTr:Tr=Tr∪tBlbmax⁡.


### 4.1.3. Determine the Minimum Scan ScopeDs

After being extended,Tr is 〈tB1max⁡,…,tBkmax⁡,…,tBjmax⁡〉. According to the Extension Principle and the Extension Stop Principles, we can conclude that the buckets corresponding to the tuples in the current Tr, that is, B1,…,Bk,…,Bj, contain all the tuples that have chance to enter the Top-k result sets of some possible worlds. We combine all the tuples in B1,…,Bk,…,Bj, and the minimum scan scope is obtained; that is, Ds=⋃tBimax⁡∈TrBi. Algorithm 1 describes how Ds is generated in detail.Algorithm 1:The MSS4UTop-k algorithm.
Require:
The uncertain datasetD including exclusiveness rules;
The parameterk;
Ensure:
The reduced uncertain datasetDs;
(1) Initialize:T′=ϕ, Tr=ϕ, Ds=ϕ, tlbmax=null;
(2) Re-organizeD: D←{B1,B2,…,BM}; //exclusiveness rules
(3) for (eachBi in D)
(4)tBimax↔Bi;
(5)T′←T′∪tBimax;
(6) end for //T′ is obtained
(7) SortT′;
(8)Tr←{tB1max,tB2max,…,tBkmax}; //the original Tr
(9)tlbmax←tk+1max//⇔lb←k+1
(10) for (i=0; i<k; i++)
(11)  if (Pr(tBimax)=1) then
(12)   continue;
(13)  else
(14)   if (min(Ft∈Bi(t))>F(tlb)) then
(15)    continue;
(16)   else
(17)    while (lb≤M)
(18)  Tr←Tr∪tlbmax;
(19)  if (Pr(tlbmax) = 1) then
(20)   break;
(21)  else
(22)   if ((min(Ft∈Blb(t))>F(tBlb+1max)) ∥ (min(Ft∈Bi(t))>F(tBlb+1max)))
(23)    break;
(24)   else
(25)    lb←lb+1;
(26)   end if
(27)  end if
(28) end while
(29)   end if
(30)  end if
(31) end for //the extendedTr.
(32) for (tBimax∈Tr)
(33)Ds←Ds∪Bi; //using tBimax↔Bi
(34) end for //Ds is obtained.
(35)returnDs;


### 4.1.4. Correctness

In this section, we will prove that theDs-based UTop-k result equals the D-based UTop-k result.Theorem 5.
Assume that the original uncertain dataset isD. Ds is the minimum scan scope for UTop-k queries on D. PWDs is the Ds-based possible world space, and TDs is all the top-k candidates derived from PWDs. TDs∗ is the UTop-k answer based on PWDs. Then, T∗=TDs∗.Proof.
P
W
=
{
PW
1
,
PW
2
,
…
,
PW
n
} is the D-base possible world space, and T is k-length tuple vectors, where each Ti∈T is a possible top-k solution derived from PW. Definitely, if the naive approach is adopted, we can get the correct UTop-k answer T∗=argmaxTi∈T⁡(∑Pr⁡(PW(Ti))). If we use the proposed MSS4UTop-k, we can get Ds=⋃i=1j(j≤M)Bi. It implies that any tuples from the set Bj+1,Bj+2,…,BM have no chance to enter any Ti(Ti∈T).
Case 1  (
j
=
M
). Consider(1)j=M⟹Ds=D⟹T∗=TDs∗.
Case 2  (
M
-
j
=
1
). Consider(2)M-j=1⟹D=Ds∪BM.Suppose BM={tBM1,tBM2,…,tBMl}; then(3)PW=PWDsi∪tBMj∣1≤i≤ml,1≤j≤l.For any tBMj, it has no chance to enter the top-k result set, so we can conclude that Top-k(PW)=Top-k(PWDs); that is,(4)T=TDs.Assume that TDsi∈TDs, according to (4), ∃Tj∈T, and TDsi=Tj. Since the tuples from BM have no influence on the top-k record set in any of the possible worlds, PW(Tj)={PWDs(TDsi)∪tBmx∣1≤x≤l}. So,(5)Pr⁡PWTj=Pr⁡PWDsTDsi∪tBmx∣1≤x≤l.In addition, ∑x=1lPr⁡(tBmx)=1. Then, we have(6)Pr⁡TDsi=Pr⁡Tj.Finally, with the formula (4) and (6), we can conclude(7)T∗=TDs∗.
Case 3  (
M
-
j
>
1
). Consider(8)M-j>1⟹D=Ds∪Bj+1∪Bj+2∪⋯∪BM=⋯Ds∪Bj+1∪Bj+2∪⋯∪BM.Essentially, Case 3 is the extension of Case 2, and it can be proved by repeating the steps in Case 2.In this section, we describe our basic MSS4UTop-k algorithm in detail. Considering the different features of original uncertain dataset, the efficiency of MSS4UTop-k varies. In next section, we will introduce a variation of the MSS4UTop-k algorithm, called Quick MSS4UTop-k. The goal of Quick MSS4UTop-k is to balance the accuracy of minimum scan scope and the efficiency of MSS4UTop-k.


## 4.1.1. Initializing the Representative Tuple SetTr

First, as we mentioned in Section2, we assign all the tuples in D into X-tuple buckets; that is, D=B1∪B2∪,…,∪BM. Our distribution rules are (1) each deterministic tuple has one bucket by itself and (2) tuples that conflict with each other under exclusiveness rules are put into the same bucket. Next, for each bucket, we select the top-1 tuple under the scoring function F as the representative tuple. We use tBimax⁡ to denote the representative tuple for the bucket Bi. Obviously, for ∀tj∈Bi,F(tBimax⁡)>F(tj). We sort all the representative tuples according to their scores under F. Without loss of generality, the sorted representative tuples can be denoted as fully ordered vector T′=tB1max⁡⪯FtB2max⁡⪯F⋯⪯FtBimax⁡⋯⪯FtBMmax⁡, and the corresponding buckets behind also have their order: B1⪯FB2⪯F⋯⪯FBi⋯⪯FBM. For simplicity of discussion, we assume that all the scores of the tuples in T′ are distinct. Figure 1 illustrates how T′ is generated under uncertain dataset in Table 1(c).Figure 1
T
′ under uncertain dataset in Table 1(c).When a UTop-k query is initiated, we first locate the kth element in T′. Then, the elements from tB1max⁡ to tBkmax⁡ compose our initial representative tuple set Tr=tB1max⁡,tB2max⁡,…,tBkmax⁡. Obviously, Tr⊆T′. Next, we need to extend Tr so that it can cover all the X-tuple buckets that contain the tuples with chance to enter any Ti in T. We define a lower bound tuple tlbmax⁡. It is always assigned with the element next to the last element of Tr in T′. Undoubtedly, tlbmax⁡ is corresponding to the X-tuple bucket Blb, and initially tlbmax⁡=tBk+1max⁡; that is, lb=k+1 because tBkmax⁡ is the last element of Tr in the very beginning.


## 4.1.2. Extending the Representative Tuple SetTr

We start to traverseTr from the beginning to the end. Before we reach the element tBkmax⁡, we may meet the following two cases.Case 1.
We meet a deterministic tupletBimax⁡(i≤k).Theorem 4.
Assume thattBimax⁡ is a deterministic tuple in Tr. Then, one can conclude the following: (1) ∀Ti(Ti∈T), tBimax⁡∈Ti, and (2) tBimax⁡∈T∗.Proof.
SincetBimax⁡∈Tr⊆T′ and T′ is ordered under scoring function F, it can be inferred that F(tBimax⁡)>F(tlbmax⁡)>⋯>F(tBMmax⁡). Moreover, according to the definition, F(tBmax⁡) is the maximum in any X-tuple bucket B; then we can conclude that F(tBimax⁡) is larger than any F(t), where t∈Bj(k+1≤j≤M). This means that tBimax⁡ must appear in the top-k answer sets of all possible worlds. Furthermore, its rank under scoring function F is at most i(i≤k). So, (1)∀Ti(Ti∈T), tBimax⁡∈Ti, and (2)tBimax⁡∈T∗ are proved.According to Theorem4, a deterministic tuple tBimax⁡(i≤k) must have a position in T∗. So, in this scenario, we keep Tr unextended. This is illustrated in Figure 2.Figure 2
T
r keeps unchanged if Pr⁡(tBimax⁡)=1 or min⁡(Ft∈Bi(t))≥F(tlbmax⁡).Case 2.
We meet a tuple with probability less than 1; that is,Pr⁡(tBimax⁡)<1(i≤k).In this case, the bucketBi contains more than one tuples, and ∑t∈Bi(Pr⁡(t)=1). Essentially, there are two more specific cases here: (1)min⁡(Ft∈Bi(t))>F(tlbmax⁡) and (2)∃t,Ft∈Bi(t)≤F(tlbmax⁡). We discuss these two scenarios in detail, respectively.Case 2.1  (
min
⁡
(
F
t
∈
B
i
(
t
)
)
≥
t
lb
max
⁡
). This case is quite similar to Case 1. We call it the best situation. Since min⁡(Ft∈Bi(t))≥tlbmax⁡, we can conclude that min⁡(Ft∈Bi(t))>Ft∈Bj(k+1≤j≤M)(t). It implies that Bi must devote one tuple to the top-k candidate answer set in any of the possible worlds. Similarly, in this scenario, we still keep Tr unextended, as depicted in Figure 2.Case 2.2  (
∃
t
,
F
t
∈
B
i
(
t
)
≤
F
(
t
lb
max
⁡
)
). Assume that there are l elements in Bi, including tBimax⁡; that is, Bi={tBi1,Pr⁡tBi1,…,tBimax⁡,Pr⁡tBimax⁡,…,tBil,Pr⁡(tBil)}. We consider the worst situation ∀t(t≠tBimax⁡), Ft∈Bi(t)≤F(tlbmax⁡). Under this worst assumption, tBimax⁡ will appear in n/l possible worlds, and it undoubtedly must take a position in top-k set in the n/l possible worlds. However, in the other n(1-1/l) possible worlds, tuples from Bi are kicked out of the top-k set and replaced by tuples from other buckets such as Blb. So, we have to extend Tr in order to make sure that it can cover all the representative tuples whose corresponding buckets contain the tuples with chance to enter top-k candidate sets. Extension of Tr as well as its start and stop principles are as follows.(i)
Extension Start Principle. If ∃t∈Bi,F(t)≤F(tlbmax⁡), Tr extension starts.(ii)
Extension Principle. Tr=Tr∪{tlbmax⁡}, and tlbmax⁡ will be placed to the tail of Tr.(iii)
Extension Stop Principle 1. If tlbmax⁡ is a deterministic tuple, Tr extension stops.(iv)
Extension Stop Principle 2. If, ∀t∈Blb,F(t)>F(tBlb+1max⁡), Tr extension stops.(v)
Extension Stop Principle 3. If, ∀t∈Bi,F(t)>F(tBlb+1max⁡), Tr extension stops.(vi)
Extension Stop Principle 4. If the end of T′ is reached, that is, lb=M, Tr extension stops.Besides Cases 2.1 and 2.2, there are still another situation which is between the best one and the worst one, more than one tuple whose score is larger than F(tlbmax⁡), and others are the opposite. We call it the intermediate situation. This intermediate situation should be handled in the same way as the worst one because, as we mentioned above, we must guarantee that all the tuples with chance to enter top-k candidate set have their bucket representative in Tr. So, the extension of Tr is necessary in this intermediate case.In the above cases, we listed all of the possible situations oftBimax⁡. After tBimax⁡ is handled, we move to the next element in Tr. We keep traversing Tr until the element tBkmax⁡ is handled. Tr becomes larger and larger in this process. Figure 3 illustrates how Tr is extended with tlbmax⁡.Figure 3
The extension ofTr:Tr=Tr∪tBlbmax⁡.


## 4.1.3. Determine the Minimum Scan ScopeDs

After being extended,Tr is 〈tB1max⁡,…,tBkmax⁡,…,tBjmax⁡〉. According to the Extension Principle and the Extension Stop Principles, we can conclude that the buckets corresponding to the tuples in the current Tr, that is, B1,…,Bk,…,Bj, contain all the tuples that have chance to enter the Top-k result sets of some possible worlds. We combine all the tuples in B1,…,Bk,…,Bj, and the minimum scan scope is obtained; that is, Ds=⋃tBimax⁡∈TrBi. Algorithm 1 describes how Ds is generated in detail.Algorithm 1:The MSS4UTop-k algorithm.
Require:
The uncertain datasetD including exclusiveness rules;
The parameterk;
Ensure:
The reduced uncertain datasetDs;
(1) Initialize:T′=ϕ, Tr=ϕ, Ds=ϕ, tlbmax=null;
(2) Re-organizeD: D←{B1,B2,…,BM}; //exclusiveness rules
(3) for (eachBi in D)
(4)tBimax↔Bi;
(5)T′←T′∪tBimax;
(6) end for //T′ is obtained
(7) SortT′;
(8)Tr←{tB1max,tB2max,…,tBkmax}; //the original Tr
(9)tlbmax←tk+1max//⇔lb←k+1
(10) for (i=0; i<k; i++)
(11)  if (Pr(tBimax)=1) then
(12)   continue;
(13)  else
(14)   if (min(Ft∈Bi(t))>F(tlb)) then
(15)    continue;
(16)   else
(17)    while (lb≤M)
(18)  Tr←Tr∪tlbmax;
(19)  if (Pr(tlbmax) = 1) then
(20)   break;
(21)  else
(22)   if ((min(Ft∈Blb(t))>F(tBlb+1max)) ∥ (min(Ft∈Bi(t))>F(tBlb+1max)))
(23)    break;
(24)   else
(25)    lb←lb+1;
(26)   end if
(27)  end if
(28) end while
(29)   end if
(30)  end if
(31) end for //the extendedTr.
(32) for (tBimax∈Tr)
(33)Ds←Ds∪Bi; //using tBimax↔Bi
(34) end for //Ds is obtained.
(35)returnDs;


## 4.1.4. Correctness

In this section, we will prove that theDs-based UTop-k result equals the D-based UTop-k result.Theorem 5.
Assume that the original uncertain dataset isD. Ds is the minimum scan scope for UTop-k queries on D. PWDs is the Ds-based possible world space, and TDs is all the top-k candidates derived from PWDs. TDs∗ is the UTop-k answer based on PWDs. Then, T∗=TDs∗.Proof.
P
W
=
{
PW
1
,
PW
2
,
…
,
PW
n
} is the D-base possible world space, and T is k-length tuple vectors, where each Ti∈T is a possible top-k solution derived from PW. Definitely, if the naive approach is adopted, we can get the correct UTop-k answer T∗=argmaxTi∈T⁡(∑Pr⁡(PW(Ti))). If we use the proposed MSS4UTop-k, we can get Ds=⋃i=1j(j≤M)Bi. It implies that any tuples from the set Bj+1,Bj+2,…,BM have no chance to enter any Ti(Ti∈T).
Case 1  (
j
=
M
). Consider(1)j=M⟹Ds=D⟹T∗=TDs∗.
Case 2  (
M
-
j
=
1
). Consider(2)M-j=1⟹D=Ds∪BM.Suppose BM={tBM1,tBM2,…,tBMl}; then(3)PW=PWDsi∪tBMj∣1≤i≤ml,1≤j≤l.For any tBMj, it has no chance to enter the top-k result set, so we can conclude that Top-k(PW)=Top-k(PWDs); that is,(4)T=TDs.Assume that TDsi∈TDs, according to (4), ∃Tj∈T, and TDsi=Tj. Since the tuples from BM have no influence on the top-k record set in any of the possible worlds, PW(Tj)={PWDs(TDsi)∪tBmx∣1≤x≤l}. So,(5)Pr⁡PWTj=Pr⁡PWDsTDsi∪tBmx∣1≤x≤l.In addition, ∑x=1lPr⁡(tBmx)=1. Then, we have(6)Pr⁡TDsi=Pr⁡Tj.Finally, with the formula (4) and (6), we can conclude(7)T∗=TDs∗.
Case 3  (
M
-
j
>
1
). Consider(8)M-j>1⟹D=Ds∪Bj+1∪Bj+2∪⋯∪BM=⋯Ds∪Bj+1∪Bj+2∪⋯∪BM.Essentially, Case 3 is the extension of Case 2, and it can be proved by repeating the steps in Case 2.In this section, we describe our basic MSS4UTop-k algorithm in detail. Considering the different features of original uncertain dataset, the efficiency of MSS4UTop-k varies. In next section, we will introduce a variation of the MSS4UTop-k algorithm, called Quick MSS4UTop-k. The goal of Quick MSS4UTop-k is to balance the accuracy of minimum scan scope and the efficiency of MSS4UTop-k.


## 4.2. The Quick MSS4UTop-k Algorithm

In the basic MSS4UTop-k algorithm, we traverse T′ from the element tB1max⁡ to the element tBkmax⁡, and for each element we judge its possibility to be in Top-k record set so as to determine whether Tr should be extended. This procedure may result in a large amount of comparison operations and decrease the efficiency of MSS4UTop-k. So, we propose the Quick MSS4UTop-k algorithm to simplify the generation procedure of Tr.Given a uncertain databaseD and a UTop-k query on D, we denote Dd as the set composed of the deterministic tuples in D; that is, Bd={tBi∣tBi∈DandPr⁡(tBi)=1}. The quick MSS4UTop-k algorithm is suitable in the situations where (1)Dd>k and (2) the deterministic tuples are uniformly distributed in D. The quick MSS4UTop-k algorithm is also composed of three phrases.(i) Phrase 1 (determineT′). In this phrase, the sorted representative tuple set T′ is produced. We omit it because this procedure is totally the same as that in the basic MSS4UTop-k algorithm.(ii) Phrase 2 (determineTr). In this phrase, the quick MSS4UTop-k algorithm is different from the basic one. In the quick MSS4UTop-k algorithm, we locate the kth deterministic tuple in T′. We denote it as tBk′max⁡. Obviously, k′≥k and Pr⁡(tBk′max⁡)=1. Then, Tr={tB1max⁡,tB2max⁡,…,tBkmax⁡,…,tBk′max⁡}.(iii) Phrase 3 (determineDs). This phrase is also the same as that of the basic MSS4UTop-k algorithm; that is, Ds=⋃tBimax⁡∈TrBi.Compared with that in the basic MSS4UTop-k algorithm, Tr in the quick MSS4UTop-k algorithm might be enlarged. However, if the deterministic tuples are uniformly distributed in D and Dd is close to D, the number of redundant tuples in Tr will be rational and acceptable. Algorithm 2 describes the detailed procedure of the algorithm Quick MSS4UTop-k.Algorithm 2:The quick MSS4UTop-k algorithm.
Require:
The uncertain datasetD including exclusiveness rules;
The parameterk;
Ensure:
The reduced uncertain datasetDs;
(1) Initialize:T′=ϕ, Tr=ϕ, Ds=ϕ, tlbmax=null;
(2)   Re-organizeD: D←{B1,B2,…,BM}; //exclusiveness rules.
(3)  for (eachBi in D)
(4)tBimax↔Bi;
(5)T′←T′∪tBimax;
(6) end for //T′ is obtained
(7)  SortT′;
(8)i←1;
(9)j←0;
(10)  while (j≤k)
(11)  if (Pr(tBimax)=1) then
(12)j←j+1;
(13)  end if
(14)Tr←Tr∪{tBimax};
(15)i←i+1
(16)  end while //Tr is obtained.
(17)  for (tBimax∈Tr)
(18)Ds←Ds∪Bi; //using tBimax↔Bi.
(19) end for //Ds is obtained.
(20)returnDs;


## 5. Experiments and Analysis

We built our framework on a 3.4-GHz Pentium IV PC with 8 GB main memory. Both the MSS4UTop-k and quick MSS4UTop-k algorithm are implemented in Java and based on the database MySQL5.5. We conducted extensive experiments for two goals: (1) to examine how data distribution and the parameter k affect the minimum scan scope for UTop-k processing; (2) to examine what the performance of the MSS4UTop-k and quick MSS4UTop-k algorithm in time consumption is.


### 5.1. Methodology

Data Set. Our experiment is based on the statistics that describes the driving profiles in expressway of thousands of drivers. It is derived from G15-Expressway Vehicle Speed Monitoring Database. G15 is 387 kilometers long totally, along which there are 13 vehicle speed measurement stations. Each of the measurement stations is equipped with speed detecting radar and HD cameras. When a vehicle passes by, its instant speeds as well as the license plate and timestamps will be recorded and transmitted back to the center database. The upper speed limit of G15 is 120 KM/h for small/medium-sized motor vehicles and 100 KM/h for large-sized vehicles.Traffic insurance companies use the statistical data derived from the Expressway Vehicle Speed Monitoring Database to illustrate the driving profile of drivers. They group speed values of a car according to three predefined ranges:(1) ≥130 for small/medium-sized motors and ≥110 for large-sized vehicles. Speeds in this area mean an extremely dangerous driving behavior: (2) (120, 130) for small/medium-sized motors and (100, 110) for large-sized motors. Speeds in this area mean a dangerous driving behavior: (3) ≤120 for small/medium-sized motors and ≤100 for large motors. Speeds in this area mean a normal-driving behavior. So, given thirteen records of a car, the insurance company will calculate the average speed and frequency at each range; then they obtain a driver’s driving profile. For example, Table 2 is the speed records of a car on G15. According to Table 2, the driver's profile is {tBmax⁡=134.1,1/13,123.8,2/13,tBmin⁡=101.5,10/13}.Table 2
An example of speed records.
RadarID
Speed (KM/h)
G15N001
82.1
G15N002
111.5
G15N003
124.9
G15N004
114.1
G15N005
134.1
G15N006
96.2
G15N007
122.7
G15N008
100.0
G15N009
109.3
G15N010
119.3
G15N011
98.0
G15N012
104.5
G15N013
80.7We use the records on September 22, 2010, in our experiment. We choose the day of September 22, 2010, because the weather was nice and traffic was flowing smoothly on that day. Studies indicate that under these two conditions a driver's driving habit will not be influenced by other drivers. In addition, on G15 the shortest distance between two neighbored monitoring stations is 2.5 KM, which means that the thirteen speed records in dataset for each vehicle can be regarded as being independent. Actually, there were totally 53,717 vehicles that ever ran on G15 on September 22, 2010. We picked out 4823 vehicles of them according to the following two principles:(1) Each vehicle must finish a complete single trip on G15 and (2) its thirteen licence plate photos must be clear enough to be accurately recognized. Next, We use the speed records of these 4823 vehicles to generate the statistical data of driver’s driving profile, as depicted in Table 3.Table 3
Description of experiment data.
Subset
Type
Deterministic?
Number
(
S
/
M
)
D
Small/medium
Yes
1606
(
S
/
M
)
U
Small/medium
No
1872
L
D
Large
Yes
570
L
U
Large
No
775The subdataset(S/M)U and LU is uncertain, and each vehicle may contain 2 or 3 mutually exclusive tuples. The subdatasets (S/M)D and LD are deterministic dataset.Methods and Evaluation Metrics. From the detailed description in Section 4, we can see that data distribution and the value of k are the two key metrics for determining the minimum scan scope for UTop-k queries. So, we test our proposed algorithm MSS4UTop-k and quick MSS4UTop-k in this paper on various datasets with different data distributions: (1) pure uncertain dataset, which is totally composed of uncertain data, and (2) mixed uncertain dataset, which is composed of uncertain data and deterministic tuples. In each of our experiments, we describe the data distribution first. Then, we measure the ratio of the minimum scan scope to the whole dataset; that is, Ratio=Ds/D. The value of k varies from 1 to 1000 uniformly. We also test the time cost of MSSUTop-k and quick MSSUTop-k respectively.


### 5.2. Experiment Results

#### 5.2.1. Pure Uncertain Dataset:(S/M)U∪LU

We combine the subdatasets(S/M)U and (L)U to compose a pure uncertain dataset, which contains the driving profiles of 2647 drivers; that is, the number of X-tuple buckets is 2647. Figure 4(a) is the data distribution of (S/M)U∪LU. We sampled every 20 X-tuple buckets and illustrate the speed ranges of these samples. Figure 4(a) shows that data ranges overlap much.Figure 4
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on pure uncertain dataset.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. Theoretically, the scenario in Figure 4(a) is the worst case because a large amount of tuples will be involved in Top-k query processing, even if the value of k is very small. This is proved in Figure 4(b). For example, when k=1, about 63% of 2647 vehicles have chance to enter the answer set. In this scenario the Extension Stop Principle 1 is invalid. Moreover, the Extension Stop Principles 2 and 3 are hard to be satisfied because the data ranges overlap much. However, we also find that Ds does not go up sharply with k when k≥100. This is because when k≥100, more large-sized vehicles are involved in the calculation of Tr. So, the Extension Stop Principles 2 and 3 are relatively easier to be satisfied. It reflects the truth that, compared with the large-sized vehicles, small/medium-sized vehicles are more inclined to be present in the final Top-k fast car set. In this scenario, quick MSSUTop-k is invalid because the number of deterministic tuples is smaller than k. So, for the pure uncertain dataset as in Figure 4(a) the scan scope of Quick MSSUTop-k algorithm is always the complete uncertain dataset. Figure 4(c) shows the time cost of MSSUTop-k and quick MSSUTop-k. For quick MSSUTop-k, it is just the time to scan the whole uncertain dataset no matter what the parameter k is. For MSSUTop-k, with the increase of k, there are more elements in original Tr. It means that the MSSUTop-k algorithm has to do more comparison operation to determine when the procedure of extension should be started and stopped. So, we can see in Figure 4(c) that the time cost of MSSUTop-k increases with k and the time cost of quick MSSUTop-k remains unchanged.


#### 5.2.2. Mixed Dataset 1:(S/M)D∪(S/M)U∪LU

We conducted our second experiment on the mixed uncertain dataset{(S/M)D∪(S/M)U∪LU}. There are totally 4253 drivers’ driving profiles. Figure 5(a) is the data range distribution of (S/M)D∪(S/M)U∪LU. The feature of this mixed uncertain dataset is that deterministic tuples are not in uniform distribution in the whole dataset. To be specific, most values of the subdataset (S/M)D are lower than the max speed of the tuples in (S/M)U. It reflects the truth that the drivers who observed the upper speed limit drive slower than the drivers who broke the upper speed limit.Figure 5
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on mixed uncertain dataset 1.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. When k is small, this scenario is the same as scenario 1; that is, Ds increase very fast because of the densely distributed uncertain data. However, when k≥50, the deterministic tuples from (S/M)D are extended into Tr. So, the Tr will not increase sharply because the Extension Stop Principle 1 is more likely to be satisfied. Figure 5(c) is comparison of time consumption for MSSUTop-k and quick MSSUTop-k. Essentially, the quick MSSUTop-k abandons the Extension Stop Principles 2 and 3 so as to reduce the cost in comparison operation. Thus, from Figures 5(b) and 5(c), we can see that Ds of quick MSSUTop-k increases faster than that of MSSUTop-k, but quick MSSUTop-k performs better in time cost.


#### 5.2.3. Mixed Dataset 2:(S/M)D∪LU∪LD

In our third experiment we employ another mixed dataset(S/M)D∪LU∪LD, which is illustrated in Figure 6(a). In this uncertain dataset, the data range of deterministic subdataset LD is lower than that of LU, which is similar to the Mixed Dataset 1. However, considering the subdatasets LU and (S/M)D, it is quite different from the Mixed Dataset 1 in data distribution: the data range of the deterministic subdataset (S/M)D partially overlaps with that of the uncertain subdataset LU. It means that the deterministic tuples disseminates in the uncertain tuples. It reflects the truth that the speed of furious-driving large-sized vehicles are almost the same as that of normal-driving small/medium-sized vehicles.Figure 6
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on mixed uncertain dataset 2.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. Theoretically, there will be fewer tuples to be involved in UTop-k query processing in this case. The reason is when the deterministic tuples disseminates in the uncertain tuples, the Extension Stop Principle 1 is more inclined to be satisfied. It is proved by Figure 6(b). Initially, when k is small, the Extension Stop Principles 1, 2, and 3 are all valid. So, the ratio of minimum scan scope to the whole dataset is quite smaller than that of the other two cases above. When k>400, all the uncertain tuples are involved in calculation of minimum scan scope. Hereafter, only the Extension Stop Principle 1 is valid, and the remaining tuples in T′ waiting to be extended into Tr are all deterministic. So, the curves of MSSUTop-k and quick MSSUTop-k in Figure 6(b) overlap when k>400. However, in time consumption, as depicted in Figure 6(c), MSSUTop-k is always more costly than quick MSSUTop-k. This is because the algorithm MSSUTop-k needs more comparison. It reminds us that, given a dataset with a small proportion of uncertain tuples, the approximate result achieved by quick MSSUTop-k may be very closer to or even the same as that of the accurate algorithm, while the time cost of quick MSSUTop-k is much less.


#### 5.2.4. Other Scenarios

Actually, there are15(24-1) combinations with the four subdatasets except for empty one. However, we just choose three typical combinations in our experiments because they can represent other situations of data distributions. For an example, the dataset LU∪LD has the same feature in data distribution as (S/M)D∪(S/M)U, which is included in our second experiment. We also omit the scenarios like (S/M)D, LD, and (S/M)D∪LD. Obviously, these three datasets are completely composed of deterministic tuples. Top-k queries on deterministic dataset have been much studied and are not the emphasis in this paper.


## 5.1. Methodology

Data Set. Our experiment is based on the statistics that describes the driving profiles in expressway of thousands of drivers. It is derived from G15-Expressway Vehicle Speed Monitoring Database. G15 is 387 kilometers long totally, along which there are 13 vehicle speed measurement stations. Each of the measurement stations is equipped with speed detecting radar and HD cameras. When a vehicle passes by, its instant speeds as well as the license plate and timestamps will be recorded and transmitted back to the center database. The upper speed limit of G15 is 120 KM/h for small/medium-sized motor vehicles and 100 KM/h for large-sized vehicles.Traffic insurance companies use the statistical data derived from the Expressway Vehicle Speed Monitoring Database to illustrate the driving profile of drivers. They group speed values of a car according to three predefined ranges:(1) ≥130 for small/medium-sized motors and ≥110 for large-sized vehicles. Speeds in this area mean an extremely dangerous driving behavior: (2) (120, 130) for small/medium-sized motors and (100, 110) for large-sized motors. Speeds in this area mean a dangerous driving behavior: (3) ≤120 for small/medium-sized motors and ≤100 for large motors. Speeds in this area mean a normal-driving behavior. So, given thirteen records of a car, the insurance company will calculate the average speed and frequency at each range; then they obtain a driver’s driving profile. For example, Table 2 is the speed records of a car on G15. According to Table 2, the driver's profile is {tBmax⁡=134.1,1/13,123.8,2/13,tBmin⁡=101.5,10/13}.Table 2
An example of speed records.
RadarID
Speed (KM/h)
G15N001
82.1
G15N002
111.5
G15N003
124.9
G15N004
114.1
G15N005
134.1
G15N006
96.2
G15N007
122.7
G15N008
100.0
G15N009
109.3
G15N010
119.3
G15N011
98.0
G15N012
104.5
G15N013
80.7We use the records on September 22, 2010, in our experiment. We choose the day of September 22, 2010, because the weather was nice and traffic was flowing smoothly on that day. Studies indicate that under these two conditions a driver's driving habit will not be influenced by other drivers. In addition, on G15 the shortest distance between two neighbored monitoring stations is 2.5 KM, which means that the thirteen speed records in dataset for each vehicle can be regarded as being independent. Actually, there were totally 53,717 vehicles that ever ran on G15 on September 22, 2010. We picked out 4823 vehicles of them according to the following two principles:(1) Each vehicle must finish a complete single trip on G15 and (2) its thirteen licence plate photos must be clear enough to be accurately recognized. Next, We use the speed records of these 4823 vehicles to generate the statistical data of driver’s driving profile, as depicted in Table 3.Table 3
Description of experiment data.
Subset
Type
Deterministic?
Number
(
S
/
M
)
D
Small/medium
Yes
1606
(
S
/
M
)
U
Small/medium
No
1872
L
D
Large
Yes
570
L
U
Large
No
775The subdataset(S/M)U and LU is uncertain, and each vehicle may contain 2 or 3 mutually exclusive tuples. The subdatasets (S/M)D and LD are deterministic dataset.Methods and Evaluation Metrics. From the detailed description in Section 4, we can see that data distribution and the value of k are the two key metrics for determining the minimum scan scope for UTop-k queries. So, we test our proposed algorithm MSS4UTop-k and quick MSS4UTop-k in this paper on various datasets with different data distributions: (1) pure uncertain dataset, which is totally composed of uncertain data, and (2) mixed uncertain dataset, which is composed of uncertain data and deterministic tuples. In each of our experiments, we describe the data distribution first. Then, we measure the ratio of the minimum scan scope to the whole dataset; that is, Ratio=Ds/D. The value of k varies from 1 to 1000 uniformly. We also test the time cost of MSSUTop-k and quick MSSUTop-k respectively.


## 5.2. Experiment Results

### 5.2.1. Pure Uncertain Dataset:(S/M)U∪LU

We combine the subdatasets(S/M)U and (L)U to compose a pure uncertain dataset, which contains the driving profiles of 2647 drivers; that is, the number of X-tuple buckets is 2647. Figure 4(a) is the data distribution of (S/M)U∪LU. We sampled every 20 X-tuple buckets and illustrate the speed ranges of these samples. Figure 4(a) shows that data ranges overlap much.Figure 4
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on pure uncertain dataset.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. Theoretically, the scenario in Figure 4(a) is the worst case because a large amount of tuples will be involved in Top-k query processing, even if the value of k is very small. This is proved in Figure 4(b). For example, when k=1, about 63% of 2647 vehicles have chance to enter the answer set. In this scenario the Extension Stop Principle 1 is invalid. Moreover, the Extension Stop Principles 2 and 3 are hard to be satisfied because the data ranges overlap much. However, we also find that Ds does not go up sharply with k when k≥100. This is because when k≥100, more large-sized vehicles are involved in the calculation of Tr. So, the Extension Stop Principles 2 and 3 are relatively easier to be satisfied. It reflects the truth that, compared with the large-sized vehicles, small/medium-sized vehicles are more inclined to be present in the final Top-k fast car set. In this scenario, quick MSSUTop-k is invalid because the number of deterministic tuples is smaller than k. So, for the pure uncertain dataset as in Figure 4(a) the scan scope of Quick MSSUTop-k algorithm is always the complete uncertain dataset. Figure 4(c) shows the time cost of MSSUTop-k and quick MSSUTop-k. For quick MSSUTop-k, it is just the time to scan the whole uncertain dataset no matter what the parameter k is. For MSSUTop-k, with the increase of k, there are more elements in original Tr. It means that the MSSUTop-k algorithm has to do more comparison operation to determine when the procedure of extension should be started and stopped. So, we can see in Figure 4(c) that the time cost of MSSUTop-k increases with k and the time cost of quick MSSUTop-k remains unchanged.


### 5.2.2. Mixed Dataset 1:(S/M)D∪(S/M)U∪LU

We conducted our second experiment on the mixed uncertain dataset{(S/M)D∪(S/M)U∪LU}. There are totally 4253 drivers’ driving profiles. Figure 5(a) is the data range distribution of (S/M)D∪(S/M)U∪LU. The feature of this mixed uncertain dataset is that deterministic tuples are not in uniform distribution in the whole dataset. To be specific, most values of the subdataset (S/M)D are lower than the max speed of the tuples in (S/M)U. It reflects the truth that the drivers who observed the upper speed limit drive slower than the drivers who broke the upper speed limit.Figure 5
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on mixed uncertain dataset 1.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. When k is small, this scenario is the same as scenario 1; that is, Ds increase very fast because of the densely distributed uncertain data. However, when k≥50, the deterministic tuples from (S/M)D are extended into Tr. So, the Tr will not increase sharply because the Extension Stop Principle 1 is more likely to be satisfied. Figure 5(c) is comparison of time consumption for MSSUTop-k and quick MSSUTop-k. Essentially, the quick MSSUTop-k abandons the Extension Stop Principles 2 and 3 so as to reduce the cost in comparison operation. Thus, from Figures 5(b) and 5(c), we can see that Ds of quick MSSUTop-k increases faster than that of MSSUTop-k, but quick MSSUTop-k performs better in time cost.


### 5.2.3. Mixed Dataset 2:(S/M)D∪LU∪LD

In our third experiment we employ another mixed dataset(S/M)D∪LU∪LD, which is illustrated in Figure 6(a). In this uncertain dataset, the data range of deterministic subdataset LD is lower than that of LU, which is similar to the Mixed Dataset 1. However, considering the subdatasets LU and (S/M)D, it is quite different from the Mixed Dataset 1 in data distribution: the data range of the deterministic subdataset (S/M)D partially overlaps with that of the uncertain subdataset LU. It means that the deterministic tuples disseminates in the uncertain tuples. It reflects the truth that the speed of furious-driving large-sized vehicles are almost the same as that of normal-driving small/medium-sized vehicles.Figure 6
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on mixed uncertain dataset 2.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. Theoretically, there will be fewer tuples to be involved in UTop-k query processing in this case. The reason is when the deterministic tuples disseminates in the uncertain tuples, the Extension Stop Principle 1 is more inclined to be satisfied. It is proved by Figure 6(b). Initially, when k is small, the Extension Stop Principles 1, 2, and 3 are all valid. So, the ratio of minimum scan scope to the whole dataset is quite smaller than that of the other two cases above. When k>400, all the uncertain tuples are involved in calculation of minimum scan scope. Hereafter, only the Extension Stop Principle 1 is valid, and the remaining tuples in T′ waiting to be extended into Tr are all deterministic. So, the curves of MSSUTop-k and quick MSSUTop-k in Figure 6(b) overlap when k>400. However, in time consumption, as depicted in Figure 6(c), MSSUTop-k is always more costly than quick MSSUTop-k. This is because the algorithm MSSUTop-k needs more comparison. It reminds us that, given a dataset with a small proportion of uncertain tuples, the approximate result achieved by quick MSSUTop-k may be very closer to or even the same as that of the accurate algorithm, while the time cost of quick MSSUTop-k is much less.


### 5.2.4. Other Scenarios

Actually, there are15(24-1) combinations with the four subdatasets except for empty one. However, we just choose three typical combinations in our experiments because they can represent other situations of data distributions. For an example, the dataset LU∪LD has the same feature in data distribution as (S/M)D∪(S/M)U, which is included in our second experiment. We also omit the scenarios like (S/M)D, LD, and (S/M)D∪LD. Obviously, these three datasets are completely composed of deterministic tuples. Top-k queries on deterministic dataset have been much studied and are not the emphasis in this paper.


## 5.2.1. Pure Uncertain Dataset:(S/M)U∪LU

We combine the subdatasets(S/M)U and (L)U to compose a pure uncertain dataset, which contains the driving profiles of 2647 drivers; that is, the number of X-tuple buckets is 2647. Figure 4(a) is the data distribution of (S/M)U∪LU. We sampled every 20 X-tuple buckets and illustrate the speed ranges of these samples. Figure 4(a) shows that data ranges overlap much.Figure 4
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on pure uncertain dataset.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. Theoretically, the scenario in Figure 4(a) is the worst case because a large amount of tuples will be involved in Top-k query processing, even if the value of k is very small. This is proved in Figure 4(b). For example, when k=1, about 63% of 2647 vehicles have chance to enter the answer set. In this scenario the Extension Stop Principle 1 is invalid. Moreover, the Extension Stop Principles 2 and 3 are hard to be satisfied because the data ranges overlap much. However, we also find that Ds does not go up sharply with k when k≥100. This is because when k≥100, more large-sized vehicles are involved in the calculation of Tr. So, the Extension Stop Principles 2 and 3 are relatively easier to be satisfied. It reflects the truth that, compared with the large-sized vehicles, small/medium-sized vehicles are more inclined to be present in the final Top-k fast car set. In this scenario, quick MSSUTop-k is invalid because the number of deterministic tuples is smaller than k. So, for the pure uncertain dataset as in Figure 4(a) the scan scope of Quick MSSUTop-k algorithm is always the complete uncertain dataset. Figure 4(c) shows the time cost of MSSUTop-k and quick MSSUTop-k. For quick MSSUTop-k, it is just the time to scan the whole uncertain dataset no matter what the parameter k is. For MSSUTop-k, with the increase of k, there are more elements in original Tr. It means that the MSSUTop-k algorithm has to do more comparison operation to determine when the procedure of extension should be started and stopped. So, we can see in Figure 4(c) that the time cost of MSSUTop-k increases with k and the time cost of quick MSSUTop-k remains unchanged.


## 5.2.2. Mixed Dataset 1:(S/M)D∪(S/M)U∪LU

We conducted our second experiment on the mixed uncertain dataset{(S/M)D∪(S/M)U∪LU}. There are totally 4253 drivers’ driving profiles. Figure 5(a) is the data range distribution of (S/M)D∪(S/M)U∪LU. The feature of this mixed uncertain dataset is that deterministic tuples are not in uniform distribution in the whole dataset. To be specific, most values of the subdataset (S/M)D are lower than the max speed of the tuples in (S/M)U. It reflects the truth that the drivers who observed the upper speed limit drive slower than the drivers who broke the upper speed limit.Figure 5
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on mixed uncertain dataset 1.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. When k is small, this scenario is the same as scenario 1; that is, Ds increase very fast because of the densely distributed uncertain data. However, when k≥50, the deterministic tuples from (S/M)D are extended into Tr. So, the Tr will not increase sharply because the Extension Stop Principle 1 is more likely to be satisfied. Figure 5(c) is comparison of time consumption for MSSUTop-k and quick MSSUTop-k. Essentially, the quick MSSUTop-k abandons the Extension Stop Principles 2 and 3 so as to reduce the cost in comparison operation. Thus, from Figures 5(b) and 5(c), we can see that Ds of quick MSSUTop-k increases faster than that of MSSUTop-k, but quick MSSUTop-k performs better in time cost.


## 5.2.3. Mixed Dataset 2:(S/M)D∪LU∪LD

In our third experiment we employ another mixed dataset(S/M)D∪LU∪LD, which is illustrated in Figure 6(a). In this uncertain dataset, the data range of deterministic subdataset LD is lower than that of LU, which is similar to the Mixed Dataset 1. However, considering the subdatasets LU and (S/M)D, it is quite different from the Mixed Dataset 1 in data distribution: the data range of the deterministic subdataset (S/M)D partially overlaps with that of the uncertain subdataset LU. It means that the deterministic tuples disseminates in the uncertain tuples. It reflects the truth that the speed of furious-driving large-sized vehicles are almost the same as that of normal-driving small/medium-sized vehicles.Figure 6
Data distribution, minimum scan scope, and time cost of MSSUTop-k and quick MSSUTop-k on mixed uncertain dataset 2.
(a)
Data distribution
(b)
Minimum scan scope versusk
(c)
Time cost comparisonResult Analysis. Theoretically, there will be fewer tuples to be involved in UTop-k query processing in this case. The reason is when the deterministic tuples disseminates in the uncertain tuples, the Extension Stop Principle 1 is more inclined to be satisfied. It is proved by Figure 6(b). Initially, when k is small, the Extension Stop Principles 1, 2, and 3 are all valid. So, the ratio of minimum scan scope to the whole dataset is quite smaller than that of the other two cases above. When k>400, all the uncertain tuples are involved in calculation of minimum scan scope. Hereafter, only the Extension Stop Principle 1 is valid, and the remaining tuples in T′ waiting to be extended into Tr are all deterministic. So, the curves of MSSUTop-k and quick MSSUTop-k in Figure 6(b) overlap when k>400. However, in time consumption, as depicted in Figure 6(c), MSSUTop-k is always more costly than quick MSSUTop-k. This is because the algorithm MSSUTop-k needs more comparison. It reminds us that, given a dataset with a small proportion of uncertain tuples, the approximate result achieved by quick MSSUTop-k may be very closer to or even the same as that of the accurate algorithm, while the time cost of quick MSSUTop-k is much less.


## 5.2.4. Other Scenarios

Actually, there are15(24-1) combinations with the four subdatasets except for empty one. However, we just choose three typical combinations in our experiments because they can represent other situations of data distributions. For an example, the dataset LU∪LD has the same feature in data distribution as (S/M)D∪(S/M)U, which is included in our second experiment. We also omit the scenarios like (S/M)D, LD, and (S/M)D∪LD. Obviously, these three datasets are completely composed of deterministic tuples. Top-k queries on deterministic dataset have been much studied and are not the emphasis in this paper.


## 6. Conclusions

In this paper, we introduce two novel algorithms MSSUTop-k and quick MSSUTop-k for determining the minimum scan scope of UTop-k queries in uncertain databases. We test the performance of the proposed algorithms through extensive experiments based on real dataset. In addition, by analyzing the relationship between the minimum scan scope for processing UTop-k queries and the data distribution of various of uncertain dataset, we know that the ratio of minimum scan scope to the whole uncertain dataset varies dramatically because of different data distribution. It demonstrates that this work should be the indispensable prerequisite for UTop-k processing. By the work in this paper, given a uncertain dataset and k, users can determine exactly in advance how many tuples and which tuples will be involved for processing UTop-k queries. Then, they can make a balance between the result precision and processing cost and then choose a proper optimized solution according to the computing resources they have.



---

*Source: 359137-2015-10-11.xml*