This is a somewhat vague question, but I'm wondering if there has been any research into connections between the spectrum of a graph and some notion of the "topology" of that graph.

To give an example of what I mean, say we take some two-manifold $M$ and consider a graph $G$ which lives on it. By this I mean, let $G$ consist of a very large number of points on $M$ with edges connecting adjacent points. Let $A$ be the adjacency matrix of $G$. Is there some way to define a matrix $B$ dependent on $A$ such that if $M$ has trivial fundamental group the smallest eigenvalue of $B$ is negative but if $M$ has nontrivial fundamental group the smallest eigenvalue of $B$ is positive?

That was a pretty specific example - I'm really just wondering more generally if there's a way to associate a matrix with a graph such that the spectrum of the matrix "sniffs out" some topological feature of the space the graph is associated with.