GithubHelp home page GithubHelp logo

fagan2888 / pyrgg Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sepandhaghighi/pyrgg

0.0 1.0 0.0 9.55 MB

🔧 Python Random Graph Generator

Home Page: https://www.pyrgg.ir

License: MIT License

Python 97.64% TeX 0.73% Shell 1.15% Batchfile 0.48%

pyrgg's Introduction


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.9 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 [email protected].

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

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 edges>
     	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	
    
  • Matrix Market(.mtx)

        %%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 
    
  • GML(.gml)

        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
          ]
        ]
    
  • GEXF(.gexf)

        <?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

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

pyrgg's People

Contributors

codacy-badger avatar dependabot-preview[bot] avatar ivanovmg avatar sadrasabouri avatar sepandhaghighi avatar

Watchers

 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.