Ask Your Question

Revision history [back]

How to find the path of the maximal distance between two vertices on a complete digraph?

I was wondering how can I find the path of the maximal distance between two vertices on a complete digraph. Suppose the digraph has 5 vertices:

sage: g = graphs.CompleteGraph(5).to_directed()

I have seen a maximal flow example which is nice but it is not the same type of problem. How can I use sage to find the longest path?

 2 retagged FrédéricC 4385 ●3 ●37 ●93

How to find the path of the maximal distance between two vertices on a complete digraph?

I was wondering how can I find the path of the maximal distance between two vertices on a complete digraph. Suppose the digraph has 5 vertices:

sage: g = graphs.CompleteGraph(5).to_directed()

I have seen a maximal flow example which is nice but it is not the same type of problem. How can I use sage to find the longest path?