powered by
Computes the Manhattan distance from a reference state to every row in a table of reachable states, adds a difference column, and sorts by it.
difference
calculate_differences( start_state, reachable_states_start, method = "manhattan", use_gpu = FALSE )
Data frame sorted by difference (ascending)
Integer vector, the reference state
Data frame with V-columns
Character, distance method (currently only "manhattan")
Logical, use GPU acceleration via ggmlR if available (default FALSE)
df <- data.frame(V1 = c(1, 2), V2 = c(2, 1)) calculate_differences(c(1, 2), df)
Run the code above in your browser using DataLab