This paper proposes an algorithm for optimal mode scheduling in switched-mode hybrid dynamical systems. The variable parameter consists of the sequence of modes and the switching times between them, and the cost criterion has the form of an integral of a suitable cost function over the state trajectory. The sequencing variable is discrete and hence the problem cannot be solved by standard optimal control techniques. Furthermore, as it is common in optimal scheduling, the problem may be NP hard. In order to ensure computability we replace global optimality by a suitable notion of suboptimality that reflects local minima of schedules. We propose an effective algorithm, prove its convergence, and demonstrate it on an example.