https://github.com/benmaier/biasedrandomwalks

Provides classes around biased random walks on networks.

https://github.com/benmaier/biasedrandomwalks

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.6%) to scientific vocabulary

Keywords

biased-random-walk graphs networks random-walk
Last synced: 5 months ago · JSON representation

Repository

Provides classes around biased random walks on networks.

Basic Info
  • Host: GitHub
  • Owner: benmaier
  • Language: Python
  • Default Branch: master
  • Size: 31.3 KB
Statistics
  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
biased-random-walk graphs networks random-walk
Created over 7 years ago · Last pushed over 7 years ago
Metadata Files
Readme

README.md

BiasedRandomWalks

Provides classes around biased random walks on networks.

Install

$ git clone git@github.com:benmaier/BiasedRandomWalks.git 
$ pip install ./BiasedRandomWalks

Examples

```python import numpy as np import matplotlib.pyplot as pl import networkx as nx

from BiasedRandomWalks import BiasedRandomWalk

Create a test Graph with weighted edges where weights are distances

G = nx.Graph() N = 4 G.addnodesfrom(range(N)) G.addedge(0,1,weight=1) G.addedge(0,2,weight=1) G.addedge(1,2,weight=1) G.addedge(1,3,weight=0.1) G.add_edge(2,3,weight=0.2)

define sink nodes

sink_nodes = [2,]

define bias

gamma = 1

initial distribution on transient

p0 = np.array([1,0,0])

initial distribution on all

p0_all = np.array([1,0,0,0])

initial base class (choose 'exponential' or 'scale free')

RW = BiasedRandomWalk(G, gamma, sinknodes, biaskind = 'exponential')

fig, ax = pl.subplots(2,2,figsize=(9,7))

integrate up to this time step

tmax = 10

========== prob density on sinks =========

t, rho = RW.getamountofwalkersarrivingatsink_nodes(p0,tmax)

for is, s in enumerate(sinknodes): ax[0,0].plot(t, rho[:,i_s], label='sink node '+ str(s))

ax[0,0].legend() ax[0,0].setxlabel('time') ax[0,0].setylabel('amount of walkers arriving')

========== cdf on sinks =========

t, rho = RW.getamountofwalkersarrivedatsink_nodes(p0,tmax)

for is, s in enumerate(sinknodes): ax[0,1].plot(t, rho[:,i_s], label='sink node '+ str(s))

ax[0,1].legend() ax[0,1].setxlabel('time') ax[0,1].setylabel('total amount of walkers arrived')

========== prob density on all =========

t, rho = RW.getamountofwalkersonnodes(p0all,tmax)

for s in G.nodes(): ax[1,0].plot(t, rho[:,s], label='node '+ str(s))

ax[1,0].legend() ax[1,0].setxlabel('time') ax[1,0].setylabel('amount of walkers on each node')

pl.show() ```

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
Last Year

Committers

Last synced: about 1 year ago

All Time
  • Total Commits: 15
  • Total Committers: 1
  • Avg Commits per committer: 15.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 15

Issues and Pull Requests

Last synced: 7 months 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

Dependencies

setup.py pypi
  • networkx >=2
  • numpy >=1.14