Permit every vertex to start a path: initialize for all , then perform the same maximum-relaxation pass in topological sorting order. Equivalently, the recurrence isThe zero option starts a fresh, zero-edge path; the other options extend an optimal path ending at a predecessor. The largest final entry is therefore the longest path length in the graph, allowing a zero-edge path. This takes , which is for the ordinary simple-graph representation.
Articles by others on the same topic
There are currently no matching articles.