Changes to return all optimal zero forcing sets #2
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.
The last two commits were because my editor was inserting tabs instead of 4 spaces, so I was fixing format issues because of that. I fixed my editor and I thought I got all the formating changes, however there might still be some left, sorry.
This is untested, if you would like me to test the code, I will need more time.
I did basically what we talked about, I believe you were right that we should simply send back all the optimal zero forcing sets. So first we create a flag called "found_optimal_set" and set this flag to false. I also created a dictionary of the optimal zero forcing sets, called "optimal_sets", I didn't know much about dictionaries, so I just copied the format you had on the closures dictionary and had the optimal_sets dictionary map zero forcing sets to the integers, which may allow for overflow, so we can change that to a higher allocation if necessary.
We check every time we go to a new budget number. Then we run through all the closures and what not. If we find a closure that has no unfilled vertices, then we have our optimal zero forcing set. We set the flag to true and add that zero forcing set to the "optimal_sets" dictionary, if it isn't already there.
When we check the flag on the next iteration of the budget loop, we will then create the set of optimal zero forcing sets. Once done, we free memory and return "Optimal zero forcing number", "Optimal zero forcing sets", "Number of closures we made", "Number of optimal zero forcing sets".
This of course changes what the zero_forcing_wavefront.pyx does, but I would assume you are going to save it as a different functioning function.