SlowGuess/NeurIPS_2023_OCR huggingface dataset:
Mengzhao Wang
Hangzhou Dianzi University
wmzssy@yeah.net
Lingwei Lv
llw@hdu.edu.cn
Xiaoliang Xu*
xxl@hdu.edu.cn
Yuxiang Wang
lsswyx@hdu.edu.cn
Qiang Yue
yq@hdu.edu.cn
Jiongkang Ni
hananoyuuki@hdu.edu.cn
This paper introduces an efficient and robust framework for hybrid query (HQ) processing, which combines approximate nearest neighbor search (ANNS) with attribute constraint. HQ aims to find objects that are similar to a feature vector and match some structured attributes. Existing methods handle ANNS and attribute filtering separately, leading to inefficiency and inaccuracy. Our framework, called native hybrid query (NHQ), builds a composite index based on proximity graph (PG) and applies joint pruning for HQ. We can easily adapt existing PGs to this framework for efficient HQ processing. We also propose two new navigable PGs (NPGs) with optimized edge selection and routing, which improve the overall ANNS performance. We implement five HQ methods based on the proposed NPGs and existing PGs in NHQ, and show that they outperform the state-of-the-art methods on 10 real-world datasets (up to  $315 \times$  faster with the same accuracy).
Approximate nearest neighbor search (ANNS) is a crucial problem in data science and AI applications [27, 43, 9, 47]. For example, in a paper-retrieval system based on ANNS, a user wants to find papers that are most similar to her query text. As Fig. 1(a) shows, the system converts each paper's unstructured text and the query text into feature vectors in a high-dimensional space. Then it uses a vector index to perform ANNS and obtain papers with similar content. Many effective ANNS methods have been developed to balance query efficiency and accuracy [18, 19, 36, 40, 11].
However, ANNS does not support many real-world scenarios where users want to find objects with similar feature vectors to the query object and meets the given attribute constraint (e.g., topic, venue, and publish_year of a paper) [51, 41]. We call this a hybrid query  $(HQ)$  [51, 54, 60, 32, 50, 41, 42]. For instance, in Fig. 1(b), a user wants to find some recent papers from top-tier conferences related to her research interest. She can form a HQ by providing a descriptive text of her interest and two paper attributes (e.g., NeurIPS and 2022). However, the traditional ANNS shown in Fig. 1(a) only finds papers with similar content, and it cannot guarantee matching attribute constraint. Therefore, many have tried to add attribute filtering (AF) on top of ANNS to answer a HQ [54, 51, 60].
Vearch [29] uses ANNS to find candidates that match the feature vector, and then applies AF to get the final results [32]. This strategy can work with other ANNS libraries, such as SPTAG [37], NGT [59], and Faisss [17]. On the other hand, Alibaba AnalyticDB-V (ADBV) [54] employs product
Figure 1: An example of different paper-retrieval schemes, including (a) ANNS and (c-d) HQ. ANNS retrieves results with semantically similar content, but it does not check the attribute constraint. A HQ processing obtains results that match both the feature vector and attribute constraints.
quantization (PQ)[28] to create multiple query plans. One of them is to do AF first and then ANNS to return the final results. This method is scalable and suitable for most use cases [51]. Milvus [38] partitions the dataset into subsets based on common attributes. This way, it can quickly select the subsets that meet the query's attribute constraints, and only perform ANNS on them instead of the whole dataset. This improves the search efficiency [51].
These solutions have a common idea: they do AF and ANNS separately in different orders (see Appendix A for details). No matter what order they use, the whole query pipeline can be simplified as Fig. 1(c), where two subquery systems (for AF and ANNS) are built independently. They can answer a HQ, but they are not designed for it, which affects their efficiency and effectiveness.
1.1 Limitations of Existing Methods
L1: Two indexes need to be kept at the same time. Fig. 1(c) shows that existing methods need both the attribute index and vector index for two separate subquery systems. This takes more memory space and adds more logic (e.g., merging) to make sure two indexes are consistent and query results are correct [54]. Updating different indexes at the same time is hard when the data changes often.
L2: Extra computational cost from two separate pruning strategies. For existing methods, pruning is done based on attribute index and vector index separately, which increases computational cost. For example, suppose that the vector index in Fig. 1(c) is a proximity graph (PG, we define it in Def. 4) [52], where each vertex is an object's feature vector. Then, some vertices near the query object's feature vector but not matching the attributes can make the search follow wrong paths and return wrong answers to a HQ. We prune these wrong answers in the attribute-filtering phase, but the computational cost for returning them in the ANNS phase is unnecessary and inefficient.
L3: Query results rely on the merging of the candidates from both subquery systems. As Fig. 1(c) shows, we need to merge the top- $k$  candidates  $C_1$  and  $C_2$  from both subquery systems to get the final results  $R = C_1 \cap C_2$ . But usually we have  $|R| \ll k$ . This is because existing methods do ANNS and AF separately, so each system can only return candidates that meet one type of constraint. To make  $|R|$  bigger, we need to make  $C_1$  and  $C_2$  bigger, which makes both systems slower [60].
L4: Existing methods are not friendly for PGs. Recent methods, like ADBV [54] and Milvus [51], use a "first AF, then ANNS" strategy to answer a HQ; they only use PQ [28] for ANNS. But many studies have shown PG is  $10 \times$  faster than PQ for ANNS [5, 33], so we need to find a way to use PG in HQ. A simple way is to replace PQ-based vector index with PG-based one, but it has some problems: (1) In the "first AF, then ANNS" strategy, we want to find similar vectors from a dynamic space of the vectors filtered by attributes. It is not efficient to build a vector index for these filtered vectors in runtime. (2) Even worse, if we list all possible combinations of attribute values and prebuild a vector index for each one offline (like [56]), it would take too much memory space, e.g.,  $m^n$  different indexes for  $n$  attributes where each attribute has  $m$  values.
To sum up, most of these limitations happen because existing methods answer HQ in a "decomposition-assembly" model, where a HQ is split into two subqueries that process separately and then combine the results. This motivates us to present a new general framework for HQ that works well with existing PGs. It has the well-designed composite index and joint pruning modules to support ANNS with attribute constraint, instead of keeping two separate indexes and doing pruning separately.
1.2 Our Solution and Contributions
To the best of our knowledge, we are the first to present a Native Hybrid Query framework (NHQ) for ANNS with attribute constraint in a fused way, not the "decomposition-assembly" model used by
existing methods. As Fig. 1(d) shows, our framework first combines feature vectors and attributes in a well-designed composite index (for L1); then it prunes the search space on the composite index by considering both the feature vector and attribute constraints (for L2); and finally, it gets the final top- $k$  results directly without a merging operation (for L3). Our NHQ is a general framework, where the composite index is based on PG, so existing PGs can easily work with NHQ (for L4) and it also supports custom-optimized PGs. Our main contributions are:
- We introduce NHQ, a general framework for ANNS with attribute constraint (§3). NHQ works well with existing PGs, and can make them handle HQ only by a lightweight modification.
- We design two navigable PGs (NPGs) with optimized edge selection and routing strategies ( $\S 4$ ), which have better efficiency-vs-accuracy trade-off than basal PGs.
- We use the proposed NPGs and existing PGs in our NHQ framework, and get several new HQ methods that beat the state-of-the-art competitors on all datasets (up to  $315 \times$  faster, §5.3).
- We show our methods' better effectiveness, efficiency, and scalability on 10 real-world datasets, compared with state-of-the-art HQ frameworks and methods (\$5).
Definition 1 Object Set. An object set is defined as a set  $S = \{e_0, \dots, e_{n-1}\}$  of size  $n$ . For each object  $e \in S$ , (1) its features are represented as a high-dimensional vector, denoted by  $\nu(e)$ , (2)  $e$  has a set of attributes denoted by  $\{a_0, \dots, a_{m-1}\}$  and  $e.a_i$  indicates the value of attribute  $a_i$  of  $e$ . Moreover, we define the feature vector set of all objects in  $S$  as  $\mathcal{X} = \{\nu(e)|e \in S\}$ .
Example 1 An object set could refer to different types of data, e.g., images, papers. When we specify each object  $e$  as a paper, it carries two types of information: one is the implicit semantics behind the text, which is usually represented as a feature vector  $\nu(e)$  by neural network, e.g., BERT [13]; and another is the explicit attributes, e.g., {venue, topic}, such as  $e$ . venue = "NeurIPS".
Given an object set  $S$  and a user-input query object  $q$ , many approaches have been studied to retrieve the most similar objects to  $q$  from  $S$  by considering feature vectors' distance alone [15, 36, 16]. In the following, we first introduce ANNS, then formally define the HQ that we study.
For an object  $e \in S$  and its feature vector  $\nu(e) \in \mathcal{X}$ , we write  $\nu(e) = [\nu(e)^0, \nu(e)^1, \dots, \nu(e)^{d-1}]$ , where  $\nu(e)^i$  is the value of  $\nu(e)$  on the  $i$ -th dimension. We focus on the high-dimensional case where  $d$  is from hundreds to thousands. For any two objects  $e, o \in S$  with feature vectors  $\nu(e), \nu(o) \in \mathcal{X}$ , we can measure their similarity with different methods, such as Euclidean distance [19] and Cosine similarity [36]. Euclidean distance is the most popular method [33], which is in Eq. 1.
$$
\delta (\nu (e), \nu (o)) = \sqrt {\sum_ {i = 0} ^ {d - 1} (\nu (e) ^ {i} - \nu (o) ^ {i}) ^ {2}} \tag {1}
$$
Definition 2 NNS [18, 20, 45]. Given an object set  $S$  and a query object  $q$  with the feature vector  $\nu(q)$ , the NNS aims at obtaining the top- $k$  objects from  $S$  whose feature vectors are closest to  $\nu(q)$ .
In Def. 2, the exact top- $k$  objects (denoted by  $T$ ) hold that
$$
T = \arg \min  _ {T \subseteq \mathcal {S}, | T | = k} \sum_ {e \in T} \delta (\nu (e), \nu (q)) \quad . \tag {2}
$$
Exact NNS on a large  $S$  is not feasible because it takes too much computation [52]. So, an ANNS is more realistic, as it balances accuracy and efficiency with a vector index [52]. Let  $T$  be the exact top-  $k$  objects from Def. 2 and  $R$  be the approximate top-  $k$  objects from an ANNS method. We can use recall rate  $Recall@k$  to measure the search accuracy of the approximate method:
$$
\operatorname {R e c a l l} @ k = \frac {| R \cap T |}{k}. \tag {3}
$$
A bigger  $Recall@k$  means more accurate results from ANNS.
Figure 2: NHQ framework overview.
To return the query results fast, ANNS makes a vector index based on the feature vector. We can classify ANNS methods into four types by how they make the index: quantization [28, 23]; tree [46, 2]; hashing [22, 24]; and proximity graph (PG)[36, 19]. Many works [33, 19] have shown that the PG-based methods have better efficiency vs accuracy trade-off.
Definition 3 Hybrid Queries (HQ). Given an object set  $S$  and a query object  $q$  with a feature vector  $\nu(q)$  and a set of attributes  $\{a_0, \ldots, a_{m-1}\}$  of size  $m$ , the HQ returns the top-k objects from  $S$ , denoted by  $T$ . The objects in  $T$  satisfy two conditions: ① attribute filtering (AF): they have the same attributes as  $q$ —that is, for any  $e \in T$ ,  $\forall i = 0, 1, \dots, m-1$ ,  $e.a_i = q.a_i$ ; and ② ANNS: their feature vectors are the closest to  $\nu(q)$  among those that meet ①.
It is also too slow to answer an exact HQ on a large  $S$ . So, current research works on an approximate HQ processing [51, 54] and the query accuracy is measured by Eq. 3 for a returned  $R$  from the approximate method. HQ is an extended ANNS with attribute constraint [51]. But it is a challenging problem, because all existing methods have accuracy and efficiency issues (L1-L4 in §1.1).
3 NHQ Framework
We begin by defining proximity graph (PG) and then introduce the NHQ framework based on PG.
Definition 4 PG. Given an object set  $S$ , we define the PG of  $S$  w.r.t. an distance threshold  $B$  as a graph  $G = (V, E)$  with the vertex set  $V$  and edge set  $E$ . ① For each vertex  $u \in V$ , it corresponds to an object  $e \in S$ . ② For any two vertices  $u_i$  and  $u_j$  from  $V$ , if  $u_i u_j \in E$ , we have  $\delta(\nu(u_i), \nu(u_j)) \leq B$ , where  $\nu(u_i)$  and  $\nu(u_j)$  is the feature vectors of objects  $u_i$  and  $u_j$ , respectively.
Let  $N(u_{i})$  be the neighbor set of  $u_{i}$ . Our idea is to build a PG that uses both feature vectors and attributes as a composite index. In the index, the neighbors of  $u$  may have the same attributes as  $u$ . We can use Eq. 1 to measure the feature vector distance, but we need to quantify the attributes and define a distance metric function [55]. Then, we can fuse the feature vector distance and the attribute distance into a fusion distance to compare the objects. Therefore, we can directly prune the vertices that have either dissimilar feature vectors or different attributes with the fusion distance.
Fusion distance. Given an object set  $S$  with feature vectors  $\mathcal{X}$  (see Fig. 2, bottom left), we can use different encoding methods [3, 44, 48] to encode the attributes of each object  $e \in S$ . Ordinal encoding works well for structured attributes [53]. We use ordinal encoding  $\ell(\cdot)$  to get an attribute vector  $\ell(e) = [\ell(e)^0, \dots, \ell(e)^{m-1}]$  for each object  $e$ , where  $\ell(e)^i$  is  $e.a_i$ 's encoded value (e.g.,  $\{\text{NeurIPS}, \text{NLP}\}$  can be encoded as [1, 3] by  $\ell(\cdot)$ ). Then, we get attribute vectors  $\mathcal{Y} = \{\ell(e) | e \in S\}$ .
We can measure the distance between two feature vectors  $\nu(e_i)$  and  $\nu(e_j)$  in  $\mathcal{X}$  by using Eq. 1. We can measure the distance between two attribute vectors  $\ell(e_i)$  and  $\ell(e_j)$  in  $\mathcal{Y}$  by using this formula:
$$
\chi \left(\ell \left(e _ {i}\right), \ell \left(e _ {j}\right)\right) = \sum_ {k = 0} ^ {m - 1} \phi \left(\ell \left(e _ {i}\right) ^ {k}, \ell \left(e _ {j}\right) ^ {k}\right) \quad , \tag {4}
$$
where  $\phi (\ell (e_i)^k,\ell (e_j)^k)$  is
$$
\phi \left(\ell \left(e _ {i}\right) ^ {k}, \ell \left(e _ {j}\right) ^ {k}\right) = \left\{ \begin{array}{l l} 0 & \quad \ell \left(e _ {i}\right) ^ {k} = \ell \left(e _ {j}\right) ^ {k} \\ 1 & \quad \ell \left(e _ {i}\right) ^ {k} \neq \ell \left(e _ {j}\right) ^ {k} \end{array} \right.. \tag {5}
$$
In Eq. 4-5,  $m$  is the number of dimensions in  $\ell(e_i)$ , and  $\ell(e_i)^k$  is the value on the  $k$ -th dimension. The smaller this distance is, the more similar the attribute vectors are.
We can fuse the feature vector distance  $\delta(\nu(e_i), \nu(e_j))$  and the attribute vector distance  $\chi(\ell(e_i), \ell(e_j))$  into a single distance  $\Gamma(e_i, e_j)$  for objects  $e_i$  and  $e_j$  by using this formula:
$$
\Gamma \left(e _ {i}, e _ {j}\right) = w _ {\nu} \cdot \delta \left(\nu \left(e _ {i}\right), \nu \left(e _ {j}\right)\right) + w _ {\ell} \cdot \chi \left(\ell \left(e _ {i}\right), \ell \left(e _ {j}\right)\right), \tag {6}
$$
where  $w_{\nu}$  and  $w_{\ell}$  are distance weights. The smaller this distance is, the more similar the objects are in both feature vectors and attributes. Eq. 6 is a simple and practical way to combine two different distances. It also makes it easy to build a composite index on top of existing PGs, because we just need to change the distance measure from Eq. 1 to Eq. 6. For example, if we set  $w_{\nu} = 1$  and  $w_{\ell} = 0$ , we get  $\Gamma(e_i, e_j) = \delta(\nu(e_i), \nu(e_j))$ , which is the same as building a PG based on feature vector. If we set  $w_{\nu} = 0$  and  $w_{\ell} = 1$ , we get  $\Gamma(e_i, e_j) = \chi(\ell(e_i), \ell(e_j))$ , which is a PG based on attribute. So, we can find the best balance between two distances by adjusting  $w_{\nu}$  and  $w_{\ell}$ .
Weight configuration. We found that  $w_{\nu} = 1$  and  $w_{\ell} = \delta(\nu(e_i), \nu(e_j)) / m$  give the best query performance for most datasets and algorithms (see Appendix U). These weights do not depend on the dataset, but only on the feature vector distance  $\delta(\nu(e_i), \nu(e_j))$  of two objects and the attribute vector dimension  $m$ . The idea is to fine-tune the feature vector distance with the attribute distance. For example, if  $e_i$  and  $e_j$  have the same attributes, that is,  $\chi(\ell(e_i), \ell(e_j)) = 0$ , we keep the feature vector distance as it is (i.e.,  $\Gamma(e_i, e_j) = \delta(\nu(e_i), \nu(e_j))$ ). If  $e_i$  and  $e_j$  have completely different attributes, that is,  $\chi(\ell(e_i), \ell(e_j)) = m$ , we double the feature vector distance to get  $\Gamma(e_i, e_j) = 2 \cdot \delta(\nu(e_i), \nu(e_j))$ . In general, we have  $\delta(\nu(e_i), \nu(e_j)) \leq \Gamma(e_i, e_j) \leq 2 \cdot \delta(\nu(e_i), \nu(e_j))$ .
Composite index. We build a composite index based on Algorithm 1 (see Fig. 2, bottom right). We start with  $V = S$ , so each object  $e \in S$  is a vertex  $u \in V$  in  $G$ , and  $E = \emptyset$ . Then, we add an edge  $u_i u_j \in E$  between two vertices  $u_i, u_j \in V$  if  $\Gamma(u_i, u_j) \leq B'$ , where  $B'$  is a fusion distance threshold. Note that our composite index does not incur extra space cost, as shown in Lemma 1.
Lemma 1 The composite index and the ordinary  $PG$  have the same index size for an object set  $S$ .
Algorithm 1: Building Composite Index  $(S)$
Input: Object set  $\mathcal{S}$
Output: Composite Index  $G = (V,E)$
$V\gets \mathcal{S},E\gets \emptyset$
for all  $u_{i}\in V$  do
for all  $u_{j}\in V\setminus \{u_{i}\}$  do if  $\Gamma (u_i,u_j)\leq B'$  then  $\begin{array}{r}\big{\lfloor}E = E\cup \{u_iu_j\} \end{array}$
return  $G = (V,E)$
Theorem 1 Let  $\Omega_{min}$  and  $\Omega_{max}$  be the minimum and maximum distances between feature vectors on  $S$ . Suppose we have at least  $|N(e)|$  objects with the same attributes as  $e$  for any object  $e \in S$ . Then, (1) for any vertex  $u$  and its neighbor  $o$  in the composite index, we have  $\Omega_{min} \leq \Gamma(u, o) \leq \Omega_{max}$ ; (2) for any vertex  $u$  and its neighbor  $o$  in the ordinary PG, we have  $\Omega_{min} \leq \Gamma(u, o) \leq 2 \cdot \Omega_{max}$ .
Theorem 1 shows that our composite index has a smaller fusion distance bound.
Joint pruning. Given a query object  $q$ , we use a composite index  $G$  and a seed set  $P$  (usually chosen randomly from  $V$  [52]) to find the approximate top-  $k$  objects based on Algorithm 2. We follow these steps (see Fig. 2, top right): ① Initialization. We use a visited vertex set  $C$  to store the vertices for search expansion and a result set  $R$  of size  $k$  to store the current query results. We set both sets to  $P$  at first. ② Search expansion. We take out the vertex  $u_i$  with the smallest  $\Gamma(q, u_i)$  from  $C$  as the next visited vertex, and then add  $N(u_i)$  to  $C$ . ③ Query results update. We update  $R$  with the better vertices in  $N(u_i)$ . For any vertex  $u_j \in N(u_i)$  and a vertex  $u_r \in R$  that is the farthest from  $q$ , we replace  $u_r$  with  $u_j$  in  $R$  if  $\Gamma(q, u_j) < \Gamma(q, u_r)$ . This means  $u_j$  is more similar to  $q$  in both feature vectors and attributes than  $u_r$ . We repeat ② and ③ until  $R$  does not change, then we return  $R$  as the approximate top-  $k$  objects.
Algorithm 2: Joint Pruning  $(G,q,P)$
Input: Composite index  $G = (V,E)$  query object  $q$  , seed set  $P$
Output: Result set  $R$   
candidate set  $C \gets P$ ; result set  $R \gets P$   
while  $R$  is updated do
$u_{i}\gets \arg \min_{u_{i}\in C}\varGamma (q,u_{i})$
[ C = C \setminus \{u_i\} ]
$N(u_{i})\gets$  the neighbors of  $u_{i}$
$C = C\cup N(u_{i})$
for all  $u_{j}\in N(u_{i})$  do
$u_{r}\gets \arg \max_{u_{r}\in R}\varGamma (q,u_{r})$
if  $\Gamma (q,u_j) <   \Gamma (q,u_r)$  then
$R = R\setminus \{u_r\}$
$R = R\cup \{u_{j}\}$
return  $R$
Example 2 We show an example of joint pruning for finding the nearest object (i.e., top-1) to the query object  $q$  in Fig. 2 (top right). We start with a random vertex as the seed, i.e.,  $P = \{u_0\}$ ,
(a) Naïve edge selection
(b) RNG's edge selection
Figure 3: Different edge selection strategies for  $u_{i}$  (we assume  $u_{i}$  has at most four neighbors).
(c) Our edge selection
and set  $C = \{u_0\}$  and  $R = \{u_0\}$ . Then, we expand the search space with  $u_0$ 's neighbors and get  $C = \{u_1, u_2, u_3, u_4\}$ . We update  $R$  with  $u_4$  because  $\Gamma(q, u_4) = 0.5$  is smaller than  $\Gamma(q, u_0) = 1.0$ . We continue to expand the search space with  $u_4$ 's and  $u_5$ 's neighbors and get  $R = \{u_5\}$ . Since no vertex  $u_j \in N(u_5)$  has a smaller distance than  $\Gamma(q, u_5)$ , we return  $u_5$  as the approximate top-1 nearest object. We prune the vertices  $u_1, u_2,$  and  $u_3$  from the search space.
Theorem 2 Given a query object  $q$ , the composite index guarantees at least the same Recall@k of HQ as the ordinary PG. (see Appendix H for the proof)
Theorem 2 states that our composite index has a higher or equal  $Recall@k$  than the ordinary PG.
4 Navigable PG Algorithm
To form the composite index, we can deploy a specific PG in NHQ and change its original distance measure to the fusion distance (Eq. 6). This gives the PG the ability to handle HQ effectively. However, current PGs have limitations that affect NHQ's performance with the PG-based composite index. Therefore, we present two new navigable PGs (NPGs) in this section. We optimize the edge selection and routing strategies for building and searching on a PG, respectively.
4.1 Edge Selection
Edge selection is a crucial step for building a PG. It determines the neighbors of each object  $e$  in an object set  $S$ . Different strategies build different structures for a PG, which affect its search performance [19]. Existing PGs use two factors for edge selection: distance between two vertices (D1) and distribution of all vertices (D2) [52]. Early PGs like NSW [35] and KGraph [14] only use D1 and connect each vertex with some of its nearest neighbors (Fig. 3(a)). However, this can cause redundant computations and reduce search efficiency [34]. Recent PGs also use D2 with PNG's edge selection, which diversifies the neighbors' direction [33]. However, PNG's edge selection still fails to diversify the neighbors well (Fig. 3(b)). Due to the space limitation, we explain this in Appendix I.
Our edge selection. We design a new edge selection strategy that uses D1 and D2. It connects  $u_{i}$  with one nearest neighbor in each area of  $u_{i}$  (P1-P4 in Fig. 3(c)). We define the landing zone of  $u_{i}$  and one of its neighbors  $u_{j} \in N(u_{i})$ , which is the area where only the vertices in it can be added to  $N(u_{i})$ . We then describe our edge selection strategy based on the landing zone.
Definition 5 Landing zone. The landing zone  $L(u_{i}, u_{j})$  of a vertex  $u_{i}$  and one of its neighbors  $u_{j} \in N(u_{i})$  is an area defined by  $H(u_{i}, u_{j}) \setminus B(u_{i}, \delta(\nu(u_{i}), \nu(u_{j}))$ . Here,  $H(u_{i}, u_{j})$  is the half space with  $u_{i}$  that is split by the perpendicular bisector  $U(u_{i}, u_{j})$  of the line between  $u_{i}$  and  $u_{j}$ . And  $B(u_{i}, \delta(\nu(u_{i}), \nu(u_{j}))$  is the hypersphere centered at  $u_{i}$  with radius  $\delta(\nu(u_{i}), \nu(u_{j}))$ .