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

shortcircuit is_node_convex when there is exactly one node #152

Closed
doug-q opened this issue Nov 13, 2024 · 0 comments · Fixed by #153
Closed

shortcircuit is_node_convex when there is exactly one node #152

doug-q opened this issue Nov 13, 2024 · 0 comments · Fixed by #153
Assignees

Comments

@doug-q
Copy link
Contributor

doug-q commented Nov 13, 2024

in is_node_convex we currently have

        if nodes.is_empty() {
            return true;
        }

A graph consisting of exactly one node is always convex so we should instead if nodes.len() <= 1. Convexity checking is expensive, so this optimisation does seem worthwhile. Ref CQCL/hugr#1652

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 a pull request may close this issue.

2 participants