First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 11 years ago

Jason Grout gravatar image

Following up on vdelecroix's comment above, here's an example:

sage: G=graphs.PathGraph(5)
sage: G.distance(2,4)
2