Natural gas is a crucial energy source needed to satisfy heating and electricity needs among other demands. Gas flows between countries via a network of pipelines that can be represented with a graph. The security of gas supply is a crucial issue in Europe, as Europe as a whole must import about seventy-five percent of its gas, about forty percent of which comes from Russia. To combat this weakness, namely the limited number of suppliers of such an important resource, European countries aim to diversify their gas sources in order to spread the risk of decreased gas flow; legislators in the European Union even established a strategic plan called the Third Energy Package to increase security.
The goal of this project is to generate the relevant data needed for colleagues at the Hungarian Academy of Science Centre for Economic and Regional Studies Institute of Economics (MTA KRTK KTI) to assess the supply security of the European gas network by analyzing the effects of pipeline failures and consequent disruptions in the network flow with risk measures used in the banking industry (expected shortfall). I took the following steps to simulate the European gas network and generate the required data:
- understanding the linear programming model (LP) to be used,
- developing a means of representing and storing a network programmatically with Java using graph theoretic concepts
- developing algorithms able to create a graph representation of a network based on provided data,
- developing algorithms able to calculate the optimal flow in a graph,
- developing algorithms able to calculate the price of gas (total and per unit) for each vertex (country) in a graph with both averaged (optimal) and iterative (contract-based) methods,
- running the aforementioned algorithms on a graph and each of its subgraphs missing exactly one edge and storing and presenting the results in an easily accessible format and organized way, and
- automating and easing the accessibility of the previously mentioned processes of reading in and generating data, along with the storing of such data, by developing a simple graphical user interface (GUI).