Learn R Programming

cayleyR (version 0.2.1)

short_position: Simplify Operation Path

Description

Removes redundant operations from a path: cancels inverse pairs ("1"+"2", "3"+"3"), reduces chains of shifts modulo n, and simplifies blocks between reverses.

Usage

short_position(allowed_positions, n)

Value

Character vector of simplified operations

Arguments

allowed_positions

Character vector of operations to simplify

n

Integer, size of the permutation ring (used for modular reduction)

Examples

Run this code
short_position(c("1", "2"), n = 5)
short_position(c("3", "3"), n = 5)
short_position(c("1", "1", "1", "1", "1"), n = 5)

Run the code above in your browser using DataLab