Multigraph
Allows parallel edges and self-loops.
Matrix: Multigraph: cells count edges, loops count twice
Edge 0-1: cells (0, 1) and (1, 0) go from 0 to 1, the same as in a simple graph. 1 of 6 edges placed.
Cost
- Add edge
- O(1)
- Space
- O(V + E)
Before this
Taught by the same lesson
Matrix covers these too, in the same run.