|
nxpp
Header-only graph utilities on top of Boost Graph Library
|
Result container for single-source shortest-path routines. More...
#include <shortest_paths.hpp>

Public Member Functions | |
| bool | has_path_to (const NodeID &target) const |
| Returns true when the target exists in the result and is reachable. | |
| std::vector< NodeID > | path_to (const NodeID &target) const |
Reconstructs the path from the original source to target. | |
Result container for single-source shortest-path routines.
Distances and predecessors are materialized eagerly, while concrete source-to-target paths are reconstructed on demand through path_to().
Example:
|
inline |
Reconstructs the path from the original source to target.
| target | Target node ID. |
std::vector<NodeID> describing the source-to-target path. | std::runtime_error | If the target is missing, unreachable, or the predecessor map is inconsistent. |
References nxpp::SingleSourceShortestPathResult< NodeID, Distance >::distance, and nxpp::SingleSourceShortestPathResult< NodeID, Distance >::predecessor.