closure#
Closure of an open knot (knotoid).
Provides underpass, overpass, and double-sided (over+under) closures by routing a path through faces in the dual planar diagram.
- closure(k, over=False, under=False)#
Close a knotoid by routing through the dual graph between its two degree-1 vertices.
You must choose at least one of
over
orunder
. If both are True, a double-sided closure is performed (one overpass and one underpass).- Parameters:
k (PlanarDiagram) – Planar diagram with exactly two leaves (degree-1 vertices).
over (bool) – Use overpass closure.
under (bool) – Use underpass closure.
- Returns:
A new
PlanarDiagram
with the chosen closure applied.- Raises:
ValueError – If neither over nor under is selected.
ValueError – If the diagram does not have exactly two leaves.
- Return type: