Skip to content

fsssosei/shuffle_graph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

shuffle_graph

PyPI PyPI - Status GitHub Release Date Build Status Code Intelligence Status Language grade: Python Codacy Badge Scrutinizer Code Quality PyPI - Downloads PyPI - Python Version PyPI - License

Graph shuffling package in python.

Installation

Installation can be done through pip. You must have python version >= 3.8

pip install shuffle-graph

Usage

The statement to import the package:

from shuffle_graph_package import *

Example:

>>> from networkx.classes.graph import Graph
>>> G = Graph({0: {1: {}}, 1: {0: {}, 2: {}}, 2: {1: {}, 3: {}}, 3: {2: {}, 4: {}}, 4: {3: {}}})
>>> seed = 170141183460469231731687303715884105727
>>> shuffle_graph(G, seed).adj  #Set seed to make the results repeatable.
AdjacencyView({1: {0: {}, 2: {}}, 2: {1: {}, 3: {}}, 3: {2: {}, 4: {}}, 4: {3: {}}, 0: {1: {}}})