diff --git a/2022-round-1/Lukong123/nx_notebook.ipynb b/2022-round-1/Lukong123/nx_notebook.ipynb new file mode 100644 index 0000000..1eed685 --- /dev/null +++ b/2022-round-1/Lukong123/nx_notebook.ipynb @@ -0,0 +1,201 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 11, + "metadata": {}, + "outputs": [], + "source": [ + "import networkx as nx\n", + "import matplotlib.pyplot as plt" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Creating a random erdos renyi graph" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": {}, + "outputs": [], + "source": [ + "n = 100 # nodes = 100\n", + "p = 0.3 # edge probability = 0.3\n", + "G = nx.erdos_renyi_graph(n, p)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plotting a degree centrality distribution histogram of the degree centrality values" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAYD0lEQVR4nO3de7RkZXnn8e/D/S6NnDCAQCsiCswSnB504o0sUG4KuEyiEBWMTgMDkSyYpQQ1IagRMyomMw4IgQDekEQZMRAjEi7DaKuNEuS6uLVI20BzMTSCyOWZP973QFmcOlXnnDqnztv9/axVq3ft67Pfvfev9qXqdGQmkqT2rDXqAiRJ02OAS1KjDHBJapQBLkmNMsAlqVEGuCQ1ygBfjUXEuRHx8dr9+oi4dY6Wu3NEXBcRqyLiA3OxzOmKiCMi4ppR1zFdEXFGRHx01HXAb+9vQ5znpPttRCyMiIyIdYa53FaMNMAjYllEPF4P9F9GxPci4qiIaOKDJSI2i4jPRcTdEfFoRNxR3285hHkvi4h9hlEnQGb+38zcebbm3+W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cY9TrNcRssANav3VsCtzHBw54WXgO2w04d3W8FltbuXfntB1d30uZDzJm0wdj4OlMe/i1v8XgYtB26xr+S5x5izpt9Ydb/GuGoZY+f/EfEKZQd82LK7YJNgH+ICIC7M/OgzHwoIj5G+bsvAKdk5kMjWI0ZmUkbAK8AvhARz1Cu2E7NzJtGsiIzNGA7HFuvRJ4EHgYOr9PeGBEXAjcBTwHHZObTI1mRGZhJGwBvAE6JiCeBZ4CjWjweYOB26DXtvNkX/Cm9JDVqTbgHLkmrJQNckhplgEtSowxwSWqUAS5JjTLAJalRBrgkNer/A0r0VpJ7EIVMAAAAAElFTkSuQmCC", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "deg_centrality = nx.degree_centrality(G)\n", + "plt.hist(list(deg_centrality.values()))\n", + "plt.title('Degree Centrality of an erdos renyi graph with p = 0.3')\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAATMElEQVR4nO3df7BkZX3n8fdHiRoFk8G5UgSV8QeoYEqsTMhmJdEENiFggpQpC7JxicEdsxtc3c1WnNJsQhJjJlaiu1uxYjCyjImauFFLDMYNIQaCitnBRWBAg8AYGBAG0TgIiyt+949zLnSufW/3vd339jw971dV1z19znPOeZ4+M5/79HN+3FQVkqT2PGrWFZAkrY0BLkmNMsAlqVEGuCQ1ygCXpEYZ4JLUKANcB60kFyV5Uz/9Q0k+v8H7X3GfSbYkqSSHbGS91A4D/ACWZE+SB5LsT/LVJJ9M8gtJmjhuSZ6Y5L8m+cck9yW5uX+/eQrb3pPklGnUE6Cq/q6qn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g2dwczxHtXP3xrKrmX3QnUW8GngE8BvgscNySMj8H/P6QdQ8Hbul/buqnN826TdNuZ7/svlm3YYrtPAb4P4vHCnjynB7Poe2ct+O5pPxr6C6KmLvjuVw713o856UHPslt/T8OXFpV91bVV4BLgVPXqZ6TOlgeXzBOO/8t8Pb+mFFVd/fz5+14LtfOlqz23+3ZwPv66Xk7noMG27km8xLgw27rP2pIuZcluTbJnydZvAlp3HUPBJO0E+BxSXYluSrJS9ezohMap53HAscm+UTfnlNXse6BYpJ2wnwdTwCSHA08Hfib1a57AJiknbCG43kw/VHjjwDvq6oHk7wa2An86IzrtB5WaufRVbU3yTOAv0lyXVXdPLOaTuYQuuGFF9PdBXxFku+daY3Wx9B2VtVXma/juegs4M+r6qFZV2SdDWvnqo/nvPTAR97WX1VfrqoH+7d/BHzfuOseQCZpJ1W1t/95C/C3wAvWs7ITGOeY3A5cXFX/r6puBf6BLujm6niyfDvn7XguOot/Pqwwb8dz0dJ2ru14znrgf0onDw6hO7nxdB45eXD8kjJHDkyfCVxVj5wkuZXuBMmmfvrwWbdpHdq5CXhsP70ZuIkVTrA00M5TgZ0D7bkNeNIcHs/l2jlXx7Mv9xxgD/0Nhv28uTqeK7RzTcdz5o2e4od3Gl3v5Gbgjf283wB+qp/+bWB3/6F+HHjOwLo/D3yhf71y1m1Zj3YC/xK4rp9/HXDurNsyYTsDvBW4oW/PWXN6PIe2c96OZ//+fGDHkHXn5ngu1861Hk9vpZekRs3LGLgkHXQMcElqlAEuSY0ywCWpUQa4JDXKAJekRhngktSo/w/keiL0VneazgAAAABJRU5ErkJggg==", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "n = 100 # nodes = 100\n", + "p2 = 0.6 # edge probability = 0.6\n", + "G2 = nx.erdos_renyi_graph(n, p2)\n", + "deg2_centrality = nx.degree_centrality(G2)\n", + "plt.hist(list(deg2_centrality.values())) # plotting a hsitogram for the degree centality\n", + "plt.title('Degree Centrality of an erdos renyi graph with p = 0.6')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### why does the degree centrality distribution change.\n", + "What is degree centrality? \n", + "The degree centrality is the number of neighbors divided by all possible neighbors that it could have. Depending on whether self-loops are allowed, the set of possible neighbors a node could have could also include the node itself.\n", + "\n", + "The nx.degree_centrality(G) function returns a dictionary, where the keys are the nodes and the values are their degree centrality values.\n", + "\n", + "The difference between the two graphs above is as a result to their difference in ** edge probability **\n", + "#### Observation\n", + "The frequency of the first histogram(0.3) looks higher than that of the second histogram (with edge probability = 0.6)\n", + "\n", + "#### Conclusion\n", + "The higher to edge probability the more likely it is to include graph with more edges adn the less likely it is to include graph with fewer edges." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Creating a Barabasi Albert Graph" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": {}, + "outputs": [], + "source": [ + "n = 100 # n = 100 \n", + "m = 3 # edges = 3\n", + "BG = nx.barabasi_albert_graph(n, m)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Plotting the degree centrality of a barabasi albert graph" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": {}, + "outputs": [ + { + "data": { + "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAEICAYAAABGaK+TAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAX7UlEQVR4nO3deZRcZZ3G8e9jQtgMJCFNTkiUBkEUcACnRRk3NCibEjwiwogGiCfuy6gH4u44OsY5joLjKEZRGnAhokhwQUIAHRfARiNbVCAmkJCliQlEUDDwmz/u21KpVHXd7q6lX/r5nNOn735/9623nr51b1WXIgIzM8vPkzpdgJmZDY8D3MwsUw5wM7NMOcDNzDLlADczy5QD3MwsUw5wazpJF0j6RBp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bERICJuorhm9vSWV9waI/n3B0+Uf50wouOIiDXp9wrgOuCwZhbXRqXaQdJRwAeBEyLi4aGsm4GRtMHo6Audvgjfjh+KVxorgH14/GbFQVXLvI1tb2IuSsNdwLg0vC/FAzyl08fUqnaoWPYCtr+J+SeKm1aT03B27TDCNpgM7JiGpwJ3UHXTK5efks+JwyhOWPavmj5m+sIgbTAq+kLHG7GND9ZxwB/Tg/HBNO3jFH9VAXYCvgPcCdwI7Jumvxq4DVgG/AZ4ZaePpcXt8ByKa4EPAhuB2yrWPTO1z53AGZ0+lna3AfAvwC3piX4LMLfTx9LidrgaWJ/6/jJg8RjsCzXbYLT0BX+U3swsU2PlGriZ2ROOA9zMLFMOcDOzTDnAzcwy5QA3M8uUA9zMLFMOcDOzTP0/v6d9TureDdIAAAAASUVORK5CYII=", + "text/plain": [ + "
" + ] + }, + "metadata": { + "needs_background": "light" + }, + "output_type": "display_data" + } + ], + "source": [ + "b_deg_centrality = nx.degree_centrality(BG)\n", + "plt.hist(list(b_deg_centrality.values()))\n", + "plt.title('Degree Centrality of a barabasi albert graph')\n", + "plt.show()" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Difference between the degree centrality of Erdos Renyi grah and Barabasi Albert graph.\n", + "\n", + "#### Observation\n", + "From the histogram of the different random graph, it is obvious that the Erdos Renyi Graph has more nodes which have a higher degree centrality value and for the Barabasi Albert histogram there are only very few nodes with a high degree centrality value.\n", + "\n", + "#### Conclusion\n", + "In the Erdos Renyi netowrk, no one node will have much higher degree than any other because nodes are assigned and each pair is connected with probability.\n", + "\n", + "\n", + "While for Barabasi Albert graph, nodes are equally assigned but, they are added one at a time. When a node is added it is connected to a small number of existing nodes with probability proportional to the degree of existing nodes as a result the earlier nodes tend to have a higher degree. This explains why the histogram here has a very few nodes with high degree centrality value \n" + ] + } + ], + "metadata": { + "interpreter": { + "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + }, + "kernelspec": { + "display_name": "Python 3.8.10 64-bit", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.8.10" + }, + "orig_nbformat": 4 + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/2022-round-1/Lukong123/nx_pull_requests.txt b/2022-round-1/Lukong123/nx_pull_requests.txt new file mode 100644 index 0000000..de90ded --- /dev/null +++ b/2022-round-1/Lukong123/nx_pull_requests.txt @@ -0,0 +1,4 @@ +https://github.com/networkx/networkx/pull/5471 +https://github.com/networkx/networkx/pulls/Lukong123 +https://github.com/networkx/networkx/pull/5485 +https://github.com/networkx/networkx/pull/5493