copy_and_move_arc#

copy_and_move_arc(k: PlanarDiagram, arc_dicts: list)#

Creates a new arc for each dictionary in the list arc_dicts. A new arc is represented by a dictionary {old_endpoint_1: new_endpoint_1, old_endpoint_2: new_endpoint_2}.

For example, if the dictionary is {a0i: b0, c1o: d2}, in the diagram node incidency, the following changes are made: a[c1o,…], c[…,a0i,…] is changed to b[d2o,…], d[…,…,b0i,…] (attributes are copied from key to value). The endpoints of a and c are not removed and stay as they were (unless overwritten by another dict).

Keys must be Endpoint objects, values should be endpoint pairs.

Method is non-stable (can damage the realizability of the diagram). :param k: planar diagram :param arc_dicts: :return: