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

Support for has_cycle() on sparse models #103

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

volkm
Copy link
Contributor

@volkm volkm commented Oct 19, 2022

Checking whether a model is acyclic should be quite helpful.

Note that the current implementation first needs to find and exclude all states with self-loops, because the underlying Storm function is considering self-loops as cycles.

Thanks to @jipspel for some help.

}
}
}
return storm::utility::graph::hasCycle(matrix, subStates);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is problematic for MDPs, when we have one self-loop row first and then one non-selfloop row which induces a cycle with other states, right?

I think the "hasCycle" would need to have a "subChoices" input to make this work?
Alternatively, this method could also build an SCC decomposition and we then check if each SCC has size 1.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this is indeed problematic.
I am open for other suggestion. The SCC decomposition might be a good idea.
I actually just wanted to have a simple function to check for acyclity. Unfortunately, hasCycle is not exactly giving me what I want. Maybe it makes sense to implement a better function in Storm directly.

@sjunges sjunges marked this pull request as draft November 29, 2023 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants