In the framework of dependable systems, we propose a mathematical programming approach for the reconfiguration of flexible manufacturing systems (FMS). This kind of procedure is used when unexpected events (called failures) occur – or in order to start a new production –, to determine the actions needed to put the system in a state compatible with production resumption.We propose to express the reconfiguration process as a Petri net reachability problem instance. We start from a Petri net representing the initial production, and we introduce additional nodes and tokens in order to model the potential reconfiguration actions (alternative routes, flexibilities, start and stop of machines, etc). We define then a target marking – not necessarily entirely known –, corresponding to the specification of a family of desired system states. A search for firing sequences leading to the desired marking from the initial one is then made. This problem is finally solved using mathematical programming techniques, allowing to optimize criteria corresponding to the relevance of the reconfiguration.