Skip to main content

Python Random Graph Generator

Project description


Random Graph Generator

PyPI version Codecov built with Python3


Table of contents

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
Travis
AppVeyor
Code Quality CodeFactor

Installation

Source Code

  • Download Version 0.5 or Latest Source
  • pip install -r requirements.txt or pip3 install -r requirements.txt (Need root access)
  • python3 setup.py install or python setup.py install (Need root access)

PyPI

Conda

Exe Version (Only Windows)

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. I'll check it ASAP! or send an email to info@pyrgg.ir.

TODO

  • [x] Formats
    • [x] DIMACS
    • [x] JSON
    • [x] YAML
    • [x] Pickle
    • [x] CSV
    • [x] TSV
    • [x] WEL
    • [x] ASP
    • [x] TGF
    • [x] UCINET DL
    • [ ] GEXF
  • [ ] Sizes
    • [x] Small
    • [x] Medium
    • [ ] Large
  • [x] Weighted Graph
    • [x] Signed Weights
  • [x] Unweighted Graph
  • [x] Dense Graph
  • [x] Sparse Graph
  • [x] Directed Graph
  • [x] Self loop
  • [x] Parallel Arc
  • [ ] Multithreading
  • [ ] GUI
  • [ ] Erdős–Rényi model
  • [ ] Tree

Sample Files

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

  • DIMACS(.gr)

     	p sp <number of vertices> <number of directed edge>
     	a <head_1> <tail_1> <weight_1>
    
     	.
     	.
     	.
     	
     	a <head_n> <tail_n> <weight_n>
    
  • CSV(.csv)

     	<head_1>,<tail_1>,<weight_1>
    
     	.
     	.
     	.
     	
     	<head_n>,<tail_n>,<weight_n>
    
  • TSV(.tsv)

     	<head_1>	<tail_1>	<weight_1>
    
     	.
     	.
     	.
     	
     	<head_n>	<tail_n>	<weight_n>
    
  • JSON(.json)

     	{
     	"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"
     			},
     			]
     		}
     	}
    
  • YAML(.yaml)

     	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'
    
    
  • Weighted Edge List(.wel)

     	<head_1> <tail_1> <weight_1>
     	
     	.
     	.
     	.
     	
     	<head_n> <tail_n> <weight_n>	
    
  • ASP(.lp)

     	node(1).
     	.
     	.
     	.
     	node(n).
     	edge(head_1,tail_1,weight_1).
     	.
     	.
     	.
     	edge(head_n,tail_n,weight_n).
    
  • Trivial_Graph_Format(.tgf)

     	1
     	.
     	.
     	.
     	n
     	#
     	1 2 weight_1
     	.
     	.
     	.
     	n k weight_n
    
  • UCINET DL Format(.dl)

     	dl
     	format=edgelist1
     	n=<number of vertices>
     	data:
     	1 2 weight_1
     	.
     	.
     	.
     	n k weight_n	
    
  • Pickle(.p) (Binary Format)

Similar Works

Dependencies

master dev
Requirements Status Requirements Status

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 DOI

License

References

DIMACS

Donate to our project

Bitcoin :

1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA

Payping (For Iranian citizens) :

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

0.5 - 2020-07-01

Added

  • TSV format
  • Multigraph control

Changed

0.4 - 2020-06-17

Added

  • Self loop control
  • Github action

Changed

  • appveyor.yml updated

0.3 - 2019-11-29

Added

  • __version__ variable
  • CHANGELOG.md
  • dev-requirements.txt
  • requirements.txt
  • CODE_OF_CONDUCT.md
  • ISSUE_TEMPLATE.md
  • PULL_REQUEST_TEMPLATE.md
  • CONTRIBUTING.md
  • version_check.py
  • pyrgg_profile.py
  • Unweighted graph
  • Undirected graph
  • Exe version

Changed

  • Test system modified
  • README.md modified
  • Docstrings modified
  • get_input function modified
  • edge_gen function 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyrgg, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size pyrgg-0.5-py2.py3-none-any.whl (20.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pyrgg-0.5.tar.gz (233.7 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page