Return an actual firing sequence from the Gonality Game's verbose mode#34
Open
Copilot wants to merge 2 commits into
Open
Return an actual firing sequence from the Gonality Game's verbose mode#34Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/DhyeyMavani2003/chipfiring/sessions/236cbaa8-547e-4b16-99f9-25ec2f69353a Co-authored-by: DhyeyMavani2003 <82772894+DhyeyMavani2003@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Implement gonality game and related algorithms and tools
Return an actual firing sequence from the Gonality Game's verbose mode
Apr 21, 2026
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.
CFGonality._find_winning_sequencewas a stub returning[], soplay_gonality_game(..., verbose=True)reported Player A as the winner without ever showing how the debt was resolved. The broader gonality / treewidth / Dhar / Platonic-solid infrastructure called for in issue #6 is already in place; this fills the one concrete remaining placeholder in the gonality-game path.Changes
chipfiring/CFGonality.py— Implement_find_winning_sequenceby reusing the existingDharAlgorithmin an EWD-style loop:qas the min-degree vertex (matchingalgo.EWD).V − {q}, fire it, and append the fired vertex names (sorted) to the returned sequence.[]for already-effective inputs and for non-winnable inputs (detected via residual debt atqafter q-reduction).O(|V|²)iteration cap to guarantee termination on pathological inputs.tests/test_cfgonality.py— NewTestFindWinningSequencecovering: already-effective input, debt resolution on K₃ and on a path graph (with end-to-end verification that applying the returned firings produces an effective divisor), non-winnable input, input non-mutation, and verboseplay_gonality_game.Example