This folder contains the R scripts needed to reproduce the simulations presented in the paper
``Model-based clustering for populations of networks'' (Signorelli and Wit, 2019).

Folders simA, simB, ..., simL contain the code specific to each simulation presented in the paper.
The code to run each simulation is divided into R scripts that are sequentially numbered according to the following conventions:
1) scripts whose name starts with 1 generate the data;
2) scripts whose name starts with 2 compute the Expectation-Maximization algorithm for all subcases and repetitions considered (this may in some cases be time consuming, so we provide an implementation that allows to easily perform parallel computing);
3) scripts whose name starts with 3 further process the output of (2) to generate the results presented in the paper (with the exception of simulation J, where first model selection is performed in script 3 and then the results are produced in script 4).

The folder functions-to-source, instead, contains scripts that are common to several simulations and that are sourced in scripts 1A, 1B, ..., 2A, 2B, ...