Learn R Programming

cayleyR (version 0.2.1)

validate_and_simplify_path: Validate and Simplify a Path

Description

Verifies that a candidate path correctly transforms start_state into final_state, then attempts to simplify it. Returns the simplified path if it remains valid, otherwise the original.

Usage

validate_and_simplify_path(path_candidate, start_state, final_state, k)

Value

List with components:

valid

Logical, whether the path is valid

path

Simplified or original path, or NULL if invalid

Arguments

path_candidate

Character vector of operations

start_state

Integer vector, start state

final_state

Integer vector, target state

k

Integer, parameter for reverse operations

Examples

Run this code
res <- validate_and_simplify_path(c("1", "3"), 1:5, c(5, 2, 3, 4, 1), k = 2)
res$valid

Run the code above in your browser using DataLab