answered 12 years ago
Following up on vdelecroix's comment above, here's an example:
sage: G=graphs.PathGraph(5) sage: G.distance(2,4) 2