randomize_diagram#

randomize_diagram(k, crossing_increasing_moves=2, allowed_moves=None)#

Perform random Reidemeister moves on a given diagram.

This function modifies a diagram by applying random Reidemeister moves, which are transformations used in knot theory to simplify or alter the representation of a knot or link. The user can specify the type of moves to include and the number of crossing-increasing moves to perform.

Parameters:

k: The initial diagram to be transformed. crossing_increasing_moves (int): Optional; the number of crossing-increasing

moves to perform. Default is 2.

allowed_moves (list[str] or None): Optional; the list of allowed Reidemeister

moves to perform on the diagram. Valid values include “R1”, “R2”, “R3”. If None, all moves are allowed.

Raises:
ValueError: If crossing_increasing_moves is set to a value greater than 0 but

“R2” or “R1” moves are not included in allowed_moves.

Returns:

The transformed diagram after applying the specified random Reidemeister moves.