If w = (e1, e2, ..., en − 1) is a finite walk with vertex sequence (v1, v2, ..., vn) then w is said to be a walk from v1 to vn. Similarly for a trail or a path. If there is a finite walk between two distinct vertices then there is also a finite trail and a finite path between them.
Some authors do not require that all vertices of a path be distinct and instead use the term simple path to refer to such a path where all vertices are distinct.
A weighted graph associates a value (weight) with every edge in the graph. The weight of a walk (or trail or path) in a weighted graph is the sum of the weights of the traversed edges. Sometimes the words cost or length are used instead of weight.
If w = (e1, e2, ..., en − 1) is a finite directed walk with vertex sequence (v1, v2, ..., vn) then w is said to be a walk from v1 to vn. Similarly for a directed trail or a path. If there is a finite directed walk between two distinct vertices then there is also a finite directed trail and a finite directed path between them.
A "simple directed path" is a path where all vertices are distinct.
A weighted directed graph associates a value (weight) with every edge in the directed graph. The weight of a directed walk (or trail or path) in a weighted directed graph is the sum of the weights of the traversed edges. Sometimes the words cost or length are used instead of weight.
Several algorithms exist to find shortest and longest paths in graphs, with the important distinction that the former problem is computationally much easier than the latter.
Dijkstra's algorithm produces a list of shortest paths from a source vertex to every other vertex in directed and undirected graphs with non-negative edge weights (or no edge weights), whilst the Bellman–Ford algorithm can be applied to directed graphs with negative edge weights. The Floyd–Warshall algorithm can be used to find the shortest paths between all pairs of vertices in weighted directed graphs.
The k-path partition problem is the problem of partitioning a given graph to a smallest collection of vertex-disjoint paths of length at most k.8
McCuaig 1992, p. 205. - McCuaig, William (1992). "Intercyclic Digraphs". In Robertson, Neil; Seymour, Paul (eds.). Graph Structure Theory. AMS–IMS–SIAM Joint Summer Research Conference on Graph Minors, Seattle, June 22 – July 5, 1991. American Mathematical Society. p. 205. https://archive.org/details/graphstructureth0000amsi/page/205/ ↩
Bender & Williamson 2010, p. 162. - Bender, Edward A.; Williamson, S. Gill (2010). Lists, Decisions and Graphs. With an Introduction to Probability. https://books.google.com/books?id=vaXv_yhefG8C ↩
Chen, Yong; Goebel, Randy; Lin, Guohui; Su, Bing; Xu, Yao; Zhang, An (2019-07-01). "An improved approximation algorithm for the minimum 3-path partition problem". Journal of Combinatorial Optimization. 38 (1): 150–164. doi:10.1007/s10878-018-00372-z. ISSN 1382-6905. https://doi.org/10.1007/s10878-018-00372-z ↩