simple tools for solving graph problems in python