This was one of my problem sets about the library networkx in ptython. This library is used to work with graphs that is used in network science.
This is a jupyter notebook, so in order to run this code you need to open it in google collab or jupyter notebook. In this problem set, I made some subgraphs and some projected graphs from the main graph of the problem. Also, I calculated the Pearson correlation, which indiactes the linear relationship of two variables. Furthermore, I generated a graph representing random walk.
Link to graph theory wikipedia
Link to Pearson correlation coefficient wikipedia
Link to Random Walk wikipedia
In this code I have used the following libraries:
networkx
, pandas
and numpy
You can easily install thesse libraries by the following command:
pip install [name of the library]
I hope you can use these examples to get familiar with networkx library.
Graph of the employees and their favorite movie:
A projected graph:
Graph of the random walk: