satisfaction problem (BCSP), which is verbally defined in [6] as: â A set of n variables {x0,..., xnâ1}. â For each variable xi a finite domain Diof potential values.
Heuristic Algorithms for Similar Configuration Retrieval in Spatial Databases Dinos Arkoumanis, Manolis Terrovitis,Lefteris Stamatogiannakis Dept. of Electrical and Computer Engineering National Technical University of Athens Zographou 157 73 Athens, Greece {dinosar,mter,estama}@dblab.ntua.gr
Abstract. The search for similar configurations is an important research topic for content-based image retrieval in G.I.S. and spatial databases. Due to the complexity of the problem, finding the fittest solution in a large database is computationally intractable. Our work is focused on designing, implementing and experimentally evaluating two heuristic algorithms, an evolutionary and a hill-climbing one, that provide an approximate solution. With the use of spatial indexes we manage to efficiently deal with considerably large queries. We utilize a similarity framework that addresses topological, directional and distance relations. In this framework the problem of retrieving similar configurations is defined as a binary constraint satisfaction problem. Our work complements the existing work on similarity retrieval with two efficient, stochastic, algorithms.
1
Introduction
A user of a G.I.S. system usually searches for configurations of spatial objects on a map that match some ideal configuration or are bound by a number of constraints. For example, a user may be looking for a place to build a house. He wishes to have a house A north of the town that he works, in a distance no greater than 10km from his child’s school Band next to a park C. Moreover, he would like to have a supermarket D on its way to work. Modern GIS systems look for a solution that satisfies all query conditions. In the case of complex queries, like the above, it is very unlikely that a solution in the database exists. An answer that indicates that no solution has been found is not very helpful. In these cases the user is interested to know the closest possible answer. The way to overcome this is either by having the user to relax the constraints he sets on his ideal house configuration, or having an algorithm that returns the fittest configurations rated by some similarity metric. The problem of configuration similarity retrieval in spatial databases expresses the latter approach of the problem. It has been an active area of research in the recent years [8]. Similar problems are very common in information retrieval areas (WWW search engines
are a good example of this), where the user has an overview of the alternatives if a perfect solution is not found. Our work focuses on similar configurations retrieval. Retrieving the fittes t configuration is a computationally intensive procedure. We use the similarity framework of [8]. We address three kinds of relations: topological, directional and distance. Related work is presented by Roussopoulos et. al. [12]. They propose a technique for answering nearest neighbor queries with the help of an R-tree index. Papadias et. al in [9], reduce the configuration similarity retrieval to several smaller ones with the use of a spatial index. [9] uses only topological relations. Moreover, the authors investigate variations of a forward checking and a minimum conflict local search algorithm. Finally, Papadias et. al., in [10], propose a few algorithms for a similar problem, but deal with small queries and with a limited version of the problem. Related work partially deals with the problem as defined in [8] or address rather easy versions of it. In this paper we design, implement and evaluate two heuristic algorithms; a Hill-Climbing and an evolutionary one, and we investigate the successful integration of the R*-tree index in them. We find an approximate solution to the most computationally intensive version of the problem, using at the same time significantly larger queries than most in approaches that have appeared in the past. We experimentally evaluate the effect of several parameters on the algorithms’ performance and study the behavior of several of their variations. The rest of the paper is organized as follows: In Sections 2 and 3 we present the similarity retrieval framework. Section 4 proposes a Hill-Climbing and an evolutionary algorithm. In Section 7 we present the results of the experimental evaluation of the algorithms’ performance. Our conclusions are presented in Section 8.
2
Spatial Relations
As mentioned in Section 1, we use a similarity framework that relies on three kinds of spatial relations, namely topological, directional and distance. Let us now present a short description of each one. Topological relations express the concepts of inclusion and neighborhood. We use the topological relations of the 9-intersection model [2]. This model identifies the following 8 pair-wise disjoint topological relations (Figure 1): {Disjoint, Meet, Overlap, Inside, Covered by, Equal, Contains, Covers} Two topological relations Ti and Tj are first degree neighbors iff there is an edge (Ti , Tj ) in the graph of Figure 1. For instance, Overlaps and Covers are first degree neighbors while Overlaps and Equals are not. The similarity sigmaT of two topological relations Ti and Tj is defined as follows [PAK98]:
p
p q
q
Covered_by
p p
q Disjoint
q Meet
q
p
Inside
q
Overlap
Equal
p
p
p q Covers
q Contains
Fig. 1. Topological relations and 1st degree neighbors graph
σT (Ti , Tj ) =
1 Ti = Tj τ (0 < τ < 1) if Ti and Tj are 1 st degree neighbors 0 otherwise
(1)
where τ is an application defined constant. relative to one another (e.g., object a is north of object a). We follow a centroid-based approach where the direction between objects is determined by the angle between their centroids (a more expressive model is discussed in [14]). This models identifies the following 8 directions: {NorthEast, North, NorthWest, West, SouthWest, South, SouthEast, East}. The similarity σ A of each direction with a given angle θ is the following trapezoid function [8]: (i − 1)45o < θ < i45o − α θ/(i45o − a) 1 i45o − α ≤ θ ≤ i45o + α σA = (Ai , θ) = if o o i45o + α < θ < (i + 1)45o ((i + 1)45 − θ)/(i45 − α) 0 otherwise (2) where α is a constant that expresses the tolerance in our directional relations, and i is an integer in the range 1..8. For θ = 0, we have an eastbound relation. A distance relation D[d1 ,d2 ] between two objects indicates that the distance between the centeroids of the two objects is no less than d1 and no more than d2 . For instance, relation D[0,d] means “closer than d” and relation D[d,∞] means “further than d”. The similarity measure of a distance dx with the relation D[d1 ,d2 ] is given by the following equation [8]: 1 d ≤ dx ≤ d2 σD (D[d1 ,d2 ] , dx ) = (3) if 1 otherwise 0
3
Similarity Retrieval as a Constraint Satisfaction Problem
Let us assume that we have a database storing the spatial objects Oof an image I. Let also C be a set of query conditions. A typical database query Q looks
x1 x3
9k
m
o5 9.8
o3
o7 km
o1 o6
x2
x0
o4 o0 o8
Fig. 2. Prototype
o2
Fig. 3. Solution
for objects in the database that satisfy all conditions C. A similarity query is something more general. It considers that conditions C describe a prototype and looks for objects that are similar to it. In this section, we formalize such queries as constraint satisfaction problems and we define a metric (the satisfaction degree) that can be used to express similarity. Example 1. Let us now consider the following similarity query over the spatial objects {o0 , ..., o8 } of the image of Figure 3: “Retrieve all configurations that are similar to the scene where there are four objects x0 , x1 , x2 and x3 such that object x0 meets object x1 , object x1 is disjoint to object x2 and it is in a distance of 8km to 10km from object x2 and object x2 overlaps with object x3 , which is north from object x2 .” Figure 2 illustrates the prototype of the example query. The assignment {x0 ← o4 , x1 ← o5 , x2 ← o6 , x3 ← o7 }, illustrated in Figure 3, is similar to the prototype; only one condition is lost since x2 does not overlap with x3 . A configuration similarity query Qcan be formalized as a binary constraint satisfaction problem (BCSP), which is verbally defined in [6] as: – A set of n variables {x0 ,. . . , xn−1 }. – For each variable xi a finite domain Di of potential values. – For each pair of variables xi , xj a set of binary constraints Cij , where Cij is a subset of Di × Dj . Thus, a query Qis a triplet (V , D, C) where V ={x0 , . . . , xn−1 } is a set of variables, D = {D0 , . . . , Dn−1 } is the set of their domains and C is a set of constraints over x0 , . . . , xn−1 . Let {x0 ← oo , . . . , xn−1 ← on−1 } be an assignment of variables (where oi ∈ Di ). The satisfaction degree of an assignment {x0 ← o0 , . . . , xn−1 ← on−1 }, expresses how close this configuration is to the query’s prototype and is defined as follows [8]. σ=
σT (CT (xi ,xj ),T (oi ,oj ))+σA (CA (xi ,xj ),θ(oi ,oj ))+σD (CD (xi ,xj ),d(oi ,oj ))
i=l,0≤i,j