Optimal synchronization of discrete event dynamic systems via timed marked graphs