{ "metadata": { "name": "", "signature": "sha256:091fc047f63fa27588b7f3e34807813f5777dc3a6149339808207cf2ae517367" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Network Models: Random Graphs" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "plt.xkcd()\n", "import networkx as nx\n", "%matplotlib inline" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Clustering coefficient" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "During the lecture we have understood, that the clustering coefficient of a random graph is equal to the probability $p$: $$\\text{Clustering coefficient} = \\frac{\\langle k \\rangle}{n} = p $$\n", "\n", "In this task you have to check it on generated data.\n", "Please, generate $100$ Random Graphs with $n = 1000$ and $p = 0.002$ (for saving computational time) and plot the box-plot of your computations." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Put your code here" ], "language": "python", "metadata": {}, "outputs": [] }, { "cell_type": "heading", "level": 3, "metadata": {}, "source": [ "Size of small components" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "In this task you are asked to calculate the average size of small components (small component = not a giant one) with regard to average degree of the network. To see the effect clearly, plot average size around $\\langle k \\rangle = 1$." ] }, { "cell_type": "code", "collapsed": false, "input": [ "# Put your code here" ], "language": "python", "metadata": {}, "outputs": [] } ], "metadata": {} } ] }