writhe#

Writhe of a knot or link diagram.

The writhe is the number of positive crossings minus the number of negative crossings. For oriented diagrams this is computed directly. For unoriented diagrams, we take the minimum over all orientations.

writhe(k)#

Return the writhe of k.

For oriented diagrams, this is:

sum(sign(c) for c in crossings)

For unoriented diagrams, it is the minimum over all orientations.

Parameters:

k (PlanarDiagram | OrientedPlanarDiagram) – Planar or oriented diagram.

Returns:

The writhe as an integer.

Return type:

int