Algorithms for eigenvalue optimization