Learn R Programming

cayleyR (version 0.2.1)

find_best_match_state: Find Best Match State

Description

Finds the state in a table that has the minimum Manhattan distance to a target state. If multiple states tie, selects the one with the smallest step number.

Usage

find_best_match_state(
  target_state,
  reachable_states,
  method = "manhattan",
  use_gpu = FALSE
)

Value

Single-row data frame of the best matching state

Arguments

target_state

Integer vector, the target state

reachable_states

Data frame with V-columns