Energy gaps of Hamiltonians from graph Laplacians