@@ -83,10 +83,10 @@ void find_negative_cycle(G& g,
8383 * Unlike Dijkstra's algorithm, Bellman-Ford can handle negative edge weights and detects negative
8484 * weight cycles. Returns an optional vertex ID indicating whether a negative cycle was detected.
8585 *
86- * @tparam G The graph type. Must satisfy index_adjacency_list concept.
86+ * @tparam G The graph type. Must satisfy adjacency_list concept (index or mapped) .
8787 * @tparam Sources Input range of source vertex IDs.
88- * @tparam Distances Random access range for storing distances . Value type must be arithmetic.
89- * @tparam Predecessors Random access range for storing predecessor information . Can use _null_predecessors
88+ * @tparam Distances Vertex property map satisfying vertex_property_map_for<Distances,G> . Value type must be arithmetic.
89+ * @tparam Predecessors Vertex property map satisfying vertex_property_map_for<Predecessors,G> . Can use null_predecessors
9090 * if path reconstruction is not needed.
9191 * @tparam WF Edge weight function. Defaults to returning 1 for all edges (unweighted).
9292 * @tparam Visitor Visitor type with callbacks for algorithm events. Defaults to empty_visitor.
@@ -96,8 +96,8 @@ void find_negative_cycle(G& g,
9696 *
9797 * @param g The graph to process.
9898 * @param sources Range of source vertex IDs to start from.
99- * @param distances [out] Shortest distances from sources. Must be sized >= num_vertices(g) .
100- * @param predecessor [out] Predecessor information for path reconstruction. Must be sized >= num_vertices(g) .
99+ * @param distances [out] Shortest distances from sources. Must be a vertex property map for G .
100+ * @param predecessor [out] Predecessor information for path reconstruction. Must be a vertex property map for G .
101101 * @param weight Edge weight function: (const edge_t<G>&) -> Distance.
102102 * @param visitor Visitor for algorithm events (examine, relax, not_relaxed, minimized, not_minimized).
103103 * @param compare Distance comparison function: (Distance, Distance) -> bool.
@@ -111,16 +111,16 @@ void find_negative_cycle(G& g,
111111 * - Space: O(1) auxiliary space (excluding output parameters)
112112 *
113113 * **Mandates:**
114- * - G must satisfy index_adjacency_list (integral vertex IDs )
114+ * - G must satisfy adjacency_list (index or mapped graphs supported )
115115 * - Sources must be input_range with values convertible to vertex_id_t<G>
116- * - Distances must be random_access_range with arithmetic value type
117- * - Predecessors must be random_access_range with values convertible from vertex_id_t<G>
116+ * - Distances must satisfy vertex_property_map_for<Distances,G> with arithmetic value type
117+ * - Predecessors must satisfy vertex_property_map_for<Predecessors,G> (or null_predecessors)
118118 * - WF must satisfy basic_edge_weight_function
119119 *
120120 * **Preconditions:**
121- * - All source vertices must be valid: source < num_vertices (g) for vector-based containers
122- * - distances.size() >= num_vertices(g)
123- * - predecessor.size() >= num_vertices(g) (unless using _null_predecessors )
121+ * - All source vertices must be valid vertex IDs in vertices (g)
122+ * - distances must contain an entry for each vertex of g
123+ * - predecessor must contain an entry for each vertex of g (unless using null_predecessors )
124124 * - Weight function must not throw or modify graph state
125125 *
126126 * **Postconditions:**
@@ -337,17 +337,17 @@ requires vertex_property_map_for<Distances, G> &&
337337 * Computes shortest distances without tracking predecessor information. More efficient when
338338 * path reconstruction is not needed. Can detect negative weight cycles.
339339 *
340- * @tparam G The graph type. Must satisfy index_adjacency_list concept.
340+ * @tparam G The graph type. Must satisfy adjacency_list concept (index or mapped) .
341341 * @tparam Sources Input range of source vertex IDs.
342- * @tparam Distances Random access range for storing distances . Value type must be arithmetic.
342+ * @tparam Distances Vertex property map satisfying vertex_property_map_for<Distances,G> . Value type must be arithmetic.
343343 * @tparam WF Edge weight function. Defaults to returning 1 for all edges (unweighted).
344344 * @tparam Visitor Visitor type with callbacks for algorithm events. Defaults to empty_visitor.
345345 * @tparam Compare Comparison function for distance values. Defaults to less<>.
346346 * @tparam Combine Function to combine distances and weights. Defaults to plus<>.
347347 *
348348 * @param g The graph to process.
349349 * @param sources Range of source vertex IDs to start from.
350- * @param distances [out] Shortest distances from sources. Must be sized >= num_vertices(g) .
350+ * @param distances [out] Shortest distances from sources. Must be a vertex property map for G .
351351 * @param weight Edge weight function: (const edge_t<G>&) -> Distance.
352352 * @param visitor Visitor for algorithm events.
353353 * @param compare Distance comparison function: (Distance, Distance) -> bool.
0 commit comments