remove_bivalent_vertex#

remove_bivalent_vertex(k, node, keep_if_unknot=True)#

Remove a degree-2 vertex by splicing its incident edges.

If both incident arcs form a trivial loop at the same vertex and keep_if_unknot is True, the vertex is kept.

Parameters:
  • k (PlanarDiagram) – Diagram to modify (in place).

  • node – The degree-2 vertex to remove.

  • keep_if_unknot (bool) – Preserve the vertex if it is the center of an unknot.

Raises:

ValueError – If node is not degree-2.

Return type:

None