ADS
Algorithms and Data Structures
Loading...
Searching...
No Matches
Dijkstra.h File Reference

The priority queues of ADS inside the visits of Boost.Graph, beyond the book, compiled only with ADS_WITH_BOOST: UpdatableQueue gives a queue of PriorityQueue.h the interface of the buffer that boost::breadth_first_visit() takes (push(), top(), pop(), empty(), and the update() of the updatable queue of Dijkstra's algorithm), and dijkstraShortestPaths() is the algorithm of Dijkstra of Boost.Graph on such a queue: the visit of Boost.Graph with a visitor that relaxes the arcs, as boost::dijkstra_shortest_paths() does on its own 4-ary heap, which that function does not let a caller replace. More...

Go to the source code of this file.

Detailed description

The priority queues of ADS inside the visits of Boost.Graph, beyond the book, compiled only with ADS_WITH_BOOST: UpdatableQueue gives a queue of PriorityQueue.h the interface of the buffer that boost::breadth_first_visit() takes (push(), top(), pop(), empty(), and the update() of the updatable queue of Dijkstra's algorithm), and dijkstraShortestPaths() is the algorithm of Dijkstra of Boost.Graph on such a queue: the visit of Boost.Graph with a visitor that relaxes the arcs, as boost::dijkstra_shortest_paths() does on its own 4-ary heap, which that function does not let a caller replace.

The queue is reached through PriorityFrontier of ShortestPaths.h, so that every queue that the shortest paths of ADS take serves here as well, with the same rule: the priority of a vertex is its distance, or the pair ( distance , vertex ), which breaks the ties by the names; the fall of a distance is queue_decrease() on a queue that lowers its keys natively, a new insertion on the others, whose stale copies are skipped. The vertices are the integers \( [ 0 , \mathrm{num\_vertices}( g ) ) \) of the vertex index, as in the graphs of ADS [see Graph.h], boost::adjacency_list on vecS and compressed_sparse_row_graph.

The contracts [see Contract.h]: the weights are not negative, which the visit does not check (as in Boost.Graph); the queue is empty.

See also
E. W. Dijkstra, A note on two problems in connexion with graphs, Numerische Mathematik 1, 1959, 269-271, doi:10.1007/BF01386390
J. G. Siek, L.-Q. Lee, A. Lumsdaine, The Boost Graph Library: User Guide and Reference Manual, Addison-Wesley, 2002
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa