Similar Items: Optimal controller synthesis for timed systems