Suppose I have a 20x20 matrix. All of the values are positive and rational. It's not symmetric.

I need the largest eigenvalue, or an approximation of it.

What algorithm should I be using?

## Algorithm for finding eigenvalues

### Re: Algorithm for finding eigenvalues

I would try the Power Iteration method first. The reason is that it is conceptually very easy, and therefore almost trivial to implement and make work correctly. It is also one of the few algorithms that targets only the largest eigenvalue, and also works on non-symmetric matrices. Only if it were too slow would I start looking around for improvements or better algorithms.

_{Jaap's Puzzle Page}

### Re: Algorithm for finding eigenvalues

Thanks, Jaap. That's exactly the kind of algorithm I was looking for. It has been 29 years since my last good math class in matrices.jaap wrote:I would try the Power Iteration method first.

Now I'm trying to find an elegant way of calculating the determinant. 20! terms is a lot. But there are a lot of repeated terms in the matrix, and any 4 in a square position will cancel, eliminating 2*18! terms from the total.

I'm also looking at LU decomposition.