The sum of all eigenvalues of a square matrix is equal to its trace (the sum of its main diagonal elements):
i=1∑5λi=Trace(A)=i=1∑5Aii In the adjacency matrix of a graph:
A diagonal entry Aii represents the number of self-loops at vertex i.
Vertices 1,2, and 5 have no self-loops, so A11=A22=A55=0.
Vertices 3 and 4 each have one self-loop.
Depending on the convention used for self-loops in an adjacency matrix:
Standard convention: A self-loop contributes 1 to the diagonal entry. Thus, A33=1 and A44=1.
Trace(A)=0+0+1+1+0=2 Degree-preserving convention: A self-loop contributes 2 to the diagonal entry. Thus, A33=2 and A44=2.
Trace(A)=0+0+2+2+0=4
Both 2 and 4 are accepted by the official answer key [2 to 2 OR 4 to 4].