Repository navigation
Restricted global bound: SCIP lower bound for generators with at most k states - #72
Merged
Merged
Conversation
…polished into a candidate by the belief-free search Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
sofic.generators.global_bound:generator_global_bound(bidir | problem, k, *, objective_limit=None, two_step=True, caps=(), time_limit=None, data_tol=1e-7, pi_min=1e-7)minimizes the state entropy over the coupled generator equations forkstates, written in the flowsF(w, x, v) = pi_w K(x, v | w), with SCIP's spatial branch and bound through PySCIPOpt (Achterberg 2009; Vigerske & Gleixner 2018; Maher et al. 2016).data_tol, an entropy epigraph, sorted weights (so thecapsbecome linear cuts) and an optional objective limit. With the bidirectional edge chain it adds two-step path flows and the two-step edge law. This is ported from the cpfci prototype, minus the three-step flows (no gain) and the term cuts (a false infeasibility onn3-t035-d0).s_w = max(pi_w, pi_min)(pi <= s <= pi + pi_min), so states of tiny weight still pay. The overestimatek pi_min log2(1/pi_min)is reported asslackand subtracted.GlobalBoundResult.lowerbounds the state entropy of every generator with at mostkstates, and only those. It islimit - slackwhen SCIP proves infeasibility under an objective limit,infwhen no point exists at all, and otherwise the dual bound minusslack. The docstrings say it is numerical, not a certificate, and a lower bound onC_gonly once the number of states of a minimal generator is bounded (open).sofic[global], imported lazily; a missing install raises anImportErrorthat names the extra.hmm_generator_search(..., initial=[T])adds starts from givenk-state HMMs. Their rounds keep the entropy term off, so they move to a nearby generator: from a SCIP solution the entropy descent stalls at an infeasible point (residual 6e-4 at every floor), while the feasibility rounds reach the generator exactly.generative_model/generative_model_from_bidirectionalgetglobal_bound=Falseandglobal_bound_states=None(defaultmin(|S+|, |S-|) + 1). The new stage runs after the belief-free search with half the remaining budget (120 s without a budget). It uses the best candidate's entropy as the objective limit and is skipped above 2,000 SCIP variables, for the Wyner objective, and when PySCIPOpt is missing. It recordsrestricted_lowerandrestricted_states(also in the reliability summary) and offers the polished SCIP solution as a candidate.lowerandcertifiedare unchanged.Why
Every certified minimal generator in the binary 2-/3-state dataset has at most
|S+| + 1states, but no bound on the number of states of a minimal generator is proved. Until one is, a global bound overk-state generators is the strongest numerical evidence available aboutC_gbeyond the certified lower bounds, and its solution is a good upper-bound seed. In the pipeline smoke run at(p, q) = (0.836, 0.788)in the two-state family (C_mu = 0.5866):lower(excess entropy, coverage off)restricted_lower,k = 3, two-step (SCIP optimal, 12 s)H(1 - 2y, y, y)So no generator with at most 3 states does
1e-4bits better than the polished one, which beatsC_muby 0.43 bits.Tests
tests/test_global_bound.py(SCIP tests skip viapytest.importorskip("pyscipopt")):k = 1is infeasible (lower = inf),k = 2givesC_muto within the slack;C_muit is infeasible withlower = limit - slack; above, it is optimal;(0.836, 0.788)atk = 3:H_C - 2e-4 <= lower <= H_C, and the polished solution is within1e-5ofH_Cand passes the exact difference-automaton check (about 12 s);restricted_*are recorded,lower,lower_sourceandcertifiedmatch the run without the stage;ImportErrornamessofic[global], and the pipeline logs the skip.tests/test_hmm_search.py:initial=recovers the ε-machine from a 5% multiplicative perturbation (entries within1e-6), and a wrong shape raisesValueError.-n 10).ruff check,ruff format --checkandty checkpass;sphinx-build -Wbuilds clean.CI: the main test job now installs
--extra global(pyscipopt 6.3.0 has wheels for CPython 3.11–3.14 on Linux, macOS and Windows). The job without the symbolic extra still runs without it, so the skips are exercised there.Docs: a "Restricted global bound" subsection under Lower bounds in
docs/generators/generative_models.rst, plus API entries. It states that the two-step flows and the restricted use are not from the literature.Achterberg2009,Vigerske2018andMaher2016are added todocs/references.bib, with their DOIs checked against Crossref. The CHANGELOG is updated.