This paper demonstrates a methodology for the optimal use of phase shifting transformers (PSTs) for the minimisation of the risk of congestion on power system lines. The methodology proposes as a first step the use of Monte-Carlo simulation for the assessment of the power flow distributions in the lines. It is shown that by using PSTs these distributions are shifted by specific factors that can be derived from the system topology and the location of the PSTs. In this context, the problem of de-congesting the system corresponds to finding the PST settings that shift these distributions inside the operational limits of the power system lines. This optimisation problem can not be defined by an analytical expression; a simulation-based optimisation is therefore proposed, in particular particle swarm optimisation. A study case shows how the proposed technique leads to the best utilisation of the capacity in a meshed grid.