Arguments: int node_count, int start_node, int end_node, std::function<int64_t(int, int)> graph, int64_t disconnected_distance, std::vector<int>* nodes
Arguments: int node_count, int start_node, int end_node, std::function<int64_t(int, int)> graph, int64_t disconnected_distance, std::vector<int>* nodes
Arguments: int node_count, int start_node, int end_node, std::function<int64_t(int, int)> graph, int64_t disconnected_distance, std::vector<int>* nodes
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["\u003cp\u003eThis C++ reference provides utilities for finding the shortest paths in a graph.\u003c/p\u003e\n"],["\u003cp\u003eIt includes algorithms like Dijkstra's, A*, Bellman-Ford, and a stable variant of Dijkstra's.\u003c/p\u003e\n"],["\u003cp\u003eThese algorithms determine the cheapest or shortest path between two nodes in a directed graph.\u003c/p\u003e\n"],["\u003cp\u003eThe functions take graph representation, start/end nodes, and optional parameters like heuristic functions or disconnected distance values as input.\u003c/p\u003e\n"],["\u003cp\u003eThey return a boolean indicating success and populate a provided vector with the nodes along the shortest path if found.\u003c/p\u003e\n"]]],[],null,["# shortestpaths\n\nC++ Reference: shortestpaths\n============================\n\n\nNote: This documentation is automatically generated.\nThis file contains various shortest paths utilities. \n\nKeywords: directed graph, cheapest path, shortest path, Dijkstra, spp. \n\n| Function | Type | Arguments | Comments |\n|----------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|----------|\n| [`AStarShortestPath`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/shortestpaths.h#L76) | Return type: `bool ` Arguments: `int node_count, int start_node, int end_node, std::function\u003cint64_t(int, int)\u003e graph, std::function\u003cint64_t(int)\u003e heuristic, int64_t disconnected_distance, std::vector\u003cint\u003e* nodes` \u003cbr /\u003e |\n| [`BellmanFordShortestPath`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/shortestpaths.h#L62) | Return type: `bool ` Arguments: `int node_count, int start_node, int end_node, std::function\u003cint64_t(int, int)\u003e graph, int64_t disconnected_distance, std::vector\u003cint\u003e* nodes` \u003cbr /\u003e |\n| [`DijkstraShortestPath`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/shortestpaths.h#L38) | Return type: `bool ` Arguments: `int node_count, int start_node, int end_node, std::function\u003cint64_t(int, int)\u003e graph, int64_t disconnected_distance, std::vector\u003cint\u003e* nodes` \u003cbr /\u003e |\n| [`StableDijkstraShortestPath`](https://github.com/google/or-tools/blob/v9.4/ortools/graph/shortestpaths.h#L49) | Return type: `bool ` Arguments: `int node_count, int start_node, int end_node, std::function\u003cint64_t(int, int)\u003e graph, int64_t disconnected_distance, std::vector\u003cint\u003e* nodes` \u003cbr /\u003e |"]]