Source: https://mathcourses.nfshost.com/archived-courses/mat-375-001-2015-fall/lectures/lec-23-adjacency-and-incidence-matrices.pdf