Hamilton-Jacobi Equations on Graph and Applications