getReachability: get reachability to goal states

Description Usage Arguments Details Value

View source: R/functions_graph.R

Description

get reachability to goal states (or to 'target' states if specified). See details.

Usage

1
getReachability(g, target = NULL)

Arguments

g

an 'igraph' object generated by makeGraph function.

target

a numerical vector, which gives IDs of target states. NULL means IDs of goal states.

Details

Reachability of a state represent whether it is on any acyclic path to any of goal states (or to any of 'target' states if specified).

Suppose you proceeded from the initial state of the sliding puzzles.

'Reachability' of a state is a wider concept than whether it is on the shortest pathes to the goal (target) states: States on the longer pathes are also 'reachable'.

Value

a binary vector of the length of the number of states in 'g'. The ith element gives reachability of the ith state in 'g' (0:unreachable, 1:reachable)


shigono/rSlidePzl documentation built on Jan. 21, 2021, 8:01 a.m.