Python Random Graph Generator
Project description
Table of Contents
- Overview
- Installation
- Usage
- Issues & Bug Reports
- Todo
- Sample Files
- Example of Usage
- Supported Formats
- Similar Works
- Dependencies
- Contribution
- References
- Citing
- Authors
- License
- Show Your Support
- Changelog
- Code of Conduct
Overview
Pyrgg is an easy-to-use synthetic random graph generator written in Python which supports various graph file formats including DIMACS .gr files. Pyrgg has the ability to generate graphs of different sizes and is designed to provide input files for broad range of graph-based research applications, including but not limited to testing, benchmarking and performance-analysis of graph processing frameworks. Pyrgg target audiences are computer scientists who study graph algorithms and graph processing frameworks.
| Open Hub | |
| PyPI Counter | |
| Github Stars |
| Branch | master | dev |
| CI |
| Code Quality |
Installation
Source Code
- Download Version 1.2 or Latest Source
pip install -r requirements.txtorpip3 install -r requirements.txt(Need root access)python3 setup.py installorpython setup.py install(Need root access)
PyPI
- Check Python Packaging User Guide
pip install pyrgg==1.2orpip3 install pyrgg==1.2(Need root access)
Conda
- Check Conda Managing Package
conda install -c sepandhaghighi pyrgg(Need root access)
Exe Version (Only Windows)
- Download Exe-Version 1.2
- Run
PYRGG-1.2.exe
System Requirements
Pyrgg will likely run on a modern dual core PC. Typical configuration is:
- Dual Core CPU (2.0 Ghz+)
- 4GB of RAM
Note that it may run on lower end equipment though good performance is not guaranteed.
Usage
Issues & Bug Reports
Just fill an issue and describe it. We'll check it ASAP! or send an email to info@pyrgg.ir.
You can also join our discord server
TODO
- Formats
- DIMACS
- JSON
- YAML
- Pickle
- CSV
- TSV
- WEL
- ASP
- TGF
- UCINET DL
- GML
- GDF
- Matrix Market
- Graph Line
- GEXF
- Sizes
- Small
- Medium
- Large
- Weighted Graph
- Signed Weights
- Unweighted Graph
- 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 , 26KB)
- Sample 2-JSON (1000 Vertices , 494KB)
- Sample 1-CSV (100 Vertices , 3KB)
- Sample 2-CSV (1000 Vertices , 51KB)
- Sample 1-TSV (100 Vertices , 29KB)
- Sample 2-TSV (1000 Vertices , 420KB)
- Sample 1-WEL (100 Vertices , 5KB)
- Sample 2-WEL (1000 Vertices , 192KB)
- Sample 1-YAML (30 Vertices , 6KB)
- Sample 2-YAML (100 Vertices , 35KB)
- Sample 1-LP (100 Vertices , 7KB)
- Sample 2-LP (1000 Vertices , 76KB)
- Sample 1-Pickle (100 Vertices , 12KB)
- Sample 2-Pickle (1000 Vertices , 340KB)
- 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)
- Sample 1-MTX (100 Vertices , 59KB)
- Sample 2-MTX (1000 Vertices , 1.8MB)
- Sample 1-GL (100 Vertices , 17KB)
- Sample 2-GL (1000 Vertices , 2.4MB)
- Sample 1-GDF (100 Vertices , 21KB)
- Sample 2-GDF (1000 Vertices , 690KB)
- Sample 1-GML (100 Vertices , 120KB)
- Sample 2-GML (1000 Vertices , 2.4MB)
- Sample 1-GEXF (100 Vertices , 63KB)
- Sample 2-GEXF (1000 Vertices , 6.4MB)
Example of Usage
- Generate synthetic data for graph processing frameworks (some of them mentioned here) performance-analysis
Fig. 1. Rand Graph Generation
- Generate synthetic data for graph benchmark suite like GAP
Supported Formats
-
p sp <number of vertices> <number of edges> 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> -
<head_1> <tail_1> <weight_1> . . . <head_n> <tail_n> <weight_n> -
{ "properties": { "directed": true, "signed": true, "multigraph": true, "weighted": true, "self_loop": true }, "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 properties: directed: true multigraph: true self_loop: true signed: true weighted: true -
<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 -
%%MatrixMarket matrix coordinate real general <number of vertices> <number of vertices> <number of edges> <head_1> <tail_1> <weight_1> . . . <head_n> <tail_n> <weight_n> -
Graph Line(.gl)
<head_1> <tail_1>:<weight_1> <tail_2>:<weight_2> ... <tail_n>:<weight_n> <head_2> <tail_1>:<weight_1> <tail_2>:<weight_2> ... <tail_n>:<weight_n> . . . <head_n> <tail_1>:<weight_1> <tail_2>:<weight_2> ... <tail_n>:<weight_n> -
GDF(.gdf)
nodedef>name VARCHAR,label VARCHAR node_1,node_1_label node_2,node_2_label . . . node_n,node_n_label edgedef>node1 VARCHAR,node2 VARCHAR, weight DOUBLE node_1,node_2,weight_1 node_1,node_3,weight_2 . . . node_n,node_2,weight_n -
graph [ multigraph 0 directed 0 node [ id 1 label "Node 1" ] node [ id 2 label "Node 2" ] . . . node [ id n label "Node n" ] edge [ source 1 target 2 value W1 ] edge [ source 2 target 4 value W2 ] . . . edge [ source n target r value Wn ] ] -
<?xml version="1.0" encoding="UTF-8"?> <gexf xmlns="http://www.gexf.net/1.2draft" version="1.2"> <meta lastmodifieddate="2009-03-20"> <creator>PyRGG</creator> <description>File Name</description> </meta> <graph defaultedgetype="directed"> <nodes> <node id="1" label="Node 1" /> <node id="2" label="Node 2" /> ... </nodes> <edges> <edge id="1" source="1" target="2" weight="400" /> ... </edges> </graph> </gexf> -
Pickle(.p) (Binary Format)
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++)
Dependencies
| master | dev |
Citing
If you use pyrgg in your research, please cite the JOSS paper ;-)
@article{Haghighi2017,
doi = {10.21105/joss.00331},
url = {https://doi.org/10.21105/joss.00331},
year = {2017},
month = {sep},
publisher = {The Open Journal},
volume = {2},
number = {17},
author = {Sepand Haghighi},
title = {Pyrgg: Python Random Graph Generator},
journal = {The Journal of Open Source Software}
}
| JOSS | |
| Zenodo |
References
1- 9th DIMACS Implementation Challenge - Shortest Paths
2- Problem Based Benchmark Suite
3- MaximalClique - ASP Competition 2013
4- Pitas, Ioannis, ed. Graph-based social media analysis. Vol. 39. CRC Press, 2016.
5- Roughan, Matthew, and Jonathan Tuke. "The hitchhikers guide to sharing graph data." 2015 3rd International Conference on Future Internet of Things and Cloud. IEEE, 2015.
6- Borgatti, Stephen P., Martin G. Everett, and Linton C. Freeman. "Ucinet for Windows: Software for social network analysis." Harvard, MA: analytic technologies 6 (2002).
7- Matrix Market: File Formats
8- Social Network Visualizer
9- Adar, Eytan. "GUESS: a language and interface for graph exploration." Proceedings of the SIGCHI conference on Human Factors in computing systems. 2006.
10- Skiena, Steven S. The algorithm design manual. Springer International Publishing, 2020.
11- Chakrabarti, Deepayan, Yiping Zhan, and Christos Faloutsos. "R-MAT: A recursive model for graph mining." Proceedings of the 2004 SIAM International Conference on Data Mining. Society for Industrial and Applied Mathematics, 2004.
12- Zhong, Jianlong, and Bingsheng He. "An overview of medusa: simplified graph processing on gpus." ACM SIGPLAN Notices 47.8 (2012): 283-284.
Show Your Support
Star This Repo
Give a ⭐️ if this project helped you!
Donate to Our Project
Bitcoin
1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCyEthereum
0xcD4Db18B6664A9662123D4307B074aE968535388Litecoin
Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZDoge
DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDhTron
TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7Ripple
rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qqBinance Coin
bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qefTether
0xcD4Db18B6664A9662123D4307B074aE968535388Dash
Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3sStellar
GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNLZilliqa
zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5Coffeete
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Unreleased
1.2 - 2022-09-07
Added
- Anaconda workflow
- Discord badge
Changed
- Menu optimized
- Docstrings modified
branch_genfunction modifiededge_genfunction modifiedprecisionandmin_edgeparameters added tobranch_genfunctionrandom_edgeparameter removed frombranch_genfunction- Test system modified
AUTHORS.mdupdated- License updated
README.mdmodifiedPython 3.10added totest.yml
Removed
sign_genfunctionrandom_edge_limitsfunction
1.1 - 2021-06-09
Added
requirements-splitter.pyis_weightedfunction_write_properties_to_jsonfunctionPYRGG_TEST_MODEparameter
Changed
- Test system modified
- JSON, YAML and Pickle formats value changed from
stringtonumber propertiessection added to JSON, YAML and Pickle formats_write_to_jsonfunction renamed to_write_data_to_jsonloggerfunction modifiedtime_convertfunction modifiedbranch_genfunction modified- References updated
1.0 - 2021-01-11
Added
- Number of files option
Changed
- All flags type changed to
bool - Menu optimized
- The
loggerfunction enhanced. - Time format in the
loggerchanged to%Y-%m-%d %H:%M:%S dl_makerfunction modifiedtgf_makerfunction modifiedgdf_makerfunction modifiedrunfunction modified
0.9 - 2020-10-07
Added
- GEXF format
- Float weight support
tox.ini
Changed
- Menu optimized
pyrgg.pyrenamed tograph_gen.py- Other functions moved to
functions.py - Test system modified
params.pyrefactoredgraph_gen.pyrefactoredfunctions.pyrefactoredweight_str_to_numberfunction renamed toconvert_str_to_numberbranch_genfunction bugs fixedinput_filterfunction bug fixedgl_makerfunction bug fixedCONTRIBUTING.mdupdatedAUTHORS.mdupdated
Removed
print_testfunctionleft_justifyfunctionjustifyfunctionzero_insertfunction
0.8 - 2020-08-19
Added
- GDF format
- GML format
Changed
- CLI snapshots updated
AUTHORS.mdupdated
0.7 - 2020-08-07
Added
- Graph Line format
Changed
- Menu optimized
0.6 - 2020-07-24
Added
- Matrix Market format
Changed
json_makerfunction optimizeddl_makerfunction optimizedtgf_makerfunction optimizedlp_makerfunction optimized
0.5 - 2020-07-01
Added
- TSV format
- Multigraph control
Changed
branch_genfunction modified- Website changed to https://www.pyrgg.ir
0.4 - 2020-06-17
Added
- Self loop control
- Github action
Changed
appveyor.ymlupdated
0.3 - 2019-11-29
Added
__version__variableCHANGELOG.mddev-requirements.txtrequirements.txtCODE_OF_CONDUCT.mdISSUE_TEMPLATE.mdPULL_REQUEST_TEMPLATE.mdCONTRIBUTING.mdversion_check.pypyrgg_profile.py- Unweighted graph
- Undirected graph
- Exe version
Changed
- Test system modified
README.mdmodified- Docstrings modified
get_inputfunction modifiededge_genfunction modified- Parameters moved to
params.py
0.2 - 2017-09-20
Added
- CSV format
- YAML format
- Weighted edge list format (WEL)
- ASP format
- Trivial graph format (TGF)
- UCINET DL format
- Pickle format
0.1 - 2017-08-19
Added
- DIMACS format
- JSON format
- README
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyrgg-1.2.tar.gz.
File metadata
- Download URL: pyrgg-1.2.tar.gz
- Upload date:
- Size: 236.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
89a0eba87121b81cfcee5cd8efa20d6dbced116ff392bc3fb49a6622e198a77d
|
|
| MD5 |
e7a22c9c66ee4526db0fa7a114d66e72
|
|
| BLAKE2b-256 |
47d5bf08ff97866d9c80680b636f82b6a6be82c34f3865cc6ba5c9ce6df16143
|
File details
Details for the file pyrgg-1.2-py2.py3-none-any.whl.
File metadata
- Download URL: pyrgg-1.2-py2.py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d07308db1afb43814c6c35d79d8e1d2236a4225167794775161593902143c0cd
|
|
| MD5 |
fa93a1edf365562a2d8e513fa0f4a98d
|
|
| BLAKE2b-256 |
2ca5c1c5da3fb2773d7255795c82eb19cc04769bb29a1a2e193facae2c5418fe
|