First time here? Check out the FAQ!
answered 2013-04-01 06:23:49 +0100
Following up on vdelecroix's comment above, here's an example:
sage: G=graphs.PathGraph(5) sage: G.distance(2,4) 2