diff --git a/docs/src/first_steps/paths_traversal.md b/docs/src/first_steps/paths_traversal.md index 573f5a95..5cdaca79 100644 --- a/docs/src/first_steps/paths_traversal.md +++ b/docs/src/first_steps/paths_traversal.md @@ -33,11 +33,17 @@ The following properties always hold for shortest path algorithms implemented he - The distance from a vertex to itself is always `0`. - The distance between two vertices with no connecting edge is always `Inf` or `typemax(eltype(distmx))`. -The [`dijkstra_shortest_paths`](@ref), [`desopo_pape_shortest_paths`](@ref), [`floyd_warshall_shortest_paths`](@ref), [`bellman_ford_shortest_paths`](@ref), and [`yen_k_shortest_paths`](@ref) functions return path states (subtypes of `Graphs.AbstractPathState`) that contain various information about the graph learned during traversal. +The [`dijkstra_shortest_paths`](@ref), [`desopo_pape_shortest_paths`](@ref), [`floyd_warshall_shortest_paths`](@ref), [`bellman_ford_shortest_paths`](@ref), and [`yen_k_shortest_paths`](@ref) functions return _path states_ (subtypes of `Graphs.AbstractPathState`) that contain various information about the graph learned during traversal. The corresponding state types (with the exception of `YenState`) have the following common fields: - `state.dists` holds a vector with the distances computed, indexed by source vertex. - `state.parents` holds a vector of parents of each vertex on the shortest paths (the parent of a source vertex is always `0`). `YenState` substitutes `.paths` for `.parents`. -In addition, with the appropriate optional arguments, [`dijkstra_shortest_paths`](@ref) will return information on all possible shortest paths available from the source. \ No newline at end of file +In addition, with the appropriate optional arguments, [`dijkstra_shortest_paths`](@ref) will return information on all possible shortest paths available from the source. + +## Utility functions + +- Once a path state is found using a shortest path algorithm, some or all of the paths can be obtained using [`enumerate_paths`](@ref). +- A longest path within a directed acyclic graph can be found with [`dag_longest_path`](@ref). +- In the case of a graph with some edges having negative weights, the existence of a cycle whose edges sum to a negative value can be detected with [`has_negative_edge_cycle_spfa`](@ref).