-
Notifications
You must be signed in to change notification settings - Fork 74
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
Consider addings a method to get a graph showing the relationship between constraints #1318
Comments
What would be the purpose of the graph besides visualization? I believe if it serves any logical purpose (by logical meaning we would use it elsewhere and try to interpret/infer something from it) then it should be a Iterable[Iterable[c0 dtype]] and we could then have a method that would access this Iterable of Iterables and construct the graph. As for the name, if the literature doesn't have a standard meaning for it, why not name it as is, i.e. "Constraint Relationship Graph". I'd like to have a crack at this if possible, may I ask if there are any specific format you would prefer this, and in any specific file for a PR? |
It can serve a logical purpose in some instances.
I agree that a more general format is probably preferable. Upon further consideration I think G = nx.Graph(cqm.constraint_dual_graph()) We could also allow a bit more future proofing by using a triple-nested-dict structure class ConstraintedQuadraticModel:
...
def constraint_dual_graph(self) -> typing.Dict[typing.Hashable, typing.Iterable[typing.Hashable]]:
... that way we can go from dict-of-lists to dict-of-dict-of-dict later if we like.
On further review, I think constraint dual graph is the literature name for it. So I like
Contributions are very welcome! See above for opinions on the formatting. As for the file, I think as a method of the |
Example for a QAP
Additional Considerations
The text was updated successfully, but these errors were encountered: