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

Autor: Lumsdaine, Andrew, D'Alessandro, Luke, Deweese, Kevin, Firoz, Jesun, Liu, Xu Tony, McMillan, Scott, Ratzloff, John Phillip, Zalewski, Marcin
Jazyk: angličtina
Rok vydání: 2022
Předmět:
DOI: 10.4230/lipics.ecoop.2022.31
Popis: 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, a modern, composable, and extensible C++ library.
LIPIcs, Vol. 222, 36th European Conference on Object-Oriented Programming (ECOOP 2022), pages 31:1-31:28
Databáze: OpenAIRE