Many years ago, electricity was a monopoly operated at the national level. In recent years, the European grid has moved in two directions: it has integrated across borders and there is a growing amount of decentralised power generation, such as locally produced wind and solar power. Any surplus from this feeds into the grid. In recent years, the EU has been striving to build an integrated single European energy market for gas and electricity, which should be completed by 2014. The European Network of Transmission System Operators for Electricity (ENTSO-E) was created to enable Europe's transmission system operators to coordinate and manage their cross-border electricity supplies. The network aims to underwrite the security, adequacy, reliability and sustainability of Europe's electricity supply. With financing from the Seventh Framework Programme (FP7), the 'Pan-European grid advanced simulation and state estimation' (PEGASE) project is working to boost the efficiency of the pan-European electricity network by creating better algorithms for the monitoring, simulation and optimisation of very large power systems. With 22 partners from across the EU, the four-year project has developed and tested prototype algorithms and smart tools for managing the European grid. These include real-time estimation of the state of the network and automated steady-state optimisation based on actual operating conditions. In addition, PEGASE has developed models for simulating the complex dynamic processes in the network to ensure stability and to prevent blackouts. Project members also trained the dispatchers to avoid potentially problematic human errors during stressful on–the–spot decisions. PEGASE is helping to pave the way towards a more efficient, reliable and sustainable European grid by removing the technical algorithmic barriers that prevent the optimisation and simulation of very large systems.