Python implementation of various (graph) algorithms