Title

Description:

  1. Adjacency matrix:
    • A matrix which has 1 at if points to , otherwise 0
    • If the graph is undirected, then and the matrix 𝐴 is symmetric about the diagonal.
      • Can be waste of memory
  2. Adjacency list:
    • 1 list for each vertex and it is 1 (or the weight) if it has edge to
  3. 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