Special Matrices

  1. An adjacency matrix is a square matrix consisting of Boolean values only: $0$s and $1$s.
    • The adjacency matrix plays a great role in implementing various algorithms whose purpose is to answer a "yes" or "no" question, e.g., "Is there a path between two cities $A$ and $B$," or "Can I get from country $A$ to country $B$ by taking 2 or fewer flights?"
    • We will get back to the adjacency matrix both at the end of this Topic 10 and in Topic 11: Graphs & Trees.
    Examples:

    18. $I_1 = \begin{bmatrix} 1 \end{bmatrix}$

    19. $Z_1 = \begin{bmatrix} 0 \end{bmatrix}$

    22. $I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$

    23. $I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}$

    34. $B = \begin{bmatrix} 1 & 1 & 0 & 0 & 1 \\ 0 & 1 & 1 & 0 & 1\\ 1 & 0 & 1 & 0 & 0 \\ 0 & 1 & 0 & 1 & 1 \\ 0 & 1 & 0 & 1 & 0 \end{bmatrix}$