In this paper, optimal control problems for switched systems are studied. In particular, we focus on such problems given a prespecified sequence of active subsystems and propose two approaches based on meta-heuristics to find the optimal switching instants. The first one is based on the Genetic Algorithm (GA) and the second on the Particle Swarm Optimization (PSO) algorithm. The objective is to minimize the performance index, depending on these instants, over a finite time horizon. We assume that a pre-assigned sequence is given and that at each switching instant, a jump in the state space variable may occur and that an additional cost is then associated with it.