Bird
0
0

You have a large sparse symmetric adjacency matrix of a graph. To efficiently compute the three smallest eigenvalues, which method is best?

hard📝 Application Q8 of 15
SciPy - Sparse Linear Algebra
You have a large sparse symmetric adjacency matrix of a graph. To efficiently compute the three smallest eigenvalues, which method is best?
AUse <code>eigsh</code> with <code>which='SM'</code>
BUse <code>eigs</code> with <code>which='LM'</code>
CUse <code>numpy.linalg.eig</code> directly
DUse <code>eigsh</code> with <code>which='LA'</code>
Step-by-Step Solution
Solution:
  1. Step 1: Matrix properties

    Matrix is symmetric and sparse.
  2. Step 2: Choose solver and parameters

    eigsh is optimized for symmetric sparse matrices; which='SM' finds smallest magnitude eigenvalues.
  3. Final Answer:

    Use eigsh with which='SM' -> Option A
  4. Quick Check:

    eigsh + which='SM' for smallest eigenvalues [OK]
Quick Trick: eigsh with which='SM' for smallest eigenvalues [OK]
Common Mistakes:
  • Using eigs for symmetric matrices
  • Using which='LA' to find smallest eigenvalues

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SciPy Quizzes