Floyd

Is this algorithm a method of the graph object?  If so, why is it defined in the module scope, rather than the graph scope, and why does it take a graph as an argument rather than just operating on the graph to which it belongs?  If not, why does it take "self" as an argument?