Link failures in supply networks can have catastrophic consequences that can lead to a complete collapse of the network. Strategies to prevent failure spreading are thus heavily sought after. Here, we make use of a spanning tree formulation of link failures in linear flow networks to analyse topological structures that prevent failures spreading. In particular, we exploit a result obtained for resistor networks based on the textit{Matrix tree theorem} to analyse failure spreading after link failures in power grids. Using a spanning tree formulation of link failures, we analyse three strategies based on the network topology that allow to reduce the impact of single link failures. All our strategies do not reduce the grids ability to transport flow or do in fact improve it - in contrast to traditional containment strategies based on lowering network connectivity. Our results also explain why certain connectivity features completely suppress any failure spreading as reported in recent publications.