Move iter_lhs_ancestry function to graph object.