# File:Erdős–Rényi model random graphs.pdf

Original file(960 × 720 pixels, file size: 12 KB, MIME type: application/pdf)

## Captions

### Captions

Add a one-line explanation of what this file represents

## Summary

 Description English: Erdős–Rényi model random graphs with different values of P. The plot has been obtained by the following Python code: import networkx as nx import matplotlib.pyplot as plt from scipy.stats import bernoulli colors = ["blue", "red", "green", "yellow"] probs = [0.1, 0.3, 0.5, 0.8] N=20 plt.figure() for n in range(len(colors)): ``` p=probs[n] G = nx.Graph() G.add_nodes_from(range(N)) for node1 in G.nodes(): for node2 in G.nodes(): if bernoulli.rvs(p=p) and node1>node2: G.add_edge(node1, node2) plt.subplot(2,2,n+1) nx.draw(G, node_color=colors[n], edge_color='gray', label="P=" + str(probs[n]), node_size=12) plt.legend(fontsize = 'small', labelspacing =-1) ``` plt.show() plt.savefig("fig.eps") Català: Grafs aleatoris obtinguts a partir del model d'Erdős-Rényi amb diferents valors del paràmetre P. La gràfica s'ha obtingut a partir del codi de Python: ```import networkx as nx ``` import matplotlib.pyplot as plt from scipy.stats import bernoulli colors = ["blue", "red", "green", "yellow"] probs = [0.1, 0.3, 0.5, 0.8] N=20 plt.figure() for n in range(len(colors)): ``` p=probs[n] G = nx.Graph() G.add_nodes_from(range(N)) for node1 in G.nodes(): for node2 in G.nodes(): if bernoulli.rvs(p=p) and node1>node2: G.add_edge(node1, node2) plt.subplot(2,2,n+1) nx.draw(G, node_color=colors[n], edge_color='gray', label="P=" + str(probs[n]), node_size=12) plt.legend(fontsize = 'small', labelspacing =-1) ``` plt.show() plt.savefig("fig.eps") Date 1 December 2017 Source Own work Author Jordiventura96

## Licensing

I, the copyright holder of this work, hereby publish it under the following license:   This file is licensed under the Creative Commons Attribution-Share Alike 4.0 International license. You are free: to share – to copy, distribute and transmit the work to remix – to adapt the work Under the following conditions: attribution – You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. share alike – If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.

## File history

• You cannot overwrite this file.

The following page uses this file:

## File usage on other wikis

The following other wikis use this file:

• Usage on ca.wikipedia.org