In this paper we are concerned with the simulation of crowds in built environments, where obstacles play a role in the dynamics and in the interactions among pedestrians. First of all, we review the state-of-the-art of the techniques for handling obstacles in numerical simulations. Then, we introduce a new modelling technique which guarantees both impermeability and opacity of the obstacles, and does not require ad hoc runtime interventions to avoid collisions. Most important, we solve a complex optimization problem by means of the Particle Swarm Optimization method in order to exploit the so-called Braess's paradox. More precisely, we reduce the evacuation time from a room by adding in the walking area multiple obstacles optimally placed and shaped.