Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
operations_research::KShortestPaths Struct Reference

#include <k_shortest_paths.h>

Public Attributes

std::vector< std::vector< NodeIndex > > paths
 
std::vector< PathDistancedistances
 

Detailed Description

Stores the solution to a k-shortest path problem. paths contains up to k paths from source to destination (these nodes are arguments to the algorithm), each having a distance stored in distances.

The paths in paths start with origin and end at destination.

If the computations are unsuccessful for any reason, the vectors are empty.

Definition at line 86 of file k_shortest_paths.h.

Member Data Documentation

◆ distances

std::vector<PathDistance> operations_research::KShortestPaths::distances

Definition at line 94 of file k_shortest_paths.h.

◆ paths

std::vector<std::vector<NodeIndex> > operations_research::KShortestPaths::paths

The paths are stored as vectors of nodes, like the other graph algorithms.

Todo
(user): what about vectors of arcs? That might be faster (potentially, add a function to transform it into a vector of nodes if the user really needs it). It would also have the nice benefit of removing the need for distances (compute it on the fly), with a reference to the graph and the costs.

Definition at line 93 of file k_shortest_paths.h.


The documentation for this struct was generated from the following file: