:sparkler: Network/Graph Analysis with NetworkX in Python. Topics range from network types, statistics, link prediction measures, and community detection.
Graph Analysis with NetworkX
The environment.yml
YAML file in the root folder has the exact conda environment I used for this project.
The requirements.txt
text file in the root folder has the exact Python environment I used for this project.
Option 1: Run below with conda to create a new environment to have the exact same environment I used for running the notebooks:
conda env create -f environment.yml
will create a conda environment called network_analysis
.
Then, you can run conda env list
to view your existing environments.
You can run conda activate network_analysis
to use the new environment.
Option 2: If you don't want to use conda to create a environment, you can try install Python packages I used with the following command:
pip install -r requirements.txt
Click here to see the notebook
This notebook covers how to create the following graphs using NetworkX:
Click here to see the notebook
This notebook covers how to create visualization using the spring layout in NetworkX for Genshin Impact character network:
Click here to see the notebook part 1
Notebook 3 part 1 covers how to calculate and interpret graph statistics for the following topic:
Click here to see the notebook part 2
Notebook 3 part 2 covers how to calculate and interpret graph statistics for the following topic:
Click here to see the notebook part 3
Notebook 3 part 3 covers how to calculate and interpret graph statistics for the following topic:
Click here to see the notebook part 1
Notebook 4 part 1 covers how to calculate and interpret the below common link prediction features:
Click here to see the notebook
Notebook 5 covers how to use implemented community detection algorithms in NetworkX, python-louvain, and leidenalg
Click here to see the notebook
Stanford Network Analysis Project dataset is used for comparing performance: DBLP collaboration network
node total | edge total | Average clustering coefficient |
---|---|---|
317,080 | 1,049,866 | 0.6324 |
Notebook 6 compares the community detection results using Louvain and Leiden algorithms in open source Python package called python-louvain and leidenalg. The notebook will highlight the disadvanatge sof Louvain algorithm and demonstrate why Leiden may be the algorithm you want to use for community detection.
Louvain | Leiden | |
---|---|---|
Modularity | 0.821751 | 0.830028 |
Louvain | Leiden | |
---|---|---|
Disconnected Community | 5 | 0 |