In the doc page for adjacency matrices there is an error for undirected graphs.
It says:
In the case of an undirected graph, the adjacency_matrix. class does not use a full V x V matrix but instead uses a lower triangle (the diagonal and below) since the matrix for an undirected graph is symmetric. This reduces the storage to (V²)/2. Figure 2 shows an adjacency matrix representation of an undirected graph.
In particular, This reduces the storage to (V²)/2 is wrong, since if you count the number of items in the Figure 2, you can see that there are 21 items for a graph of 6 vertices (instead of (6²)/2 = 36 / 2 = 18).
I believe the correct formula is (V² + V) / 2.
For n = 1: (1² + 1) / 2 = 2 / 2 = 1
For n = 2: (2² + 2) / 2 = 6 / 2 = 3
For n = 6: (6² + 6) / 2 = 42 / 2 = 21

In the doc page for adjacency matrices there is an error for undirected graphs.
It says:
In particular,
This reduces the storage to (V²)/2is wrong, since if you count the number of items in the Figure 2, you can see that there are 21 items for a graph of 6 vertices (instead of(6²)/2 = 36 / 2 = 18).I believe the correct formula is
(V² + V) / 2.For n = 1:
(1² + 1) / 2 = 2 / 2 = 1For n = 2:
(2² + 2) / 2 = 6 / 2 = 3For n = 6:
(6² + 6) / 2 = 42 / 2 = 21