  Delsarte, Goethals, and Seidel (1977) used the linear programming method in
order to find bounds for the size of spherical codes endowed with prescribed
inner products between distinct points in the code. In this paper, we develop
the linear programming method to obtain bounds for the number of vertices of
connected regular graphs endowed with given distinct eigenvalues. This method
is proved by some "dual" technique of the spherical case, motivated from the
theory of association scheme. As an application of this bound, we prove that a
connected $k$-regular graph satisfying $g>2d-1$ has the minimum second-largest
eigenvalue of all $k$-regular graphs of the same size, where $d$ is the number
of distinct non-trivial eigenvalues, and $g$ is the girth. The known graphs
satisfying $g>2d-1$ are Moore graphs, incidence graphs of regular generalized
polygons of order $(s,s)$, triangle-free strongly regular graphs, and the odd
graph of degree $4$.
