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

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

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

Captions

Captions

Add a one-line explanation of what this file represents

Summary[edit]

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
Source Own work
Author Jordiventura96

Licensing[edit]

I, the copyright holder of this work, hereby publish it under the following license:
w:en:Creative Commons
attribution share alike
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 remix, transform, or build upon the material, you must distribute your contributions under the same or compatible license as the original.

File history

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

Date/TimeThumbnailDimensionsUserComment
current22:13, 1 December 2017Thumbnail for version as of 22:13, 1 December 2017958 × 718 (12 KB)Jordiventura96 (talk | contribs)User created page with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata