Learn R Programming

cayleyR (version 0.2.1)

get_reachable_states: Find Cycle in Permutation Group

Description

Explores the Cayley graph starting from an initial state and applying a sequence of operations repeatedly until returning to the start state. Returns detailed information about all visited states, the cycle structure, and celestial LRX coordinates.

Usage

get_reachable_states(start_state, allowed_positions, k, verbose = FALSE)

Value

List containing:

states

List of all visited states

reachable_states_df

Data frame with states, operations, steps, and celestial coordinates

operations

Vector of operations applied

coords

List of celestial coordinate objects per step

nL_total

Total left shifts

nR_total

Total right shifts

nX_total

Total reverse operations

total_moves

Total number of moves in the cycle

unique_states_count

Number of unique states visited

cycle_info

Summary string with cycle statistics

Arguments

start_state

Integer vector, the initial permutation state

allowed_positions

Character vector, sequence of operations to repeat

k

Integer, parameter for reverse operations

verbose

Logical; if TRUE, prints progress and cycle information (default FALSE)

Examples

Run this code
result <- get_reachable_states(1:10, c("1", "3"), k = 4)
writeLines(result$cycle_info)

Run the code above in your browser using DataLab