Comparison of Graph Representations
| array of edges | adjacency matrix | adjacency list |
space usage | E | V2 | V+E |
initialise | 1 | V2 | V |
insert edge | 1 | 1 | 1 |
find/delete edge | E | 1 | V |
Other operations:
| array of edges | adjacency matrix | adjacency list |
disconnected(v)? | E | V | 1 |
isPath(x,y)? | E·log V | V2 | V+E |
copy graph | E | V2 | V+E |
destroy graph | 1 | V | V+E |
|