These are the experiments for the paper "Robust Parameter Fitting to Realistic Network Models via Iterative Stochastic Approximation".
Additional data can be found at https://doi.org/10.5281/zenodo.10629451.
- Make sure you have Python, Pip and R installed.
- Checkout this repository
- Install the python dependencies with
pip3 install -r requirements.txt
-
Install the
pygirgs
package at https://github.com/PFischbeck/pygirgs -
Install the R dependencies (used for plots) with
R -e 'install.packages(c("ggplot2", "reshape2", "plyr", "dplyr", "scales"), repos="https://cloud.r-project.org/")'
- Download the file
konect-data.zip
from Zenodo and extract its contents into the folderinput_data/konect
- Optional: Download the file
output-data.zip
from Zenodo and extract its contents into the folderoutput_data
. This way, you can access all experiment results without running them yourself.
- The folder
input_data
contains all networks used (KONECT) and generated (by random network models). - The folder
output_data
contains all data and figures generated by the experiments. - The files
experiments-*.py
are used for executing the Python experiments. - The folder
R
contains R scripts for generating the plots. - The folder
plots
contains all plots generated by the R scripts.
- Execute
python3 experiments-models.py <experiment_name>
to run experiments related to the models. The different experiments are as follows:- For some
<model>
in"erdos-renyi", "chung-lu-pl", "girg-1d"
, run:sample_and_measure_<model>
to sample from the model and measure the resulting feature valuesfit_parameters_<model>
to fit the parameters via the ParFit algorithmfitted_sample_and_measure_<model>
to sample and measure features based on the fitted parameters
merge_csv
to merge all files for further processing in R
- For some
- Execute
python3 experiments-konect.py <experiment_name>
to run experiments related to the real-world networks. The different experiments are as follows:clean_graphs
to convert each real-world network to its largest component and convert the formatmeasure_target_features
to measure the target features for every real-world network- For some
<model>
in"erdos-renyi", "chung-lu-pl", "girg-1d"
, run:fit_parameters_<model>
to fit the parameters via the ParFit algorithmfitted_sample_and_measure_<model>
to sample and measure features based on the fitted parameters
merge_csv
to merge all files for further processing in R
- Execute
python3 experiments-ablation.py <experiment_name>
to run experiments related to the ParFit configuration (i.e., alpha and threshold values). The different experiments are as follows:- For some
<model>
in"erdos-renyi", "chung-lu-pl", "girg-1d"
, run:fit_parameters_alpha_<model>
to fit the parameters via the ParFit algorithm (for alpha experiments)fit_parameters_threshold_<model>
to fit the parameters via the ParFit algorithm (for treshold experiments)fitted_sample_and_measure_alpha_<model>
to sample and measure features based on the fitted parameters (for alpha experiments)fitted_sample_and_measure_threshold_<model>
to sample and measure features based on the fitted parameters (for threshold experiments)
merge_csv
to merge all files for further processing in R
- For some
Run Rscript R/<scriptname>
to run R scripts, found in the R
subfolder. For example, run Rscript R/erdos-renyi-ablation-alpha.R
to generate figures and tables related to the effect of the alpha configuration of ParFit for the ER model. The resulting figures and tables can be found in output_data/figures
.