mdeldar / pyrgg

🔧 Python Random Graph Generator

Home Page:http://pyrgg.shaghighi.ir

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Random Graph Generator

PyPI version DOI Codecov

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 or pip3 install -r requirements.txt (Need root access)
  • python3 setup.py install or python setup.py install (Need root access)

PyPI

Usage

Download Full Run Video (2.8 MB - MKV)( This video recorded by simplescreenrecorder )

pyrgg usage
pyrgg output

Test

python3 -m pyrgg test or python -m pyrgg test

This test run automatically in each commit ;-)

Linux Windows
pyrgg test

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

Example Of Usage

  • Generate synthetic data for graph processing frameworks (some of them mentioned here) performance-analysis

Example. Performance comparison between Medusa and Basic implementation (RMAT&Random are synthetic)

  • 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>
    
  • 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)

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

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

DIMACS

Donate to our project

Beerpay :

Hey dude! Help me out for a couple of 🍻!

Beerpay Beerpay

Bitcoin :

1XGr9qbZjBpUQJJSB6WtgBQbDTgrhPLPA

Payping (For Iranian citizens) :

About

🔧 Python Random Graph Generator

http://pyrgg.shaghighi.ir

License:MIT License


Languages

Language:Python 97.3%Language:TeX 2.7%