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

The static GRAPH with vectors of adjacency of section 9.4 [see Graph.h]: the adjacent nodes of all the nodes in one vector, the ones of \( u \) in the places \( [ \mathrm{off}( u ) , \mathrm{off}( u + 1 ) ) \); no insertion nor deletion, \( \Theta( n + m ) \) space and no pointer. More...

#include "ADS/Contract.h"
#include "ADS/graph/Graph.h"
#include <optional>
#include <ranges>
#include <span>
#include <tuple>
#include <type_traits>
#include <variant>
#include <vector>
#include "ADS/graph/impl/ArrayGraph.tpp"

Go to the source code of this file.

Classes

class  ADS::ArrayGraph< W >
 a static graph with vectors of adjacency, all in one vector More...

Namespaces

namespace  ADS

Detailed description

The static GRAPH with vectors of adjacency of section 9.4 [see Graph.h]: the adjacent nodes of all the nodes in one vector, the ones of \( u \) in the places \( [ \mathrm{off}( u ) , \mathrm{off}( u + 1 ) ) \); no insertion nor deletion, \( \Theta( n + m ) \) space and no pointer.

The contracts [see Contract.h]: the graph has n >= 0 nodes and its edges join two distinct nodes; adj(), forEachAdj() and forEachEdge() need a node; the invariant is that the offsets do not decrease and end at the size of the vector, whose entries are nodes. The operations are defined in ArrayGraph.tpp.

See also
A. Montresor, Algoritmi e Strutture Dati, 2025, section 9.4, https://algoritmicamente.it/materiali/libro/capitoli/cap09.pdf
Author
Donato Meoli
Dipartimento di Informatica
Università di Pisa