You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note how all the observations collapse into $5$, then $4$, then $3$ dots. This suggests that at the very right of the plot, the giant component sizes are all between $n = 99,998$, $99,999$, or $100,000$. In fact, Erdős and Rényi also proved a second result saying that when $p(n-1) > \ln(n)$, the entire graph becomes "almost entirely connected" almost surely.^[Quoting [Barabási (2016) Section 3.6](http://networksciencebook.com/chapter/3#evolution-network), "In the absence of isolated nodes the network becomes connected."]
159
+
Note how all the observations collapse into $5$, then $4$, then $3$ dots. This suggests that at the very right of the plot, the giant component sizes are all either $99,998$, $99,999$, or $100,000$. In fact, Erdős and Rényi also proved a second result saying that when $p(n-1) > \ln(n)$, the entire graph becomes "almost entirely connected" almost surely.^[Quoting [Barabási (2016) Section 3.6](http://networksciencebook.com/chapter/3#evolution-network), "In the absence of isolated nodes the network becomes connected."]
160
160
161
-
Lastly, we can visualize $n = 1,000,000$, for which my simulations took a few hours:
161
+
Lastly, we can visualize $n = 1,000,000$, for which my simulations took several hours, mainly due to simulating $O(n^2)$ uniform numbers for the edges:
@@ -203,3 +203,5 @@ I also found [this post](http://kateto.net/2016/05/network-datasets/) by Ognyano
203
203
On the web, my favorite visualization that I found illustrating the giant component is [this one](https://cs4423.github.io/notes/2018/02/15/note10.html), done by [Professor Götz Pfeiffer](http://schmidt.ucg.ie/~goetz/) for CS4423 at the National University of Ireland, Galway. It's a beautiful [D3.js](https://d3js.org/) animation, and the code can be found online [here](https://github.com/cs4423/cs4423.github.io/blob/master/js/random.js).
204
204
205
205
**Acknowledgments.** As mentioned earlier, I was first exposed to the surprising critical behavior of random graphs during a lecture by Fiona Skerman in November 2017. In preparing this post, the `igraph` package and Ognyanova's tutorial proved very helpful. I am thankful to Juho Lee for introducing me to the paper on inhomogeneous random graphs. Finally, Ryan Lee and Ruth Fong provided useful feedback which influenced my final presentation.
206
+
207
+
***This blog post was generated from an R Markdown file using the `knitr` and `blogdown` packages. The original source can be downloaded [from GitHub](https://github.com/brianzhang01/brianzhang01.github.io/blob/master/post/2018-07-10-random-graphs-and-giant-components.Rmd).***
Copy file name to clipboardExpand all lines: content/post/2018-07-10-random-graphs-and-giant-components.html
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
---
2
2
title: Random Graphs and Giant Components
3
3
author: Brian Zhang
4
-
date: '2018-06-04'
4
+
date: '2018-07-10'
5
5
slug: random-graphs-and-giant-components
6
6
categories: []
7
7
tags: []
@@ -17,7 +17,7 @@ <h2>Introduction: random graphs</h2>
17
17
<p>Someone recently asked me at a pub what it takes to get a probability distribution named after you. Are new distributions still being discovered today?</p>
18
18
<p>I answered that we usually think of probability distributions as over the one-dimensional real line, for which most distributions have been with us for perhaps a century.<ahref="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> However, one can study the probability distributions of all sorts of abstract objects – from a deck of cards to randomly broken sticks – and many of these areas remain ripe for discovery.<ahref="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a></p>
19
19
<p>The field of random graphs is one such area. Recall from college-level math or computer science that an undirected graph is a collection of <em>vertices</em> (also called nodes), with some pairs of vertices connected by <em>edges</em>. (A depiction of an example graph is below.) Originally, those working in graph theory focused on proving many deterministic properties of graphs. For instance, let the <em>degree</em> of a vertex be the number of other vertices it is connected to. Then the <ahref="https://en.wikipedia.org/wiki/Handshaking_lemma">handshake lemma</a> says that the sum of all the degrees is always an even number (proof omitted here).</p>
<p>By contrast, the field of random graphs is interested in probabilistic properties of graphs given a random process for generating them. Here’s the simplest type of random graph that is studied. Fix a positive integer <spanclass="math">\(n\)</span> and a probability <spanclass="math">\(p\)</span> between 0 and 1. Given <spanclass="math">\(n\)</span> vertices, there are <spanclass="math">\(\binom{n}{2}\)</span> possible edges between them, so choose to connect each edge with independent probability <spanclass="math">\(p\)</span> (e.g. by flipping a biased coin <spanclass="math">\(\binom{n}{2}\)</span> times). Voilà! You have generated a random graph. As long as <spanclass="math">\(p\)</span> is not 0 or 1, this process can generate any undirected graph on <spanclass="math">\(n\)</span> vertices. However, some configurations will be more probable while others are less probable. This probability distribution over undirected graphs, or equivalently the generative process described, are called the Erdős-Rényi random graph with parameters <spanclass="math">\(n\)</span> and <spanclass="math">\(p\)</span>.<ahref="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a></p>
22
22
<p>Since each edge is sampled independently, we can derive a result on the total number of edges in the graph: it follows a <spanclass="math">\(\mbox{Binomial}(\binom{n}{2}, p)\)</span> distribution. Similarly, if we consider a single vertex, there are <spanclass="math">\(n - 1\)</span> possible edges that involve that vertex. Since each is sampled independently, the degree of each vertex follows a <spanclass="math">\(\mbox{Binomial}(n-1, p)\)</span> distribution. The expression <spanclass="math">\((n-1)p\)</span> will thus be the mean degree of a vertex.</p>
23
23
</div>
@@ -77,7 +77,7 @@ <h2>Simulations when <span class="math">\(n = 50\)</span> and <span class="math"
<p>In this case, the largest component size (marked out by orange in the visualization) shows a large jump when <spanclass="math">\(p(n-1)\)</span> goes from <spanclass="math">\(1.25\)</span> to <spanclass="math">\(1.50\)</span>. By the value <spanclass="math">\(3.25\)</span>, all vertices are part of one component.</p>
@@ -100,7 +100,7 @@ <h2>Simulations when <span class="math">\(n = 50\)</span> and <span class="math"
<p>In this case, the largest component looks relatively small when <spanclass="math">\(p(n-1) < 0.75\)</span>, and increases quickly in the range from <spanclass="math">\(1\)</span> to <spanclass="math">\(3\)</span>.</p>
@@ -116,8 +116,8 @@ <h2>Simulations for large <span class="math">\(n\)</span></h2>
<p>We can also zoom in on the region leading up to <spanclass="math">\(p(n-1) \approx \ln(n)\)</span>, which in the case of <spanclass="math">\(n = 10,000\)</span> is about <spanclass="math">\(9.2\)</span>.</p>
<p>Note how all the observations collapse into <spanclass="math">\(5\)</span>, then <spanclass="math">\(4\)</span>, then <spanclass="math">\(3\)</span> dots. This suggests that at the very right of the plot, the giant component sizes are all between<spanclass="math">\(n = 99,998\)</span>, <spanclass="math">\(99,999\)</span>, or <spanclass="math">\(100,000\)</span>. In fact, Erdős and Rényi also proved a second result saying that when <spanclass="math">\(p(n-1) > \ln(n)\)</span>, the entire graph becomes “almost entirely connected” almost surely.<ahref="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
120
-
<p>Lastly, we can visualize <spanclass="math">\(n = 1,000,000\)</span>, for which my simulations took a few hours:</p>
119
+
<p>Note how all the observations collapse into <spanclass="math">\(5\)</span>, then <spanclass="math">\(4\)</span>, then <spanclass="math">\(3\)</span> dots. This suggests that at the very right of the plot, the giant component sizes are all either<spanclass="math">\(99,998\)</span>, <spanclass="math">\(99,999\)</span>, or <spanclass="math">\(100,000\)</span>. In fact, Erdős and Rényi also proved a second result saying that when <spanclass="math">\(p(n-1) > \ln(n)\)</span>, the entire graph becomes “almost entirely connected” almost surely.<ahref="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
120
+
<p>Lastly, we can visualize <spanclass="math">\(n = 1,000,000\)</span>, for which my simulations took several hours, mainly due to simulating <spanclass="math">\(O(n^2)\)</span> uniform numbers for the edges:</p>
@@ -142,6 +142,7 @@ <h2>Conclusion and Bibliography</h2>
142
142
<p>I also found <ahref="http://kateto.net/2016/05/network-datasets/">this post</a> by Ognyanova interesting, on some actual network datasets. It could be a good place to start with real network analysis!</p>
143
143
<p>On the web, my favorite visualization that I found illustrating the giant component is <ahref="https://cs4423.github.io/notes/2018/02/15/note10.html">this one</a>, done by <ahref="http://schmidt.ucg.ie/~goetz/">Professor Götz Pfeiffer</a> for CS4423 at the National University of Ireland, Galway. It’s a beautiful <ahref="https://d3js.org/">D3.js</a> animation, and the code can be found online <ahref="https://github.com/cs4423/cs4423.github.io/blob/master/js/random.js">here</a>.</p>
144
144
<p><strong>Acknowledgments.</strong> As mentioned earlier, I was first exposed to the surprising critical behavior of random graphs during a lecture by Fiona Skerman in November 2017. In preparing this post, the <code>igraph</code> package and Ognyanova’s tutorial proved very helpful. I am thankful to Juho Lee for introducing me to the paper on inhomogeneous random graphs. Finally, Ryan Lee and Ruth Fong provided useful feedback which influenced my final presentation.</p>
145
+
<p><strong><em>This blog post was generated from an R Markdown file using the <code>knitr</code> and <code>blogdown</code> packages. The original source can be downloaded <ahref="https://github.com/brianzhang01/brianzhang01.github.io/blob/master/post/2018-07-10-random-graphs-and-giant-components.Rmd">from GitHub</a>.</em></strong></p>
0 commit comments