Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix policygenerator slowness #397

Merged
merged 1 commit into from
Dec 12, 2023

Conversation

ahouseholder
Copy link
Contributor

@ahouseholder ahouseholder commented Dec 11, 2023

PolicyGenerator's internal checking of all paths is overzealous when the graph of input states gets large, which it can do very easily with just a few decision points. The resulting list of paths in nx.all_simple_paths grows very rapidly, which causes the whole thing to slow down if this feature is activated. This PR retains the option to do the validation if desired by setting the validate=True option when a PolicyGenerator object is created. But the default behavior is now to not look at every path. This should be ok, because the way we're creating the graph as the transient reduction of a graph that only adds edges where needed should be sufficient to ensure that we're not going to get any bogus paths anyway.

@ahouseholder ahouseholder added the bug Something isn't working label Dec 11, 2023
@ahouseholder ahouseholder added this to the SSVC 2023Q4 milestone Dec 11, 2023
@ahouseholder ahouseholder self-assigned this Dec 11, 2023
@ahouseholder ahouseholder merged commit 806b1ce into CERTCC:main Dec 12, 2023
1 check passed
@ahouseholder ahouseholder deleted the policygen_bugfix branch December 12, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants