Lifted Algorithms for Symmetric Weighted First-Order Model Sampling

Yuanhong Wang, Juhua Pu, Yuyi Wang, Ondřej Kuželka
8/17/2023
cs.AIcs.LO

No official code found. Best implementation: lucienwang1009/lifted_sampling_fo2 (1 star, MIT, last commit 2026-04-20).

Abstract

Weighted model counting (WMC) is the task of computing the weighted sum of all satisfying assignments (i.e., models) of a propositional formula. Similarly, weighted model sampling (WMS) aims to randomly generate models with probability proportional to their respective weights. Both WMC and WMS are hard to solve exactly, falling under the $\#\mathsf{P}$-hard complexity class. However, it is known that the counting problem may sometimes be tractable, if the propositional formula can be compactly represented and expressed in first-order logic. In such cases, model counting problems can be solved in time polynomial in the domain size, and are known as domain-liftable. The following question then arises: Is it also the case for weighted model sampling? This paper addresses this question and answers it affirmatively. Specifically, we prove the domain-liftability under sampling for the two-variables fragment of first-order logic with counting quantifiers in this paper, by devising an efficient sampling algorithm for this fragment that runs in time polynomial in the domain size. We then further show that this result continues to hold even in the presence of cardinality constraints. To empirically verify our approach, we conduct experiments over various first-order formulas designed for the uniform generation of combinatorial structures and sampling in statistical-relational models. The results demonstrate that our algorithm outperforms a start-of-the-art WMS sampler by a substantial margin, confirming the theoretical results.

View on arXivView PDF

Code Implementations(1)

MIT
14PythonFeb 3, 20236 months agoMIT

Similar Papers

Cite this paper

@article{wang2023lifted,
  title  = {Lifted Algorithms for Symmetric Weighted First-Order Model Sampling},
  author = {Yuanhong Wang and Juhua Pu and Yuyi Wang and Ondřej Kuželka},
  year   = {2023},
  eprint = {2308.08828},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2308.08828v3}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2308.08828.svg)](https://codeofpaper.com/paper/2308.08828)

Discussion