From 4e98a6512d7ca592f8181c97824a6813b7031663 Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Wed, 22 Jan 2025 14:35:09 +0100 Subject: [PATCH] more on graph cleanup --- ortools/graph/shortest_paths.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/ortools/graph/shortest_paths.h b/ortools/graph/shortest_paths.h index 07e4c9908f..6fcdcbb095 100644 --- a/ortools/graph/shortest_paths.h +++ b/ortools/graph/shortest_paths.h @@ -30,28 +30,30 @@ // computation. // // Also included are classes to store path data resulting from shortest path -// computations (cf. PathContainer). +// computations (cf. GenericPathContainer). // // Usage example computing all-pair shortest paths on a graph: -// StaticGraph graph(...,...); +// StaticGraph<> graph(...,...); // std::vector arc_lengths(...,...); // ... populate graph and arc lengths ... -// PathContainer container; -// PathContainer::BuildInMemoryCompactPathContainer(&container); +// GenericPathContainer> container = +// GenericPathContainer< +// StaticGraph<>>::BuildInMemoryCompactPathContainer(); // ComputeAllToAllShortestPathsWithMultipleThreads(graph, // arc_lengths, // /*num_threads=*/4, // &container); // // Usage example computing shortest paths between a subset of graph nodes: -// StaticGraph graph(...,...); +// StaticGraph<> graph(...,...); // std::vector arc_lengths(...,...); // ... populate graph and arc lengths ... // vector sources; // vector sinks; // ... fill sources and sinks ... -// PathContainer container; -// PathContainer::BuildInMemoryCompactPathContainer(&container); +// GenericPathContainer> container = +// GenericPathContainer< +// StaticGraph<>>::BuildInMemoryCompactPathContainer(); // ComputeManyToManyShortestPathsWithMultipleThreads(graph, // arc_lengths, // sources, @@ -98,14 +100,15 @@ class PathContainerImpl; // Container class storing paths and distances along the paths. It is used in // shortest path computation functions to store resulting shortest paths. // Usage example iterating on the path between nodes `from` and `to`: -// PathContainer path_container; -// PathContainer::BuildInMemoryCompactPathContainer(&path_container); +// GenericPathContainer> container = +// GenericPathContainer< +// StaticGraph<>>::BuildInMemoryCompactPathContainer(); // // ... fill up container ... -// const PathContainer::NodeIndex from =...; -// PathContainer::NodeIndex to =...; +// const GenericPathContainer::NodeIndex from =...; +// GenericPathContainer::NodeIndex to =...; // while (to != from) { // LOG(INFO) << to; -// to = path_container.GetPenultimateNodeInPath(from, to); +// to = container.GetPenultimateNodeInPath(from, to); // } template class GenericPathContainer {