permute_node#
- permute_node(k, node, p)#
Permute the endpoints of the node of knot k. For example, if p = {0: 0, 1: 2, 2: 3, 3: 1} (or p = [0,2,2,1]), and if node has endpoints [a, b, c, d] (ccw) then the new endpoints will be [a, d, b, c]. :param k: knot diagram :param node: node of which we permute its endpoints :param p: permutation given as a dict or list/tuple :return: None TODO: are there problems regarding endpoint attributes? TODO: check if it works for loops (probably does not)