https://github.com/benmaier/smallworld

Generate and analyze small-world networks according to the revised Watts-Strogatz model where the randomization at β = 1 is truly equal to the Erdős-Rényi network model.

https://github.com/benmaier/smallworld

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (4.2%) to scientific vocabulary

Keywords

networks networkx networkx-drawing-utilities small-world-networks
Last synced: 5 months ago · JSON representation

Repository

Generate and analyze small-world networks according to the revised Watts-Strogatz model where the randomization at β = 1 is truly equal to the Erdős-Rényi network model.

Basic Info
  • Host: GitHub
  • Owner: benmaier
  • License: mit
  • Language: Python
  • Default Branch: master
  • Size: 469 KB
Statistics
  • Stars: 19
  • Watchers: 2
  • Forks: 6
  • Open Issues: 0
  • Releases: 1
Topics
networks networkx networkx-drawing-utilities small-world-networks
Created over 7 years ago · Last pushed over 4 years ago
Metadata Files
Readme License

README.md

smallworld

Generate and analyze small-world networks according to the revised Watts-Strogatz model where the randomization at β = 1 is truly equal to the Erdős-Rényi network model.

In the Watts-Strogatz model each node rewires its k/2 rightmost edges with probality β. This means each node has halways minimum degree k/2. Also, at β = 1, each edge has been rewired. Hence the probability of it existing is <k/(N-1), contrary to the ER model.

In the adjusted model, each pair of nodes is connected with a certain connection probability. If the lattice distance between the potentially connected nodes is d(i,j) <= k/2 then they are connected with short-range probability p_S = k / (k + β (N-1-k)), otherwise they're connected with long-range probability p_L = β * p_S.

Install

pip install smallworld

Beware: smallworld only works with Python 3!

Example

In the following example you can see how to generate and draw according to the model described above.

```python from smallworld.draw import drawnetwork from smallworld import getsmallworld_graph

import matplotlib.pyplot as pl

define network parameters

N = 21 kover2 = 2 betas = [0, 0.025, 1.0] labels = [ r'$\beta=0$', r'$\beta=0.025$', r'$\beta=1$']

focal_node = 0

fig, ax = pl.subplots(1,3,figsize=(9,3))

scan beta values

for ib, beta in enumerate(betas):

# generate small-world graphs and draw
G = get_smallworld_graph(N, k_over_2, beta)
draw_network(G,k_over_2,focal_node=focal_node,ax=ax[ib])

ax[ib].set_title(labels[ib],fontsize=11)

show

pl.subplots_adjust(wspace=0.3) pl.show() ```

visualization example

Owner

  • Name: Benjamin F. Maier
  • Login: benmaier
  • Kind: user
  • Location: Copenhagen
  • Company: Technical University of Denmark

Postdoc @suneman 's, generative art, electronic music. DTU Compute & SODAS.

GitHub Events

Total
  • Watch event: 3
Last Year
  • Watch event: 3

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 21
  • Total Committers: 1
  • Avg Commits per committer: 21.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Benjamin Maier b****r@g****m 21

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels