Topological nature of the liquid-liquid phase transition in tetrahedral liquids