-
Notifications
You must be signed in to change notification settings - Fork 10
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
Errors on motif with disconnected nodes #43
Comments
hey @bdpedigo! that's a great point, we should definitely fail early on these. The obvious reason we don't support multi-component motifs is that there is an exponential cost to enumerating motif matches for each connected component; what would be the sort of behavior you prefer? docs that make this explicit? a check at call-time that raises an exception? it doesn't raise right now because I've been trying to minimize the number of branches in the |
PS: excited that grandiso is useful to you :) I guess a third option is computing matches for each component and returning them either as a product map ( |
Same! 🎉 I feel the simplest answer would be to just throw an error if the input motif is not fully connected. And given that this would be dictating the allowed inputs, a brief line in the documentation that says "input motif must be one connected component" also seems warranted. In terms of behavior if you were to allow this kind of thing, I would default to whatever networkx is doing currently (since it does at least run):
I suspect it in practice it is something like your product map (if I understand you correctly) but I doubt they are doing anything explicit to recognize that this subgraph is disconnected when they compute it. That being said, I have what I need for my application, so no pressure at all here to change the implementation. |
I like that solution — will add shortly :) |
Encountered an error when feeding in some motifs that had isolated nodes.
Code:
Error:
Totally understand if you want to punt on how whether/how to execute the search with these disconnected motifs, but some documentation and/or early value erroring around this would be helpful. Took me a while to figure out what I was doing wrong (since the NetworkX will execute for these cases).
The text was updated successfully, but these errors were encountered: