# Enhanced Distributed Dynamic Skyline Query for Wireless Sensor Networks
## 3 Basic System Design
### Data Processing and Mapping
#### 3.3.1. Pivot Point Generation  
\[\alpha_{\text{min}}=\sum_{i=1}^{l}\left(\left(A_{i(\text{min})}/A_{i(\text{max })}\right)\times w_{i}\right) \tag{7.1}\]  
\[\alpha_{\text{max}}=\sum_{i=1}^{l}\left(\left(A_{i(\text{max})}/A_{i(\text{max })}\right)\times w_{i}\right) \tag{7.2}\]  
\[\beta=\sum_{i=1}^{l}\left(\left(A_{i(avg)}/A_{i(\text{max})}\right)\times w_{i}\right) \tag{7.3}\]  
\[\delta=\sum_{i=1}^{l}\left(\left(A_{i(\theta)}/A_{i(\text{max})}\right)\times w _{i}\right) \tag{7.4}\]  
In Equations (7.1)-(7.4), \(\text{A}_{i(\text{min})}\), \(\text{A}_{i(\text{max})}\), \(\text{A}_{i(\text{avg})}\) and \(\text{A}_{i(\theta)}\) denote the minimum, maximum, average and threshold value of \(ith\) attribute. Based on Equations (7.1) and (7.2), the domain of the hash key, denoted by \(H_{D}\), is \(\alpha\) (\(\alpha_{\text{min}}\), \(\alpha_{\text{max}}\)). The center of gravity, denoted by \(\beta\), is derived in Equation (7.3) to find the normalized center point of the domain of the hash key \(H_{D}\), whereas \(\delta\) is the separating factor between two pivot points. However, in order to balance the load among sectors, it is important to find the range where the concentration of the data points is high. Hence, \(\beta\) and \(\delta\) can be used to find the range for center of gravity, denoted by \(\beta\) (\(\beta_{range-min}\), \(\beta_{range-max}\)), as shown in Equation (8).  
\[\begin{array}{l}\beta_{range-\text{min}}=\beta-\delta\\ \beta_{range-\text{max}}=\beta+\delta\end{array} \tag{8}\]  
Thus, the separating step, denoted by \(\eta\), between two pivot points in COM range can be defined by:  
\[\eta=\big{(}\beta_{range-\text{max}}-\beta_{range-\text{min}}\big{)}/S-1 \tag{9}\]  
Thus, the pivot points for \(S\) sectors can be defined in each sector head by:  
\[\text{P}_{i}=\left\{\begin{array}{ll}\alpha_{\text{min}},&i=0\\ \beta_{range-\text{min}}+i\times\eta,&0<i<S\\ \alpha_{\text{max}},&i=S\end{array}\right. \tag{10}\]  
\begin{table}
\begin{tabular}{c c} \hline
**Attribute** & **Weight** \\ \hline \(A_{1}\) & \(w_{1}\) \\ \(A_{2}\) & \(w_{2}\) \\.... &.... \\ \(A_{l}\) & \(w_{l}\) \\ \hline \end{tabular}
\end{table}
Table 1: Weight settings.  
```
0:\(attrRangeTable\) (containing minimum, maximum, average and theta of each attribute), \(W\) (weights to different attributes based on their importance in the event description).
0:P (derived pivot point for each sector)
1:\(mapRec.minRange=mapRec.maxRange=0\)
2:\(m=\)lengthof (\(attrRangeTable\))
3:for\(i=1\) to \(m\)do
4:\(mapRec.minRange\)+=(\(attrRangeTable[i].min/attrRangeTable[i].max)\times W[i]\)
5:\(mapRec.maxRange\)+=(\(attrRangeTable[i].max)/attrRangeTable[i].max)\times W[i]\)
6:\(mapRec.com\) +=(\(attrRangeTable[i].avg)/attrRangeTable[i].max)\times W[i]\)
7:\(mapRec.theta\) +=(\(attrRangeTable.theta\)/attrRangeTable[i].max)\times W[i]\)
8:\(i=i+1\)
9:endfor
10:\(comLowerLimit=mapRec.com\) - \(mapRec.theta\)
11:\(comUpperLimit=mapRec.com\) + \(mapRec.theta\)
12:\(\eta=(comUpperLimit\) - \(comLowerLimit)/(\mathbf{S}\) - 1)
13:for\(j=0\) to \(\mathbf{S}\)
14:if (\(j==0\)) then \(P[j]=mapRec.minRange\)
15:else if (\(j==S\)) then \(P[j]=mapRec.maxRange\)
16:else \(P[j]=comLowerLimit+j\times\eta\)
17:endif
18:\(j=j+1\)
19:endfor
```  
**Algorithm 1**Pivot Point Generation Algorithm (implemented at each \(SH\) node).  
Algorithm 1 uses Equations (8)-(10) for calculating pivot points. Figure 5 illustrates the domain and sub-domain of pivot points.