Learn R Programming

cayleyR (version 0.2.1)

find_best_random_combinations: Find Best Random Operation Sequences

Description

Generates random sequences of operations and evaluates their cycle lengths to find sequences that produce the longest cycles in the Cayley graph. Uses C++ with OpenMP for parallel evaluation of combinations.

Usage

find_best_random_combinations(
  moves,
  combo_length,
  n_samples,
  n_top,
  start_state,
  k
)

Value

Data frame with columns:

combo_number

Integer sequence number

combination

String representation of the operation sequence

total_moves

Cycle length for this sequence

unique_states_count

Number of unique states visited in the cycle

Arguments

moves

Character vector of allowed operation symbols (e.g., c("1", "2", "3") or c("L", "R", "X"))

combo_length

Integer, length of each operation sequence to test

n_samples

Integer, number of random sequences to generate and test

n_top

Integer, number of top results to return (sorted by cycle length)

start_state

Integer vector, initial permutation state

k

Integer, parameter for reverse operations

Examples

Run this code
best <- find_best_random_combinations(
  moves = c("1", "2", "3"),
  combo_length = 10,
  n_samples = 50,
  n_top = 5,
  start_state = 1:10,
  k = 4
)
print(best)

Run the code above in your browser using DataLab