orient_edges#

orient_edges(k, edge_paths)#

Orient an unoriented diagram along given edge paths.

Each item in edge_paths is a sequence of endpoints describing an edge as a chain of alternating endpoints. The orientation is assigned along each path by pairing consecutive endpoints: (0→1), (2→3), …

Parameters:
  • k (PlanarDiagram) – Unoriented diagram to orient.

  • edge_paths (list[list[Endpoint]]) – List of edge endpoint sequences. For each path, orientation goes from index 0 to 1, 2 to 3, etc. If you want the opposite orientation for a particular edge, reverse that list.

Returns:

A new OrientedPlanarDiagram.

Return type:

OrientedPlanarDiagram

Example

>>> # Given an unoriented diagram k:
>>> paths = compute_edges(k)               # list of edges (endpoint sequences)
>>> ok = orient_edges(k, paths)            # orient along the given direction