Let $G=(V,E)$ be a connected simple graph and $A_G$ its adjacency matrix. Is there an effective way to encode the information of longest paths of $G$ via $A_G$? (Or maybe using some kind of Laplacian matrix?)
For example, to encode the information of the diameter $d(G)$ of $G$, one can define \begin{align} f_n : L\left(\mathbb{R}^{|V|},\mathbb{R}^{|V|}\right)&\to L\left(\mathbb{R}^{|V|},\mathbb{R}^{|V|}\right) \\ T\quad &\mapsto \sum_{k=0}^n T^k\end{align} and verify that $d(G) = \min\{n: \left(f_n(A_G)\right)_{ij}> 0,~\forall ij\}$, that is, the least $n$ such that you can guarantee that every node has reached every other node. The eccentricity $e(v_i)$ of a node can be obtained in the same way, but this time you look only to the $i$th column of $f_n(A_G)$.
Maybe it's not the most efficient way to obtain $d(G)$ from $A_G$, but I think it captures the idea of what I'm asking.