parallelize_arc#

parallelize_arc(k, arc, **attr)#

Insert a new arc parallel to an existing arc (on the first endpoint’s side).

The new arc is inserted at position pos_a + 1 at the first endpoint and at pos_b at the second endpoint, effectively drawing a parallel strand.

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

  • arc (tuple[tuple, tuple]) – ((node_a, pos_a), (node_b, pos_b)) – ordered existing arc endpoints.

  • **attr – Attributes for the new arc endpoints.

Raises:
  • NotImplementedError – If the arc is a loop.

  • ValueError – If either endpoint node is not a Vertex.

Return type:

None