We introduce two exotic lattice models on a general spatial graph. The first one is a matter theory of a compact Lifshitz scalar field, while the second one is a certain rank-2 $U(1)$ gauge theory of fractons. Both lattice models are defined via the discrete Laplacian operator on a general graph. We unveil an intriguing correspondence between the physical observables of these lattice models and graph theory quantities. For instance, the ground state degeneracy of the matter theory equals the number of spanning trees of the spatial graph, which is a common measure of complexity in graph theory ("GSD = complexity"). The discrete global symmetry is identified as the Jacobian group of the graph. In the gauge theory, superselection sectors of fractons are in one-to-one correspondence with the divisor classes in graph theory. In particular, under mild assumptions on the spatial graph, the fracton immobility is proven using a graph-theoretic Abel-Jacobi map.