First time here? Check out the FAQ!
answered 11 years ago
Following up on vdelecroix's comment above, here's an example:
sage: G=graphs.PathGraph(5) sage: G.distance(2,4) 2