A relation (or table) \(R\) is a set of tuples over a relation schema \(\mathbf{S}=(A_1,\dots,A_m)\), where \(A_1,\dots,A_m\) are the attributes of \(R\). A tuple \(t\) in \(R\) maps each \(A_i\), \(1\le i\le m\), to a value that we denote by \(t[A_i]\). This is referred to as a cell in \(R\). We use \(|R|\) to denote the number of tuples in \(R\).
A functional dependency (FD) is denoted as \(X\to Y\), where \(X\) and \(Y\) are disjoint sets of attributes. \(X\) is termed the left-hand side (LHS), and \(Y\) is the right-hand side (RHS) of the FD. A relation \(R\) satisfies \(X\to Y\) if every pair of tuples that agree on \(X\) also agree on \(Y\). Formally, for every pair \(t_i,t_j\) in \(R\), if \(t_i[X]=t_j[X]\), then \(t_i[Y]=t_j[Y]\).
Formally, given \(R\) and \(\Delta\), an S-repair is a subset of tuples \(R'\subseteq R\) such that \(R'\models\Delta\). \(R'\) is called an optimal subset repair (or optimal S-repair) if for all S-repairs \(R''\) of \(R\) given \(\Delta\), \(|R'|\ge|R''|\).
(脚注 3)We note that in prior work [38, 42], an S-repair has been defined as a “maximal” subset \(R'\subseteq R\) such that \(R'\models\Delta\). We consider even non-maximal subsets as valid S-repairs since in our problem, additional tuples from S-repairs may have to be removed to satisfy both FDs and representations.
Without loss of generality, we denote the last attribute \(A_s\) of \(\mathbf S\) as the sensitive attribute. We denote the domain of \(A_s\) in \(R\) as \(\mathrm{Dom}(A_s)=\{a_1,\dots,a_k\}\), therefore \(k=|\mathrm{Dom}(A_s)|\) representing the size. A special case is when \(A_s\) is binary, i.e., the sensitive attribute has two values: (1) a minority or protected group of interest … and (2) the non-minority group or others.
Definition 1 (Representation Constraint). Let \(\mathbf S\) be a schema and \(A_s\) a sensitive attribute. A lower-bound constraint is an expression of the form \(\%a\ge p\) where \(a\) is a value and \(p\) is a number in \([0,1]\). A Representation Constraint (RC) \(\rho\) is a finite set of lower-bound constraints. A relation \(R\) satisfies \(\%a\ge p\) if at least \(p\cdot|R|\) of the tuples \(t\in R\) satisfy \(t[A_s]=a\). A relation \(R\) satisfies an RC \(\rho\), denoted \(R\models\rho\), if \(R\) satisfies every lower-bound constraint in \(\rho\). … The RC \(\rho\) is called an exact RC if \(\sum_{i=1}^{k}p_i=1\) because the only way to satisfy the individual constraints \(\%a_i\ge p_i\) is to match \(p_i\) exactly.
Definition 2 (RS-repair). Given a relation \(R\) with the sensitive attribute \(A_s\), a set \(\Delta\) of FDs, and an RC \(\rho\), a subset \(R'\subseteq R\) is called an RS-repair (representative subset repair) w.r.t. \(\Delta\) and \(\rho\) if: (i) \(R'\) is an S-repair of \(R\), i.e., \(R'\models\Delta\); (ii) \(R'\) satisfies the RC \(\rho\) on \(A_s\), i.e., \(R'\models\rho\). We call \(R'\) an optimal RS-repair of \(R\) w.r.t. \(\Delta\) and \(\rho\) if for all RS-repairs \(R''\) of \(R\), we have \(|R''|\le|R'|\).
deletion overhead \(=\dfrac{\#\mathrm{del}(\text{an optimal RS-repair of }R\text{ w.r.t. }\Delta\text{ and }\rho)}{\#\mathrm{del}(\text{an optimal S-repair of }R\text{ w.r.t. }\Delta)}\) (式 2)… This ratio quantifies the additional deletions required by an optimal RS-repair compared to an optimal S-repair for the same \((R,\Delta)\).
repair quality \(=\dfrac{|R|-\#\mathrm{del}(R')}{|R|-\#\mathrm{del}(\text{an optimal RS-repair of }R\text{ w.r.t. }\Delta\text{ and }\rho)}\) (式 3)… a ratio close to 100% indicates high quality.
As shown by Livshits et al. [38], computing an optimal S-repair is poly-time solvable if \(\Delta\) can be reduced to \(\emptyset\) by repeated applications of three simplification processes: (i) consensus FDs (remove FDs of the form \(\emptyset\to Y\)), (ii) common LHS (remove attribute \(A\) from \(\Delta\), such that \(A\) belongs to the LHS of all FDs in \(\Delta\)), and (iii) LHS marriage, which is slightly more complex.
Definition 3. An FD set \(\Delta\) is an LHS-chain if for every two FDs \(X_1\to Y_1\) and \(X_2\to Y_2\), either \(X_1\subseteq X_2\) or \(X_2\subseteq X_1\) holds.
Proposition 4. A set \(\Delta\) of FDs reduces to the \(\emptyset\) by repeated applications of consensus FD and common LHS simplifications if and only if \(\Delta\) is an LHS-chain.
Theorem 1. The problem of finding an optimal RS-repair is NP-hard already for \(\mathbf S=(A,B,C)\) and \(\Delta=\{A\to B\}\). … It is important to note that if \(\Delta\) contains a single FD, computing an optimal S-repair can be done in polynomial time [38]. The key distinction is on (the size of) the active domain of the sensitive attribute.
Theorem 2. Let \(\mathbf S\) be a fixed schema and \(\Delta\) be a fixed FD set that forms an LHS chain. Suppose that the domain size of the sensitive attribute \(A_s\) is fixed. Then, an optimal RS-repair can be computed in polynomial time.
Lemma 7. LhsChain-DP terminates in \(O(m\cdot|\Delta|\cdot k\cdot|R|^{3k+2})\) time, where \(m\) is the number of attributes in \(R\), \(|\Delta|\) is the number of FDs, and \(k=|\mathrm{Dom}(A_s)|\) is the domain size of the sensitive attribute \(A_s\).
We present the PostClean algorithm, which takes a relation \(R\) and an RC \(\rho\), and returns a maximum subset \(R'\) of \(R\) such that \(R'\models\rho\). … PostClean iterates over all possible sizes \(T\) of \(R'\) from \(|R|\) to \(1\). For each \(T\), it checks if the lower bound on the number of tuples with \(a_\ell\), i.e., \(\tau_\ell=\lceil T\cdot\rho(a_\ell)\rceil\), is greater than the number of tuples with value \(a_\ell\) in the original relation \(R\). If yes, then no repair \(R'\) of size \(T\) can satisfy \(\rho\), and it goes to the next value of \(T\). Otherwise, if there are sufficient tuples for all sensitive values \(a_\ell\), and if the sum of the lower bounds on numbers, formally \(T_0=\sum_\ell\tau_\ell\) is \(\le T\), then we have a feasible \(T\). … Note that if all values of \(T\) between \(|R|\) and \(1\) are invalid, then an \(\emptyset\) is returned because it is the only subset of \(R\) that (trivially) satisfies the \(\rho\).
Proposition 5. Given \(R\) and \(\rho\), PostClean\((R,\rho)\) returns in polynomial time a maximum subset \(R'\) of \(R\) such that \(R'\models\rho\).
Consider a relation \(R\) with \(\mathbf S=(A,B,\mathrm{sex})\), a set \(\Delta\) of FDs \(\{A\to B\}\), and an exact RC \(\rho=\{\%\mathrm{male}=\tfrac12,\%\mathrm{female}=\tfrac12\}\). Let \(R=\{(1,a,\mathrm{male}),(1,b,\mathrm{female}),(2,c,\mathrm{male}),(2,d,\mathrm{female})\}\). An optimal S-repair of \(R\) w.r.t. \(\Delta\) is \(R'=\{(1,a,\mathrm{male}),(2,c,\mathrm{male})\}\). However, PostClean\((R',\rho)\) returns \(\emptyset\) since \(R'\) does not have any female tuples. Conversely, \(\{(1,a,\mathrm{male}),(2,d,\mathrm{female})\}\) is an optimal RS-repair, which satisfies both \(\Delta\) and \(\rho\).
However, even when the domain size of the sensitive attribute \(A_s\) is fixed, the size of \(\mathcal{A}_{R,\Delta}\) can be exponential in \(|R|\). Therefore, it is expensive to enumerate the set of all S-repairs. Hence, we find a candidate set \(C_{R,\Delta}\subseteq\mathcal{A}_{R,\Delta}\) of S-repairs that is sufficient to inspect.
\(R_1\) is representatively equivalent to \(R_2\), denoted \(R_1=_{\mathrm{Repr}}R_2\), if for all \(a_\ell\in\mathrm{Dom}(A_s)\), \(|\sigma_{A_s=a_\ell}R_1|=|\sigma_{A_s=a_\ell}R_2|\), i.e. the same number of tuples for each sensitive value. \(R_1\) representatively dominates \(R_2\), denoted \(R_1\succ_{\mathrm{Repr}}R_2\), if for all \(a_\ell\in\mathrm{Dom}(A_s)\), \(|\sigma_{A_s=a_\ell}R_1|\ge|\sigma_{A_s=a_\ell}R_2|\), and there exists \(a_c\in\mathrm{Dom}(A_s)\), \(|\sigma_{A_s=a_c}R_1|>|\sigma_{A_s=a_c}R_2|\).
中文对照 · ZH
\(R_1\) 与 \(R_2\) 表示等价(\(R_1=_{\mathrm{Repr}}R_2\)):对每个 \(a_\ell\in\mathrm{Dom}(A_s)\),两者在该值上的元组数相同(计数向量完全一致)。\(R_1\) 表示支配 \(R_2\)(\(R_1\succ_{\mathrm{Repr}}R_2\)):对每个 \(a_\ell\) 都有 \(\ge\),且存在某个 \(a_c\) 严格 \(>\)。(例:两个 S-repair 都是 1 white + 1 black \(\Rightarrow\) 等价;第三个多 1 个 asian \(\Rightarrow\) 支配前两个。)
Definition 5 (candidate set). Given a relation \(R\) and any FD set \(\Delta\), a candidate set denoted by \(C_{R,\Delta}\) is a subset of \(\mathcal{A}_{R,\Delta}\) such that (1) For all \(R_1,R_2\in C_{R,\Delta}\), \(R_1\neq_{\mathrm{Repr}}R_2\), \(R_1\not\succ R_2\) and \(R_2\not\succ R_1\); (2) For any \(R''\in\mathcal{A}_{R,\Delta}\setminus C_{R,\Delta}\), there exists \(R'\in C_{R,\Delta}\) such that \(R'=_{\mathrm{Repr}}R''\) or \(R'\succ_{\mathrm{Repr}}R''\). Each S-repair \(R'\in C_{R,\Delta}\) is called a candidate. … Moreover, the size of the candidate set is \(O(|R|^k)\), when the domain size \(|\mathrm{Dom}(A_s)|=k\) is fixed (proofs in [35]).
Lemma 9. For any relation \(R\) and any FD set \(\Delta\), if \(C_{R,\Delta}\) is computed correctly in Line 1, LhsChain-DP returns an optimal RS-repair of \(R\) w.r.t. \(\Delta\) and \(\rho\).
(ConsensusReduction)Note that any S-repair \(R'\in C_{R_{y_\ell},\Delta-f}\) is also an S-repair of \(R\) for \(\Delta\), i.e., \(R'\in\mathcal{A}_{R,\Delta}\), since the FD \(f\) is already taken care of in \(R_{y_\ell}\).
(CommonLHSReduction)Yet, this is not the case for computing RS-repairs, since maximum size is not the only requirement—while we know the final repair will satisfy \(\rho\), we do not know what the value distribution of \(A_s\) should be in each disjoint piece (e.g., some \(R_{x_\ell}\)) of the final repair before we get one. Therefore, in each step of the recursion … the candidate set preserves all possible distributions of \(A_s\) from the S-repairs that could provide the final optimal solution.
Intuitively, it safely processes an insertion to a set of candidates and maintains the properties in Definition 5. Specifically, it takes a set of candidates \(C\), where no representative equivalence or representative dominance exists, and an S-repair \(R_0\in\mathcal{A}_{R,\Delta}\) as inputs. ReprInsert compares \(R_0\) with every \(R'\in C\). If there is an \(R'\) such that \(R'\succ_{\mathrm{Repr}}R_0\) or \(R'=_{\mathrm{Repr}}R_0\), it returns the existing \(C\). Otherwise it removes all \(R'\) from \(C\) where \(R_0=_{\mathrm{Repr}}R'\) and returns \(C\cup\{R_0\}\).
We use \(|R|\) binary variables \(x_1,x_2,\dots,x_{|R|}\), where \(x_i\in\{0,1\}\) denotes whether tuple \(t_i\in R\) is retained (if \(x_i=1\)) or deleted (if \(x_i=0\)) in the RS-repair. From the result of the following ILP we take the tuples with \(x_i=1\). We refer to this algorithm as GlobalILP. … The objective maximizes the number of tuples retained. The first constraint ensures that the solution does not violate \(\Delta\). The following set of constraints correspond to the RC \(\rho\), by ensuring each lower-bound constraint is satisfied, i.e. \(\%a_\ell\ge p_\ell\), where \(p_\ell=\rho(a_\ell)\), is satisfied for every \(a_\ell\in\mathrm{Dom}(A_s)\).
While GlobalILP provides an exact optimal solution, its scalability is limited by the size of the ILP. … Each pair of tuples \((t_i,t_j)\) that conflict on some FD introduces a constraint \(x_i+x_j\le 1\) to the ILP, therefore it can have \(O(|R|^2)\) constraints, leading to a large program that does not scale.
The ILP in Equation (1) can be relaxed to an LP by replacing the integrality constraints \(x_i\in\{0,1\}\) with \(x_i\in[0,1]\), for every \(i\in[1,|R|]\). We propose rounding procedures to derive an integral solution from fractional \(x_i\)s and refer to the heuristic as LP + ReprRounding.
FDCleanser therefore calls LhsChain-DP with one FD at a time from \(\Delta\) until all FDs are taken care of. Further, it prioritizes the FD which has a most frequent LHS column \(X\) (among all the columns) in its LHS. This greedy approach may not be optimal as demonstrated empirically in Section 6.
The experiments show the following. First, the deletion overhead is high when the noise distribution is imbalanced in the input (more noise in one subgroup), especially when the under-represented group defined by the sensitive attribute has relatively more noise than the majority group. Second, the DP-based algorithms proposed in this paper, FDCleanser for general FD sets, and LhsChain-DP to which the former reduces to for chain FD sets, present the best trade-off of high RS-repair quality and runtime compared to the other alternatives that we have examined. Third, as the constraint on exact RC is relaxed, fewer deletions are needed.