Overview
pyrgg is an easy to use synthetic random graph generator written in python, that support variant graph file formats include DIMACS(.gr) pyrgg has the ability to generate graphs in different sizes and designed to provide input files for test, benchmark and performance-analysis of graph processing frameworks, but it can be used in any other research program that include graphs with these formats.
Installation
Source Code
- Download Version 0.1 or Latest Source
pip install -r requirements.txt
orpip3 install -r requirements.txt
(Need root access)python3 setup.py install
orpython setup.py install
(Need root access)
PyPI
- Check Python Packaging User Guide
pip install pyrgg
orpip3 install pyrgg
(Need root access)
Usage
Download Full Run Video (2.8 MB - MKV)( This video recorded by simplescreenrecorder )
Test
python3 -m pyrgg test
or python -m pyrgg test
This test run automatically in each commit ;-)
Issues & Bug Reports
Just fill an issue and describe it. I'll check it ASAP! or send an email to sepand@qpage.ir.
TODO
- Formats
- DIMACS
- JSON
- YAML
- Pickle
- CSV
- WEL
- ASP
- TGF
- UCINET DL
- Sizes
- Small
- Medium
- Large
- Weighted Graph
- Signed Weights
- Dense Graph
- Sparse Graph
- Directed Graph
- Self loop
- Parallel Arc
- Multithreading
- GUI
- Erdős–Rényi model
- Tree
Sample Files
- Sample 1-DIMACS (100 Vertices , 3KB)
- Sample 2-DIMACS (1000 Vertices , 13KB)
- Sample 3-DIMACS (1000000 Vertices , 7MB)
- Sample 4-DIMACS (5000000 Vertices , 37MB)
- Sample 1-JSON (100 Vertices , 11KB)
- Sample 2-JSON (1000 Vertices , 105KB)
- Sample 1-CSV (100 Vertices , 3KB)
- Sample 2-CSV (1000 Vertices , 51KB)
- Sample 1-WEL (100 Vertices , 5KB)
- Sample 2-WEL (1000 Vertices , 192KB)
- Sample 1-YAML (30 Vertices , 3KB)
- Sample 2-YAML (100 Vertices , 12KB)
- Sample 1-LP (100 Vertices , 7KB)
- Sample 2-LP (1000 Vertices , 76KB)
- Sample 1-Pickle (100 Vertices , 15KB)
- Sample 2-Pickle (1000 Vertices , 209KB)
- Sample 1-TGF (100 Vertices , 4KB)
- Sample 2-TGF (1000 Vertices , 61KB)
- Sample 1-UCINET DL (100 Vertices , 8KB)
- Sample 2-UCINET DL (1000 Vertices , 729KB)
Example Of Usage
- Generate synthetic data for graph processing frameworks (some of them mentioned here) performance-analysis
- Generate synthetic data for graph benchmark suite like GAP
Supported Formats
-
p sp <number of vertices> <number of directed edge> a <head_1> <tail_1> <weight_1> . . . a <head_n> <tail_n> <weight_n>
-
<head_1>,<tail_1>,<weight_1> . . . <head_n>,<tail_n>,<weight_n>
-
{ "graph": { "nodes":[ { "id": "1" }, . . . { "id": "n" } ], "edges":[ { "source": "head_1", "target": "tail_1", "weight": "weight_1" }, . . . { "source": "head_n", "target": "tail_n", "weight": "weight_n" }, ] } }
-
graph: edges: - source: "head_1" target: "tail_1" weight: "weight_1" . . . - source: "head_n" target: "tail_n" weight: "weight_n" nodes: - id: '1' . . . - id: 'n'
-
<head_1> <tail_1> <weight_1> . . . <head_n> <tail_n> <weight_n>
-
node(1). . . . node(n). edge(head_1,tail_1,weight_1). . . . edge(head_n,tail_n,weight_n).
-
1 . . . n # 1 2 weight_1 . . . n k weight_n
-
dl format=edgelist1 n=<number of vertices> data: 1 2 weight_1 . . . n k weight_n
-
Pickle(.p) (Binary Format)
Contribution
You can fork the repository, improve or fix some part of it and then send the pull requests back if you want to see them here. I really appreciate that.
Remember to write a few tests for your code before sending pull requests.
Similar Works
- Random Modular Network Generator Generates random graphs with tunable strength of community structure
- randomGraph very simple random graph generator in matlab
- Graph1 Random Graph Generator with Max capacity paths (C++)
Citing
If you use pyrgg in your research , please cite this ;-)
[1]Sepand Haghighi. pyrgg : Python Random Graph Generator 2017. doi:10.5281/zenodo.845502
License
Reference
Donate to our project
Beerpay :
Hey dude! Help me out for a couple of
Bitcoin :
1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA