Add reachability graph algorithm
Also determine reverse reachability graph, generalize algorithm