begin script to compute kc conditions from a given graph