Skip to content


Switch branches/tags

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

Asset-level Transition Risk in the Global Coal, Oil, and Gas Supply Chains

Kruitwagen, L., Klaas, J., Baghaei Lakeh, A., & Fan, J.

A repo for building a network model of the global fossil fuel supply chain using asset-level data. A project in support of the Oxford Martin Programme on the Post-Carbon Transition generously supported by Microsoft AI for Earth.


Climate change risks manifest in the real economy, with grave consequences for welfare of human populations and the biosphere; the economic returns of industrial sectors; and geopolitical stability. Understanding the diffusion of risks in real infrastructure networks is an urgent priority for delivering climate change mitigation, adaptation, and resiliency. The oil, gas, and coal supply chains are the most salient progenitors and inheritors of these environmental risks. We prepare a geospatial arrangement of the global oil, gas, and coal supply chains using open-source asset-level data. The resulting complex network has 6.09mn nodes and 15.70mn edges and is implemented in a graph database. With estimates of annual coal, gas, and oil demand in 13,229 global population centres and 8,165 global power stations, we use a minimum-cost flow method to estimate global asset-level energy flows. We develop a method for cross-validating and tuning our network flow simulation using aggregate country-level import and export statistics. We demonstrate two analyses of asset-level transition risk: a counter-factual demand shock scenario consistent with the IEA Sustainable Development Scenario; and supply shock scenarios developed by interdicting regionally-aggregated coal, oil, and gas supplies. Our contribution lies in the global scope of our asset-level supply chain and the novelty of our minimum-cost flow method. We conclude with a discussion of further research directions and make the graph database and supporting code publicly available.

The full paper is available here.

Figure 1: Global coal, oil, and gas asset-level data Global fossil fuel infrastructure


Our work uses only open-source data in order to maximise accessibility and reporduceability. We build on the substantial efforts of public sector organisations to develop and publish open datasets of energy system infrastrucutre and activity, particularly the work of the Global Energy Monitor, the World Resources Institute ResourceWatch, the Global Oil and Gas Features Database, the European Commision Joint Research Council, OpenStreetMap.

Name N_installations N_sources Quality Icon
Well Pads 9,845 24 Good
Oil Fields 25,236 63 Good
Coal Mines 3,099 32 Adequate
Processing & Refining Facilities 2,501 55 Good
LNG Liqufication & Regasification 329 15 Excellent
Pipelines 94,448 82 Good
Ports 3,702 10 Excellent
Shipping Routes 8,273 1 Excellent
Railways 496,808 52 Excellent
Power Stations 28,664 1 Good
Population Centres 13,229 2 Excellent

Data must be downloaded and unzipped in a folder data/ in the main directory.



On a fresh linux install you will require the following:

sudo apt-get install python3-dev build-essential libspatialindex-dev openjdk-8-jre

We use conda for environment management. Create a new environment:

conda create -n ffsc python=3.8

Activate your conda environment:

conda activate ffsc

Clone and change directory into this repo:

git clone
cd global-fossil-fuel-supply-chain

Install pip package manager to the environment if it isn't already:

conda install pip

Install the project packages. Conda is used to install geospatial packages with c binary dependancies:

pip install -r requirements.txt
conda install -c conda-forge --file conda_reqs.txt

Environment Variables

Save the environment variables we need in activation and deactivation scripts in the conda environment. Follow the conda instructions for your os, and adapt the following:

mkdir -p ./etc/conda/activate.d
mkdir -p ./etc/conda/deactivate.d
touch ./etc/conda/activate.d/
touch ./etc/conda/deactivate.d/

edit ./etc/conda/activate.d/ as follows:

export USE_PYGEOS=1
export NUMEXPR_MAX_THREADS=24 # or something suiting your resources

edit ./etc/conda/deactivate.d/ as follows:



Save and close both files.

Community Detection

Clone the DirectedLouvain repository

git clone

Enter the repository and run the MakeFile

cd DirectedLouvain


We use PyPy to significantly speed-up dijkstra minimum-cost path search. PyPy uses a just-in-time compiler to significantly speed-up Python code execution. Download the correct version of PyPy to bin/.

(Optional) Neo4J Database

  1. Note if ssh tunnelling you will need to redirect port 8678 and 8888
  2. Install neo4j server. We use Neo4j 3.5 in our experiments, but everything described here should also work with Neo4j 4.0


Running the computational pipeline

The main pipeline entrypoint is The commands available to can be found with:

python --help

The following top-level commands are available: network-assembly,solve-flow,shock-analysis, and visualisation.

The pipeline makes extensive use of Kedro, which is a computational graph manager. Kedro uses of a data catalog, which is here: conf/base/catalog.yml. The catalog can also be used in other scripts and environments:

from import DataCatalog
import yaml

catalog = DataCatalog(yaml.load(open('/path/to/conf/base/catalog.yaml','r'),Loader=yaml.SafeLoader))
dataframe = catalog.load('<dataframe-key>')

Each pipeline is a computational graph with computation nodes and dataset edges, creating a version-controlled reproduceable workflow from raw data through to analysis. Computation nodes are labelled with tags so the pipeline can be run one-node-at-a-time, if desired. The computational graph for the network-assembly pipeline is shown in the figure below. Each pipeline can be run using:

python <pipeline-command> --tags=<list,of,comma-separated,tags>

Tags are nested such that top-level tags will execute a while pipeline step, and nested tags will execute substeps for certain asset types or energy carriers.

Figure A-1: Network assembly computational graph Computational graph

Assembling the infrastructure network

This pipeline assembles the asset-level infrastructure network. It can be run with python network-assembly. A comma-separated list of --tags can also be passed. Passing --help produces the following documentation:

Usage: network-assembly [OPTIONS]

Assemble the basic network from asset-level data. See for detailed tags.

--preprocess : Preprocessing and homogenisation of all raw asset data.
--prep       : Geospatial preparation operations on all data.
--sjoin      : Spatial join operations matching linear and point assets.
--flmile     : First- and last-mile matching operations to gapfill missing data.
--explode    : Geospatial post-processing of joining and matching.
--simplify   : Simplification operations to reduce the number of nodes.

--tags TEXT  Optionally specify any individual node tags you want to run in
           a comma-separated list.

--help       Show this message and exit.

Solving energy flow on the network

This pipeline calculates asset-level energy flow through the network, from energy sources (i.e. coalmines, and oil and gas fields and wells) through to energy sinks (population centres and powerstations). It can be run with python solve-flow. A comma-separated list of --tags can also be passed. Passing --help produces the following documentation:

Usage: solve-flow [OPTIONS]

Assemble the basic network from asset-level data. See,, and for detailed tags.

--flow_edges           : Prepare network edges dataframe.
--flow_nodes           : Prepare network nodes dataframe.
--flow_nx              : Test network connectivity and prepared for flow calculations.
--community-prep       : Prepare to add communities to network.
--community-run        : Run community detection algorithm.
--community-post-nodes : Post-process community detection onto node dataframe.
--community-post-edges : Post-process community detection onto edge dataframe.
--dijkstra-pickle      : Pickle edges in preparation for dijkstra mincost path.
--dijkstra-paths       : Run async dijkstra mincost path.
--dijkstra-adj         : Post-process dijkstra to mincost adjacency matrix.
--dijkstra-flow        : Solve flow using iterative cost-scaling.

--tags TEXT  Optionally specify any individual node tags you want to run
--help       Show this message and exit.

Analysing demand and supply shocks

The energy infrastructure network can be treated with demand and supply shocks. Flow can be recalculated to see the effect of the shocks on asset-level energy flow and costs. The pipeline can be run with python shock-analysis. A comma-separated list of --tags can also be passed. Passing --help produces the following documentation:

Usage: shock-analysis [OPTIONS]

Prepare demand and supply shock analysis. See for detailed tags.

--sds_counterfactual       : Prepare Sustainable Development Scenario demand shock analysis.
--supply-interdiction      : Prepare supply interdiction shock analysis.
--post-supply-interdiction : Post-process supply interdiction shock analysis.

--tags TEXT  Optionally specify any individual node tags you want to run
--help       Show this message and exit.

Visualising the data, flow, and analysis

The asset-level data can be visualised on a world map, and scaled and colored by the amount of energy flow passing through each asset. The pipeline can be run with python visualisation. A comma-separated list of --tags can also be passed. Passing --help produces the following documentation:

Usage: visualisation [OPTIONS]

Prepare visualisation of assets, flow, and demand shock counterfactual.
See for detailed tags.

--visualise-assets      : Visualise all assets.
--visualise-iso2        : Add iso2 country codes to dataframes.
--visualise-trade-prep  : Prepare trade dataframes for comparison.
--visualise-trade       : Visualise actual trade and production vs simulated.
--visualise-flow        : Visualise energy flow.
--compare-flow          : Compare energy flow to SDS demand shock energy flow.

--tags TEXT  Optionally specify any individual node tags you want to run
--help       Show this message and exit.

Importing files into Neo4j

  1. Make sure Neo4j is shut down. The installer might start up neo4j under a different user (e.g. Neo4j). In this case, you might want to find the process under which Neo4j runs using sudo ps -a | grep neo4j. Find the PID of the process and kill it using sudo kill.
  2. As Neo4j's files may be restricted, you want to do the next steps as root.
  3. Delete Neo4j's data folder from the old database. On Linux, this is stored under /var/lib/neo4j/data.
  4. Import the data by executing the bin/ script, which you can find under src/neo4j_commands in this repository.
  5. After the import is complete, restart Neo4j using neo4j start


The global fossil fuel supply chain, mapped at the asset-level.







No releases published


No packages published