perf: tighten indicator big-Ms to natural per-step bounds#88
Open
andig wants to merge 2 commits into
Open
Conversation
Every indicator constraint used the global M=1e6 while the largest per-step energy in any test case is a few kWh — 150-400x looser than needed, which makes the LP relaxation nearly vacuous around the binaries: a fractional z_p_demand of ~0.003 satisfies the charge-demand disjunction while paying neither the charge cost nor the penalty, and export/import direction indicators carry no real information at the root. Replace each M with the smallest constant that keeps the inactive branch vacuous: p_demand and s_max for the demand disjunction, the per-step charge/discharge caps (the variables' own upper bounds) for z_c/z_cd and the grid-coupling rows, solar-plus-discharge-capacity and demand-plus-charge-capacity for the flow-direction indicators (falling back to M only when a grid limit's unbounded excess variable enters the balance), and the limit threshold itself for z_imp_lim/z_exp_lim. The integer feasible set is unchanged; the relaxation is strictly tighter. CBC on case 020: 271 nodes / 2.0s -> 16 nodes / 0.67s; full pulp objectives on all 13 golden cases match the loose model to ~1e-6 relative (verified side by side). Cases 013/019 land on a different point of the same full-objective optimal plateau (full objective equal to 5.5e-7, but the reported penalty-free objective_value decomposition differs by ~0.7%), so those two expected values are updated; the underlying optimum is identical. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Member
Author
|
@ekkea found this during model optimization when porting CBC to Go. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Full-suite benchmark (bundled CBC, single-thread, app-faithful build, median of 3)
020 (the pathological case) drops 4.8× in nodes and 3.6× in iterations; 016/017/018 improve. One regression: 021 goes 0→10 nodes (0.14→0.38s) — the tighter relaxation lands CBC's dives on a different plateau vertex there; total suite is still a net win. All 13 Optimal with unchanged full objectives.