perf: skip charge/discharge lock binaries for one-directional batteries#89
Open
andig wants to merge 1 commit into
Open
perf: skip charge/discharge lock binaries for one-directional batteries#89andig wants to merge 1 commit into
andig wants to merge 1 commit into
Conversation
Member
Author
|
@ekkea found this during model optimization when porting CBC to Go. |
A battery with d_max=0 (or c_max=0) cannot have simultaneous charge and discharge, so its z_cd lock pair is vacuous — yet it contributed one binary and two rows per time step (154 binaries on case 020, a quarter of the model's integer variables). Follow the existing z_c pattern: create z_cd only when the battery can do both, None otherwise. Case 013's expected objective_value moves again for the same reason as in the big-M change underneath: the constraints removed are vacuous, so the optimum is unchanged (side-by-side full-objective check agrees to all printed digits), but the penalty-free decomposition is not unique across the optimal plateau and the solution lands elsewhere on it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
andig
force-pushed
the
model/skip-vacuous-zcd
branch
from
July 15, 2026 21:48
dec05ff to
c409db4
Compare
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)
Measured against #88 (this PR's base):
⚠ Honest tradeoff: the binary removal is a pure model-size win (−154 binaries on 020) and slightly helps 013/017/020, but 021 regresses 5× (10→52 nodes) — with the vacuous rows gone, CBC's dive heuristics land elsewhere on 021's alternate-optima plateau and the suite total goes net-negative on this machine. The removal is structurally sound (optimum unchanged); whether smaller models or this machine's search-path luck matters more is a maintainer call. Happy to close if the wall-clock regression outweighs the size win.