pyrgg

🔧 Python Random Graph Generator

MIT License

Downloads
178
Stars
204
Committers
8

Overview

Installation

PyPI

Source Code

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

  • Open CMD (Windows) or Terminal (Linux)
  • Run pyrgg or python -m pyrgg (or run PYRGG.exe)
  • Enter data

Engines

PyRGG

Erdős–Rényi-Gilbert

Supported Formats

DIMACS

	p sp <number of vertices> <number of edges>
	a <head_1> <tail_1> <weight_1>

	.
	.
	.
		
	a <head_n> <tail_n> <weight_n>

CSV

	<head_1>,<tail_1>,<weight_1>

	.
	.
	.
		
	<head_n>,<tail_n>,<weight_n>

TSV

	<head_1>	<tail_1>	<weight_1>

	.
	.
	.
		
	<head_n>	<tail_n>	<weight_n>

JSON

{
	"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
		}
		]
	}
}

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
 	properties:
 		directed: true
 		multigraph: true
 		self_loop: true
 		signed: true
 		weighted: true

Weighted Edge List

	<head_1> <tail_1> <weight_1>
		
	.
	.
	.
		
	<head_n> <tail_n> <weight_n>	

ASP

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

Trivial Graph Format

	1
	.
	.
	.
	n
	#
	1 2 weight_1
	.
	.
	.
	n k weight_n

UCINET DL Format

	dl
	format=edgelist1
	n=<number of vertices>
	data:
	1 2 weight_1
	.
	.
	.
	n k weight_n	

Matrix Market

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

	<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

    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

    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

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

Graphviz

	graph example 
		{
		node1 -- node2 [weight=W1];
		node3 -- node4 [weight=W2];
		node1 -- node3 [weight=W3];
		.
		.
		.
		}

Pickle

⚠️ Binary format

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

Similar Works

Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP! or send an email to [email protected].

You can also join our discord server

Citing

If you use pyrgg in your research, please cite the JOSS paper ;-)

References

Show Your Support

Give a ⭐️ if this project helped you!

If you do like our project and we hope that you do, can you please support us? Our project is not and is never going to be working for profit. We need the money just so we can continue doing what we do ;-) .