let pred_set graph q = if G.mem_vertex graph q then G.fold_pred (fun p acc -> S.add p acc) graph q S.empty else S.empty