Title
Description:
- Adjacency matrix:
- A nΓn matrix which has 1 at [u][v] if u points to v, otherwise 0
- If the graph is undirected, then aijβ=ajiβ and the matrix π΄ is symmetric about the diagonal.
- Adjacency list:
- 1 list for each vertex and it is 1 (or the weight) if it has edge to u
- Evβ={uβ£(v,u)βE}
- Edge list:
- A list of all the edges, denoted by starting vertex and ending vertex
- eg. [βAβ. βCβ]
small quiz
- True or False?: For sparse graph (not so many edges), adjacent list and edge list are more memory efficient than adjacency matrix. β True
- adj matrix has to store a lot of unnecessary zeros of unconnected vertices