Let $A$ be an $n$ by $n$ matrix with entries in $\{0,1\}$, and such that some power $A^k$ is strictly positive, so Perron-Frobenius stuff applies, i.e. there is a real top eigenvalue $\lambda$ with multiplicity $1$. Let $v$ be a corresponding eigenvector, $Av = \lambda v$.
Q: Is it always possible to write $v$ as a quotient of polynomials in $\lambda?$ If so, is there a simple procedure to determine those rational functions? I'm also wondering if the tools to do this in Python (or Sage perhaps?) already exist, i.e. given the matrix $A$, spit out an explicit expression for the eigenvector $v$ in terms of $\lambda$.
A bit of guessing works for small examples, e.g.:
$A = \begin{bmatrix} 1 & 1 & 0 \\ 1 & 0 & 1 \\ 1 & 0 & 0 \end{bmatrix}$
has characteristic polynomial $x^3 - x^2 - x - 1$, with top eigenvalue $\lambda \approx 1.839$, and with a bit of elbow grease, $v = \begin{bmatrix} 1 \\ \lambda - 1 \\ \lambda^{-1} \end{bmatrix}$ is a corresponding (right) eigenvector. I want to be able to do the same thing in general.
I'm particularly interested in the $8$ by $8$ matrix
$\begin{bmatrix} 1& 1& 0& 0& 0& 0& 0& 0 \\ 0& 1& 1& 0& 0& 0& 0& 0 \\ 0& 1& 0& 1& 0& 0& 0& 0 \\ 1& 0& 0& 0& 1& 0& 0& 0 \\ 0& 0& 1& 0& 0& 1& 0& 0 \\ 0& 1& 0& 0& 0& 0& 1& 0 \\ 0& 0& 0& 1& 0& 0& 0& 1 \\ 0& 1& 0& 0& 0& 0& 0& 0 \end{bmatrix}$.
If someone can handle this guy, even with ad-hoc ideas, it would be helpful!
Edit: Ok, the 8x8 matrix isn't too hard to do by hand. So it's not so enlightening regarding a general method.
Edit 2: To clarify, I'm looking for a formula or method that's simpler than Gaussian elimination or the like. There are sometimes clever methods for these sorts of things -- the 'cover up' method for partial fractions comes to mind.
The following is an elaboration of my comment.
If $\lambda$ is of algebraic multiplicity $1$ (which is guaranteed in the case that $\lambda$ is the spectral radius and $A$ is an irreducible non-negative matrix, as is guaranteed by the Perron Frobenius theorem), then the desired eigenvector can be computed as any non-zero column of the adjugate matrix $\operatorname{adj}(A - \lambda I)$.
The fact that $\operatorname{adj}(A)$ is non-zero follows from the fact that $\lambda$ has geometric multiplicity $1$, which means that $A - \lambda I$ has rank $n-1$, which as a consequence of the determinantal characterization of rank means that at least one of the $(n-1)\times(n-1)$ submatrices of $A - \lambda I$ has a non-zero determinant. On the other hand, we have $$ (A - \lambda I) \operatorname{adj}(A - \lambda I) = \det(A - \lambda I) I = 0, $$ which means that each column of $\operatorname{adj}(A - \lambda I)$ is an element of $\ker(A - \lambda I)$, i.e. an element of the eigenspace of $A$ associated with $\lambda$.