Lyapunov graphs and flows on surfaces