Mean first-passage time for random walks on undirected networks