Learn R Programming

cayleyR (version 0.2.1)

find_path_bfs: Find Path via BFS Highways

Description

Builds BFS highway trees from start and final states, finds the closest pair of hub states (one from each highway), then uses find_path_iterative to connect them. Assembles the full path: bfs(start -> hub_s) + iterative(hub_s -> hub_f) + inverted_bfs(final -> hub_f)

Usage

find_path_bfs(
  start_state,
  final_state,
  k,
  bfs_levels = 500L,
  bfs_n_hubs = 7L,
  bfs_n_random = 3L,
  distance_method = "manhattan",
  verbose = TRUE,
  ...
)

Value

List with path, found, cycles, bfs_info

Arguments

start_state

Integer vector, the starting permutation state

final_state

Integer vector, the target permutation state

k

Integer, parameter for reverse operations

bfs_levels

Integer, depth of sparse BFS from each side (default 500)

bfs_n_hubs

Integer, top-degree nodes per BFS level (default 7)

bfs_n_random

Integer, random nodes per BFS level (default 3)

distance_method

Character, "manhattan" or "breakpoints" (default "manhattan")

verbose

Logical, print progress (default TRUE)

...

Additional arguments passed to find_path_iterative