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

Add a method for calculating num_edges in model.pyx #28

Closed
elham-azd opened this issue Jun 13, 2024 · 1 comment · Fixed by #32
Closed

Add a method for calculating num_edges in model.pyx #28

elham-azd opened this issue Jun 13, 2024 · 1 comment · Fixed by #32
Assignees
Labels
enhancement New feature or request

Comments

@elham-azd
Copy link
Contributor

No description provided.

@arcondello
Copy link
Member

Obviously would be more performant at the C++ level, but I think this can be done in Python with

def num_edges(model: Model) -> int:
    return sum(1 for sym in model.iter_symbols() for _ in sym.iter_successors())

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants