# 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:

## File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current22:13, 1 December 2017960 × 720 (12 KB)Jordiventura96 (talk | contribs)User created page with UploadWizard
• 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