Atelier des rouesLab FR
Applications/Sampling

Sampling weighted configurations

2/4 Reusable result, originality uncertain AI-assisted literature assessment · one reading

I treat the exact mapping from each configuration to ∏w tickets, its CNF encoding that preserves option identity, and the independent histogram checks as the strongest fragment. Dudek, Shrotri, and Vardi already give exact weighted sampling by dynamic programming; ADDMC and weighted BDD work cover the counting and compilation foundations. My contribution here is mainly a reproducible regression artifact for degenerate cases and costs. It could check future readers, but the evidence is seven small instances, with no comparison against DPSampler.

DPSampler: Exact Weighted Sampling Using Dynamic Programming — Jeffrey M. Dudek, Aditya A. Shrotri, and Moshe Y. Vardi · ADDMC: Weighted Model Counting with Algebraic Decision Diagrams — Jeffrey M. Dudek, Vu H. N. Phan, and Moshe Y. Vardi · Weighted Positive Binary Decision Diagrams for Exact Probabilistic Inference — Giso H. Dal and Peter J. F. Lucas

How I rate results

I bound the number of subproblems kept across eight new addresses. How many must I evaluate?

I evict the least recently used entry. I check all eight groups with a rank decoder independent of this eviction policy. I count polynomial evaluations at three capacities. At vertex 16 I go from 18,614 evaluations with 16 entries to 8,272 with 256. I count entries whose byte size can vary.

I will measure bytes and actual stored polynomial lengths. AT.EX21.06 · Try the experiment

Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials

Addressing eight groups on one graph

I look up independent groups of eight vertices containing a required vertex. How many counts can I reuse?

I retain subproblem counts across eight queries. I check each group against its rank in an independent enumeration of the Zachary graph. At vertex 16, subproblem evaluations fall from 6,661 to 1,032. I give the peak entry count and raw timings to distinguish computational savings and memory cost.

I will test a bounded cache on held-out ranks. AT.EX20.06 · Change the inputs.

Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials

Sampling weighted covering configurations

Require a vertex

At size eight, 2,053 of 1,228,103 groups contain vertex 0, while 294,141 contain vertex 16. I recover 13,393,054 groups across all sizes and check small sizes by direct enumeration. I independently check every coefficient using two 17-vertex halves and all 34 size-eight conditional counts by exchanging the halves. Reference values Interactive experiment · AT.EX18.06

The XI pilot counted 77,439,304,845,962,559,807,420,989,440 covering configurations on 48 four-option modules using 107,965 memoised states. I now give each option a nonnegative integer weight and require all obligations to be covered.

Exact oracle

For missing mask M, C(i,M)=Σⱼ wᵢⱼ C(i+1,M minus the obligations of option j). At the terminal module the count is one exactly when M is empty. The interval for an option has width w times its suffix mass. Inside that interval I take the integer quotient of the ticket by w. Induction gives each configuration exactly ∏w tickets, including zero for configurations with a zero-weight option. Distinct options sharing a mask retain their identities. Weighted conditional counting has established precedents. Darwiche and Marquis · Dudek, Shrotri and Vardi, DPSampler

A tested pruning rule

If a missing obligation is absent from all remaining positive-weight options, the count is zero. Exhausting 30 tickets reproduces all six configuration masses in the small oracle. In a family with one deadline per obligation, pruning at 16 obligations reduces memoised states from 131,071 to 33, preserving mass 43,046,721. When the same obligation remains available throughout, both versions visit 33 states.

I contribute an exact comparison exhibiting both regimes. I use the same option identities and weights in the compiled comparison below.

Reproduce

After extracting the kit I run python experience.py with Python 3.10 or newer and compare its output with resultats.json.

Does compilation preserve the sampling masses?

Each module in instances.json is an ordered list of [mask, weight] options. An option’s index is part of its identity. I introduce one Boolean variable per option, one clause requiring at least one choice per module, and a pairwise exclusion clause for every pair within a module. For each obligation a final clause requires some selected option covering it. A true literal carries the option’s weight and a false literal carries weight 1. Every covering configuration thus corresponds to exactly one satisfying assignment with the same weight, including zero. The file exemple.cnf contains the clauses and weights of the first example.

I compiled the clauses into ordered binary decision diagrams with dd.autoref 0.5.7, ordering variables by module then option. My reader weights both branches and handles skipped variables and complemented edges. On seven instances I compared every multiplicity from two ticket readers with direct enumeration of the options. I also check feasibility for all 1,729 labelled words, including those of weight zero. All 2,572 tickets from each reader give exactly the same histograms. A duplicated mask retains two option identities. An instance in which every solution has weight zero has no tickets. The empty product with no obligations has one solution of weight one. Binary decision diagrams · Exact checks

On the six-module cyclic instance I obtain 152 positive-weight solutions and 1,557 tickets. The specialised recurrence prepares masses in 62 µs and reads 256 tickets in 979 µs. Translating to clauses, compiling, exporting in memory and preparing the weighted reader takes 4,145 µs, followed by 3,171 µs for the reads. Peak traced Python allocations across setup and reads are 19,396 and 346,027 bytes respectively. I report five trials with garbage collection before each trial under Python 3.10.11 (Windows, Ryzen Threadripper PRO 3975WX). I measured the Python backend of dd in one variable order. Reordering variables or using DPSampler would be separate experiments. DPSampler · Measurements

After extraction, python comparaison.py replays every ticket from the supplied diagrams using the standard library. To regenerate the diagrams in a copy I use Python 3.10, install python -m pip install dd==0.5.7 and run python compiler_bdd.py --measure. I retain the degenerate cases so that a future solver can be compared on the same labelled solutions. Register

Control from XII

I replay the XII multivalued diagram on strictly positive option weights. I preserve option and copy indices and reproduce all 30 tickets. I run python temoin_xii.py and compare with controle-xii.json.

My XIII control

I run python ordre.py. All 120 orders preserve the 22 accepted microstates. Width ranges from 2 to 4 and the greedy order reaches 2.

Width alone does not predict compilation work

I use the unweighted Zachary graph with 34 vertices and 78 edges. An edge is covered when at least one endpoint is excluded. I recover 13,393,054 independent sets by splitting vertices in half. In the supplied compilation the width-57 order visits 1,982 states versus 151,045 at width 33 in natural order. I use an observed graph for a combinatorial task.

I run python temoin_xiv.py to replay my local check and keep its output in controle-xiv.json. Width alone does not predict compilation work · NetworkX, Zachary’s karate club graph

When several proofs cover the same phase

I fix three two-offset paths on wheels 3, 5 and 7. Each covers 15 phases and their union covers 29. Among 105 phases, eight have two witnesses and four have three. Inclusion–exclusion agrees with exhaustive enumeration.

I then assigned each phase to its first valid path. The three disjoint bins contain 15, 7 and 7 elements and sum to exactly 29. Computing this partition without enumerating phases remains the algorithmic target.

My next test is to rank each phase by its first witness without repeating intersections. AT.R2 · Alrabbaa et al., Finding Small Proofs

I run python preimages.py.

Assigning each phase to its first surviving path

I group phases by their mask of surviving paths. Enumeration confirms 15, 7 and 7 phases assigned to the three first witnesses, with 76 uncovered. Four identical paths leave two final states. Six distinct paths leave 32 in the published case. On Zachary’s public graph under my imposed modular failures, two pairs stay connected in 150/150 and 135/135 admissible phases. Pair (4,31) stays connected in 64/135.

I plan to permute wheel and path orders, measure peak states and verify coverage invariance. AT.R4 · Zachary, An Information Flow Model for Conflict and Fission in Small Groups

I run python partition10.py.

One graph under four labellings

For Zachary’s named pair (4,31) I obtain 64/135 connected phases with the original labels, then 64/135, 64/135 and 120/135 with seeds 11,12,13. Two readers agree. Reversing wheel order in the small mask counter preserves its final law with different intermediate sizes.

Compare a documented failure law against the artificial labels. AT.R6 · Feige, Lovász & Tetali, Approximating Min Sum Set Cover

Address a group under a vertex constraint

I fix the vertex, exclude its neighbours, and split independent sets by presence of the smallest available vertex. An independence-polynomial coefficient gives the size of the first block. I skip that block or descend into it. Ranks start at zero. I recover 12,913 conditional ranks in order at sizes up to three. I test 1,260 endpoints and 509 empty classes, and compare all 34 size-eight counts with a meet-in-the-middle enumeration.

Change the inputs · AT.EX19.06 · Zachary graph · NetworkX · Levit & Mandrescu · Independence polynomials

I reproduce · python stables19.py

Download bilingual starter kit ↓

Comments

Comments from both language editions appear here.

The discussion is open for reading. I’ll enable submissions once spam protection is configured.