TopoConvexChecker does a full graph traversal on initialization, to optimise online is_convex queries.
This incurs an extra cost that is not amortized when running a single check before discarding the structure.
See for example
https://github.com/CQCL/portgraph/blob/ebaed875004a4fcafab5a2502652c078eb293554/src/view/subgraph.rs#L99-L103
We should implement a simpler convexity checker for single operations, and use it where appropriate.
Discussion: Quantinuum/hugr#1656
Note the optimization proposal for only exploring nodes in the same hierarchy region. That could be used both here and in the general TopoConvexChecker.
TopoConvexCheckerdoes a full graph traversal on initialization, to optimise onlineis_convexqueries.This incurs an extra cost that is not amortized when running a single check before discarding the structure.
See for example
https://github.com/CQCL/portgraph/blob/ebaed875004a4fcafab5a2502652c078eb293554/src/view/subgraph.rs#L99-L103
We should implement a simpler convexity checker for single operations, and use it where appropriate.
Discussion: Quantinuum/hugr#1656
Note the optimization proposal for only exploring nodes in the same hierarchy region. That could be used both here and in the general
TopoConvexChecker.