documentation of the project

main
Luca Lombardo 2 years ago
parent 25c1ab093b
commit 55911adcde

@ -4,7 +4,7 @@ The present repository showcases the implementation of an experimental examinati
---
Time spent one the project since the beginning of 2023 (add ~10 hours for a real estimate)
Time spent one the project since the beginning of 2023 (add ~20 hours for a real estimate)
[![wakatime](https://wakatime.com/badge/user/a3116382-7adb-43ba-9490-83130c4b22c5/project/3db09d02-0a29-49b1-9a39-08c74e3df4ce.svg)](https://wakatime.com/badge/user/a3116382-7adb-43ba-9490-83130c4b22c5/project/3db09d02-0a29-49b1-9a39-08c74e3df4ce)
@ -12,12 +12,11 @@ Time spent one the project since the beginning of 2023 (add ~10 hours for a real
## Documentation
### Notebook structure
The core component of the project is a Jupyter Notebook named `main.ipynb`. The notebook is comprehensive and provides ample information to comprehend the study and its results.
- The notebook commences with a theoretical background of the study, delving into the theory of random networks. The Erdős-Rényi and Watts-Strogatz models receive particular attention, as their properties form the basis of the study.
- The notebook starts with a theoretical background of the study, delving into the theory of random networks. The Erdős-Rényi and Watts-Strogatz models receive particular attention, as their properties form the basis of the study.
- Next, the experimental setup is presented. There is a detail description of the datasets, along with the methodology adopted for data extraction, transformation, and loading. In this section, the graphs are constructed from the raw data obtained from the datasets.
@ -30,31 +29,65 @@ The core component of the project is a Jupyter Notebook named `main.ipynb`. The
### Algorithms and functions implemented
In order to maintain a clean and organized notebook, we have integrated all algorithms and functions into the utils.py file. This module serves as a centralized repository of code and is imported into the notebook for use in the study.
In order to maintain a clean and organized notebook, I have integrated all algorithms and functions into the `utils.py` file. This module serves as a centralized repository of functions and is imported into the notebook for use in the study.
A thorough technical examination of the project requires a close examination of this file, as it holds nearly all the code utilized. Each function is accompanied by detailed documentation to ensure clear understanding and ease of use.
### External scripts
The computation of the omega coefficient, a crucial measure of the small-worldness of a network, serves as one of the most vital functions in this project. However, its application proves to be extremely slow, rendering its usage in the notebook inadvisable. To address this issue, I have developed a separate script, named `omega_sampled_server.py`. The script is intended for execution on a server machine, capable of handling the extensive processing demands for extended periods of time, to compute the omega coefficient for a specified graph.
The computation of the omega coefficient, a crucial measure of the small-worldness of a network, is one of the most vital functions in this project. However, its application proves to be extremely slow, rendering its usage in the notebook inadvisable. To address this issue, I have developed a separate script, named `omega_sampled_server.py`. The script is intended for execution on a server machine, capable of handling the extensive processing demands for extended periods of time, to compute the omega coefficient for a specified graph.
To run the script, execute the following command:
```bash
./omega_sampled_server.py graph --k --niter --nrand
```
Where:
- `graph` is the name of the graph
- `k` Percentage of nodes to be remove
- `niter` Number of rewiring operations per edge
- `nrand` Number of random graphs to be generated
For further details run `./omega_sampled_server.py --help`
#### Parallel version
However, the computation of the omega coefficient was still very slow. To speed up the process, I developed a parallel version of the script above, referred to as `omega_parallel_server.py`. This project required substantial effort as the parallelization of a function utilizing a random number generator is a complex task.
However, the computation of the omega coefficient was still very slow. To speed up the process, I developed a parallel version of the script above, called `omega_parallel_server.py`. Its development required substantial effort as the parallelization of a function utilizing a random number generator is a complex task.
To run the script, execute the following command:
```bash
./omega_sampled_parallel.py graph --k --niter --nrand --n_processes --seed
```
Where:
- `graph` is the name of the graph
- `k` Percentage of nodes to be remove
- `niter` Number of rewiring operations per edge
- `nrand` Number of random graphs to be generated
- `n_processes` is an argument that specifies the number of processes to be used
- `seed` is the seed for the random number generator
For further details run `./omega_sampled_parallel.py --help`
### Experimental
There is a repository named `experimental` that contains a number of scripts written in `C++` with the purpose of speeding up the computation of the omega coefficient. The scripts are not used in the project, but they are included for completeness. This scripts are not documented, not tested, and not guaranteed to work. I suggest to ignore them unless you are a C++ enthusiast that loves to read experimental code.
## Requirements
The project is written in Python 3.10.9, to install the required libraries run the following command:
The project has been developed in Python 3.10.9, to install the required libraries run the following command:
```bash
pip install -r requirements.txt
```
**NOTE**: I have no access to Windows or MacOS machines, so I cannot guarantee whether the project will function optimally on these platforms. Nonetheless, I have made a concerted effort to ensure broad compatibility by implementing the project in a manner that should allow for its seamless operation on any platform. All the test have been executed on a Arch Linux machine, with an AMD Ryzen 5 2600 processor and 16GB of RAM.
**NOTE**: I have no access to Windows or MacOS machines, so I cannot guarantee whether the project will function optimally on these platforms. However, I have made a concerted effort to ensure broad compatibility by implementing the project in a manner that should allow for its seamless operation on any platform. All the functions have been test on a Arch Linux machine, with an AMD Ryzen 5 2600 processor and 16GB of RAM. The version of Python used is 3.10.9.
### Experimental
There is a repository named `experimental` that contains a number of scripts written in `C++` with the purpose of speeding up the computation of the omega coefficient. The scripts are not used in the project, but they are included for completeness. This scripts are not documented, not tested, and not guaranteed to work. I suggest to ignore them unless you are a C++ enthusiast that loves to read experimental code.
## References

Loading…
Cancel
Save