Multiplying the adjacency matrix by itself gives the number of walks of a specified length. Therefore you would keep multiplying the matrix by itself until all values are nonzero. Then the previous iteration shows a zero where the longest routes are.
Subfield: Spectral graph theory
https://en.m.wikipedia.org/wiki/Algebraic_graph_theory
As for adjacency matrices -- consider the (oriented) vertex-edge incidence matrix D (vertices x edges, each edge is a column, head is +1 and tail is -1, other entries are zero). Then D and D' (transpose) both have interpretations (stop and think about them; they're like gradient and divergence), as does L = D D' (graph Laplacian).
This also generalizes from graphs to simplicial complexes (triangles, tetrahedra). And "connected components" of graphs generalize to higher homology groups (loops, voids):