This code accompanies the publication that can be found at ArXiv: 2105.06687.
Community structures represent an important feature of networks. In the connected publication and also this code, we introduce a different class of communities: dual communities. Dual communities arise naturally in optimized network structures.
They shape, similarly to the conventional communities (i.e. primal communities), important network features such as robustness.
This code was developed with python 3.10
and by using conda as an environment management system.
The requirements can be found in requirements.txt
.
To setup the exact conda environment in the path=<path>
that was used in developing this code, you can use the dual_env.yml
file and activate it.
usr@machine:~$ conda env create --prefix=<path> -f dual_env.yml
usr@machine:~$ conda activate <path>
Since the code uses sagemath for the conversion of graphs to dual graphs, it needs to be run in the sage console instead of the more common python
or ipython
-consoles.
The basic usage for a few examples can be found in the jupyter-notebook examples.ipynb. Just run
(dual_env)usr@machine:~$ jupyter notebook
in your shell with the the activated conda environment and open the examples.ipynb
.
The scripts found in dual_communities/results can be used to reproduce the essential results presented in the publication.
The scripts paper_data.py
and paper_plots.py
are meta scripts that collect data generation functions and plot functions, respectively.
The publication uses, in addition to the elementary example, graphs generated by two data sources.
-
Leaf venation networks which are available upon request from the authors of DOI: 10.1371/journal.pcbi.1004680.
-
The topology of the Central European grid was generated from PyPSA-Euro and is available at DOI: 10.5281/zenodo.3886532.
The raw and generated data can be found on Zenodo at DOI:10.5281/zenodo.7243771. This repository contains European power systems for different carbon reduction targets, preprocessed graphs describing the leaf venation networks and optimal networks with two fluctuating sources for different fluctuation levels. It also includes a snapshot of this github repository.
The main contributors of this code are Franz Kaiser and Philipp C. Böttcher.
This code is licensed under Attribution 4.0 International (CC BY 4.0) (see LICENSE for more details).