Database Repairing with Soft Functional Dependencies

Nofar Carmeli, Martin Grohe, Benny Kimelfeld, Ester Livshits, Muhammad Tibi

TL;DR

This paper tackles the challenge of "soft repairing" inconsistent databases, where violating a functional dependency (FD) incurs a financial or probabilistic penalty rather than being strictly forbidden. The authors show that soft repairing is fundamentally harder than traditional hard repairing, but they deliver a universal 3-approximation algorithm alongside exact polynomial-time algorithms for two crucial scenarios: a single functional dependency and matching constraints.

What Problem Does This Paper Address?

Real-world databases are notoriously messy. They frequently violate standard integrity constraints—like Functional Dependencies (FDs)—due to typos, sensor noise, or the inherently uncertain nature of probabilistic data integration.

Traditionally, database repairing treats these constraints as absolute rules ("hard constraints"). The goal is to find a "cardinality repair"—deleting the fewest possible rows to make the database perfectly consistent. However, modern frameworks like Markov Logic Networks and probabilistic databases treat constraints as "soft." In this view, a violation isn't illegal; it just incurs a penalty (a weight).

The computational challenge, known as soft repairing, is to find a subset of the database that minimizes the total cost: the penalty for data you delete plus the penalty for any constraint violations you leave behind. While the complexity of hard repairing is fully mapped out, very little was known about soft repairing. It is a much tougher nut to crack because algorithms must constantly trade off deleting data against tolerating errors.

Methods

The authors map out the complexity landscape and provide three major algorithmic contributions:

  1. A Universal 3-Approximation Algorithm: The authors prove that for any arbitrary set of FDs, an optimal soft repair can be approximated within a factor of 3 in polynomial time. They achieve this by reducing the soft repair problem to a minimum weighted 3-set cover problem, which can be solved efficiently using a classic greedy approach.
  2. Dynamic Programming for a Single FD: For cases involving only a single FD (e.g., $X \rightarrow Y$), the authors design an exact polynomial-time algorithm. It segments the database into blocks (tuples sharing $X$ values) and subblocks (tuples sharing both $X$ and $Y$ values), using dynamic programming to find the perfect balance of tuple retention and violation penalties. They extend this approach to more complex FD sets using a novel elimination procedure called L/C-Simplify().
  3. Network Flow for Matching Constraints: For matching constraints—pairs of FDs that cover all attributes of a schema (e.g., $\{A \rightarrow B, B \rightarrow A\}$)—the authors reduce the problem to the Minimum Cost Maximum Flow (MCMF) problem, allowing it to be solved exactly in polynomial time.

Datasets

Not discussed in the paper. This is a purely theoretical paper focusing on computational complexity proofs and algorithmic design; no empirical evaluations or experimental datasets were used.

Key Insights and Ideas

  • Softness Breeds Hardness: A counterintuitive finding is that soft repairing is fundamentally more difficult than hard repairing. A set of FDs that is easy to solve under hard constraints can become NP-hard under soft constraints. This happens because soft constraints allow you to "ignore" certain rules by assigning them a very low weight, effectively embedding complex, intractable constraint structures within seemingly simple schemas.
  • The Deletion vs. Violation Tradeoff: Unlike traditional repairs where a violation must be resolved by deleting data, soft repairing allows the database to strategically keep conflicting tuples if the penalty for the violation is cheaper than the cost of losing the data.

To illustrate this tradeoff, the authors present an example of a flight database where a soft repair allows keeping conflicting destinations because the penalty for the violation is low:

Flight database example showing hard vs soft repairs
  • Graph Monogamy: The matching constraint problem elegantly translates into finding an optimal "almost matching" in a bipartite graph, where penalties are paid both for losing edges (deleting tuples) and for violating monogamy (violating the FDs).

Key Results

  • Universal Bound: Established a polynomial-time 3-approximation algorithm that guarantees a reasonably optimal soft repair is always efficiently reachable, regardless of the FD configuration.
  • Tractability Frontiers: Proved exact polynomial-time tractability for a single arbitrary FD and for matching constraints.
  • Hardness Classification: Demonstrated that if a set of FDs cannot be simplified via the standard Simplify() routine, the soft repairing problem is APX-complete (meaning it cannot be approximated better than a certain constant factor unless P = NP).

Limitations and Future Work

  • The Dichotomy Gap: The authors have not yet achieved a full dichotomy theorem—a complete classification of exactly which FD sets are tractable versus intractable under soft semantics. Simple cases like $\{A \rightarrow B, A \rightarrow C\}$ on a three-attribute schema $R(A,B,C)$ remain open.
  • Beyond Functional Dependencies: The current exact algorithms are strictly restricted to FDs. Extending these techniques to more expressive constraint languages, such as Equality-Generating Dependencies (EGDs) or denial constraints, remains an open challenge.
  • Update Repairs: The paper only considers tuple deletion as a repair mechanism. A promising future direction is exploring "update repairs," where cell values are modified rather than entire rows being wiped out.

Summary updated

BibTeX
@inproceedings{carmeli2021database,
  author = {Nofar Carmeli and Martin Grohe and Benny Kimelfeld and Ester Livshits and Muhammad Tibi},
  title = {{Database Repairing with Soft Functional Dependencies}},
  booktitle = {ICDT},
  year = {2021},
  doi = {10.4230/lipics.icdt.2021.16},
}
Figure