New app on Play Store: G(n,p) random graphs!

Seasoned readers of this blog already know the ins and outs of the Erdős–Rényi random graph model. They have probably read the introductory blogpost, have doodled and ruminated about them in class, and have dreamt about them frequently, if not constantly. But until now, they have not had the pleasure of sharing their fresh-from-the-oven random networks with their peers via a designated smartphone app, whose sole purpose is to draw samples of G(n,p) of various shapes and sizes.

Well, this dry and dull era has now come to an end. I am happy to announce that a new Android app is now available on Google PlayStore: The G(n,p) random graph app!

Quoting from the app listing on the PlayStore:

With the G(n,p) random graph app, you can finally create and draw Erdős–Rényi graphs at the click of a button, all from the palm of your hand! Impress your family, amaze your friends and daze your enemies as you switch between colors and layouts, flaunting graphs with hundreds of nodes and thousands of edges.

Features:

  • Three different layouts: circular, spring, and random.
  • Color selection for edges and vertices.
  • Support for any edge-probability between 0 and 1.
  • All our graphs are guaranteed connected with high probability (when p > \frac{(1+\varepsilon)\log(n)}{n} asymptotically).

The model:

In the G(n,p) random graph model, first invented by Paul Erdős and Alfréd Rényi, n vertices are connected to each other via edges, where each pair of vertices is connected independently with probability p . It is one of the simplest random graph models, yet shows many interesting phenomena.
For more information, see:
https://sarcasticresonance.wordpress.com/2017/07/09/random-graphs-the-erdos-renyi-gnp-model or your standard textbook on combinatorics and random graphs.


You may be wondering why I did this.

Well, first and foremost, a quick search shows that the PlayStore is completely devoid of random-graph drawing apps, be they Erdős–Rényi, exponential random graphs, or duplicubes. This is “money on the floor”, as the Hebrew saying goes (the app is, naturally, non-monetized; in fact, I have made it publicly available on my git repository. But I’m sure some of you could think of a business model for these things).

But the real reason was actually a query to this very website. The WordPress hosting site lets me see a limited number of search queries which brought users to the blog. The most popular one, with more than 750 queries is (it almost goes without saying) “ixxx”, which leads to an old satirical article about iphones. But about four years ago, a single, isolated query caught my eye: someone had searched for “random graph gnp app”. Such a queer query. It had stayed with me at the back of my mind all these years, and whenever I had some free time, I thought to myself “perhaps now would be a good chance to learn some Android development”. Most of the time, it wasn’t. But patience is a virtue, and good things come to those who wait. Whoever and wherever you are, seeking stranger, I hope my app meets your expectations.


5 thoughts on “New app on Play Store: G(n,p) random graphs!

  1. Thanks! I am enjoying the app and left a five-star review.

    I would find it more interesting if it could report how many components the graph has, whether it has an isolated vertex, a triangle, etc. (I am a reasonable person and will not demand that the app report whether the graph has a Hamiltonian cycle.)

    Seriously, would you consider adding this feature? Also maybe a slider for the $p$ parameter?

    1. I’m glad you like it!

      I can add a button which pops up a page with graph statistics. Does that seem reasonable? Write me a list of all statistics you’d like (either here or to my email), and I’ll see what I can do (including adding my own).
      (Regarding Hamiltonian cycles: in the worst case, if there is a very large demand, the app can always take an educated guess: for small graphs it’s probably possible to check if there exists a cycle, and for large graphs there is a sharp threshold result: G(n,p) contains a cycle with high probability if and only if p > log(n)/n, so the user would need to choose a very particular value of p in order to fool the app (approximately; see “Limit distribution for the existence of Hamiltonian cycles in a random graph” by Komlós and Szemerédi))

      Regarding slider: I’m not sure a slider is the right UI choice. When n is large you would need infinitely many ticks near 0 to get sparse graphs. You can consider a logarithmic slider, but then you would need special care for smoothing the ticks for larger values, and I preferred not to go into this. Actually, my original idea was to have p accept equations in n as well, so you could write things like “log(n)/n”, but that’s quite another rabbit hole.

Leave a comment