Search NASA⌕ Search

DOE OSTI · 1887212

NWGraph: A Library of Generic Graph Algorithms and Data Structures in C++20

Abstract

The C++ Standard Library is a valuable collection of generic algorithms and data structures that improves the usability and reliability of C++ software. Graph algorithms and data structures are notably absent from the standard library, and previous attempts to fill this gap have not gained widespread adoption. In this paper we show that the richness of graph algorithms and data structures can in fact be captured by straightforward composition of existing C++ mechanisms. Generic programming is algorithm-oriented. Accordingly, we apply a systematic approach to analyzing a broad set of graph algorithms, “lift” unnecessary constraints from them, and organize the resulting set of minimal common type requirements, i.e., concepts, for defining their interfaces. By using the newly available ranges and concepts in C++20, the type requirements for generic graph algorithms can be succinctly expressed. The generic algorithms and data structures resulting from our analysis are realized in NWGraph, in a modern, composable, and extensible C++ library.

Explore related subjects

Keep this discovery

Explore connections, maps & timelines

BibTeXRIS

Lumsdaine, Andrew, D’alessandro, Luke, Deweese, Kevin, Firoz, Jesun S., Liu, Tony, Mcmillan, Scott, Ratzloff, John P., Zalewski, Marcin. 2022-06-23. NWGraph: A Library of Generic Graph Algorithms and Data Structures in C++20. https://www.osti.gov/biblio/1887212

Cite the original work for its findings. Save a collection to share your selection of sources.