Git Product home page Git Product logo

modular_graph_generator's Introduction

Random Modular Network Generator

This is the source code used for the following paper:

Sah, Pratha*, Lisa O. Singh, Aaron Clauset, and Shweta Bansal. "Exploring community structure in biological networks with random graphs." BMC Bioinformatics 2014, 15:220. doi:10.1186/1471-2105-15-220

This Python script generates undirected, simple, connected graphs with a specified degrees and pattern of communities, while maintaining a graph structure that is as random as possible.

email: [email protected], [email protected]

Please cite the paper above, if you use our code in any form or create a derivative work.

Sample Output Graph

alt tag

Modular random graphs with network size = 150, 375 edges, 3 modules (or communities) of size, s = 50 and degree distribution is power law with modularity values of: a) Q = 0.1; b) Q = 0.3; and c) Q = 0.6.

From Figure 2, Sah et al. (2014)

Dependencies

Networkx Python package is required. Link to install Networkx can be found here. The generator also requires sequence_generator.py script which is provided.

Usage

For a quick demo of the code, open the script "random_modular_generator_variable_modules.py" and scroll down to the main function. Adjust the model parameters, degree distribution function and module size distribution function and run in terminal using the command:

$ python random_modular_generator_variable_modules.py

Sample Code

For users unfamiliar to Python, I have uploadeded a sample code file (mock_code.py) demonstrating how the graph generator can be imported and used in a script. The mock code can be run using the command

$ python mock_code.py

modular_graph_generator's People

Contributors

prathasah avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.