Cycle time optimization of deterministic timed weighted marked graphs