{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/banzhaf-values-for-facts-in-query-answering","title":"Banzhaf Values for Facts in Query Answering","arxiv_id":"2308.05588","date":"2023-08-10","proceeding":null,"authors":["Omer Abramovich","Daniel Deutch","Nave Frost","Ahmet Kara","Dan Olteanu"],"abstract":"Quantifying the contribution of database facts to query answers has been studied as means of explanation. The Banzhaf value, originally developed in Game Theory, is a natural measure of fact contribution, yet its efficient computation for select-project-join-union queries is challenging. In this paper, we introduce three algorithms to compute the Banzhaf value of database facts: an exact algorithm, an anytime deterministic approximation algorithm with relative error guarantees, and an algorithm for ranking and top-$k$. They have three key building blocks: compilation of query lineage into an equivalent function that allows efficient Banzhaf value computation; dynamic programming computation of the Banzhaf values of variables in a Boolean function using the Banzhaf values for constituent functions; and a mechanism to compute efficiently lower and upper bounds on Banzhaf values for any positive DNF function. We complement the algorithms with a dichotomy for the Banzhaf-based ranking problem: given two facts, deciding whether the Banzhaf value of one is greater than of the other is tractable for hierarchical queries and intractable for non-hierarchical queries. We show experimentally that our algorithms significantly outperform exact and approximate algorithms from prior work, most times up to two orders of magnitude. Our algorithms can also cover challenging problem instances that are beyond reach for prior work.","url_abs":"https://arxiv.org/abs/2308.05588v1","url_pdf":"https://arxiv.org/pdf/2308.05588v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"links_only","authors_date_abstract":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license), from the Kaggle arXiv metadata snapshot of 2026-09-12"},"code_links":[{"paper_slug":"banzhaf-values-for-facts-in-query-answering","repo_url":"https://github.com/omer-abramovich/adaban","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok"}}],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"syntology_url":"https://syntology.ai/paper/2308.05588","atlas_url":"https://app.syntology.ai/?focus=2308.05588","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2308.05588"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-25T09:33:49+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/omer-abramovich/adaban","reach":{"status":"ok"}}],"summary":{"ran":4},"by_repo_kind":{"official":{"samples":4,"ran":4,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":4,"samples":[{"code_sha256_prefix":"12f2f0e2335e2cfa","entry":"add_lists","repo":"omer-abramovich/adaban","repo_kind":"official","path":"src/Helper_functions.py","file_url":"https://github.com/omer-abramovich/adaban/blob/HEAD/src/Helper_functions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"12f2f0e2335e2cfa"}},{"code_sha256_prefix":"dd577d42a4ebc364","entry":"powerset","repo":"omer-abramovich/adaban","repo_kind":"official","path":"src/Helper_functions.py","file_url":"https://github.com/omer-abramovich/adaban/blob/HEAD/src/Helper_functions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"dd577d42a4ebc364"}},{"code_sha256_prefix":"cfd03320a8a96801","entry":"random_subset","repo":"omer-abramovich/adaban","repo_kind":"official","path":"src/Approximation_Algorithms.py","file_url":"https://github.com/omer-abramovich/adaban/blob/HEAD/src/Approximation_Algorithms.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cfd03320a8a96801"}},{"code_sha256_prefix":"cfe97151aa54fc6f","entry":"sub_lists","repo":"omer-abramovich/adaban","repo_kind":"official","path":"src/Helper_functions.py","file_url":"https://github.com/omer-abramovich/adaban/blob/HEAD/src/Helper_functions.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"NONE","inline_ok":false,"mcp_get_code":{"code_sha256":"cfe97151aa54fc6f"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}