An exact parallel algorithm for scheduling when production costs depend on consecutive system states