Erdős-Rényi Graphs

How to model random networks

The Erdős-Rényi model is a simple way to generate random graphs. The model, named after Hungarian mathematicians Paul Erdős and Alfréd Rényi, is useful for simulating and analyzing the properties of random networks, which can be compared to real-world phenomena like social networks, communication networks, and biological networks.

The model comes in two variants:

  1. : start with nodes and then connect each pair of nodes (create an edge between them) with a probability , independent of all other pairs.
  2. : start with nodes and randomly select edges (from all possible edges) to connect the nodes. Useful for generating graphs with a specific number of edges.

Below is a Erdős-Rényi graph generator for the model:


If you liked this and would like to hear when new content is published, please subscribe below.

If you have any feedback, found bugs, or just want to reach out, feel free to DM me on Twitter or send me an email.

Subscribe to Newt Interactive

You'll only get emails when I publish new content. No spam, unsubscribe any time.