prepare graph
reachability