Package: nestmodel
Neighborhood Structure Configuration ModelNeighborhood Structure Configuration Models (short NeSt-models) allow to generate random graphs that preserved the neighborhood structure of a given graph for arbitrary depth d.This package provides the implementation as used in our paper.Installation instructionsYou can install this library like any other python package, depending packages are also installed along with it.Installing nestmodelNestmodel is available on pypi thus you can simply install it via:pip install nestmodelInstalling nestmodel from sourcegit clone https://github.com/Feelx234/nestmodel.git
pip install nestmodelThe installation should take less than a minute.
If you also want to notebooks in the scripts folder please installjupyteras outlined below.pip install jupyterMaking sure the installation went smoothlyTo make sure the installation has succeeded we need to install pytest as well and then run the testspip install pytest
python -m pytest nestmodelIf you do not have the graph tools library installed, the tests will emit a warning that it is not installed which can be ignored for now.Reproducing the results from the paperBefore reproducing the results you need to get thedatasets. We provide a download script/scripts/get_datasets.pywhich will download all datasets for you.cd nestmodel
python ./scripts/get_datasets.pyTo reproduce the results from the paper we provided different scripts. The detailed convergence results on HepPh are available in/scripts/convergence2_example.ipynb.
This file can be opened in jupyter and should work out of the box.The convergence results in sum absolute error (SAE) can all be produced by usingpython ./scripts/convergence2_runner.py -allThe runtime of this script is about 1 day.
The script will first convert the notebook files into.pyfiles and then run tests on the karate network which will only take about 1 min.
Once the script is run, plots can be created by opening theconvergence2_plot.ipynbfile in jupyter. The plot file requires the time of completion for the different centrality calculations which can be read of from the result files which appear in./scripts/results/and are also stored in a file:./scripts/convergence2_run_results.txt.If you are interested in convergence results for individual centralities you can also checkout any of the./scripts/convergence2_XXXXX.ipynb(for example./scripts/convergence2_pagerank.ipynb) in jupyter.The runtime results comparing NeSt with ERGM and Erdös Renyi models can be reproduced usingpython ./scripts/Baselines.ipynbNotice that the runtime of the Baselines file for the phonecalls isseveral daysbecause the ERGM is so slow! The baseline results can be visualized in the./scripts/Baselines_plot.ipynbnotebook.System requirementsThe package should run on any modern standard computer.Software requirementsOS RequirementsThis package has been tested onLinux.Python DependenciesThe package was tested with various version of python (>=3.8). It depends on other packages that are automatically installed along with nestmodel and can be looked up at the setup.py file.
Parts of it also depend on the just-in-time compilernumbawe used version 0.56.4 but should work on other versions as well.