Skip to main content

No project description provided

Project description

abcd-graph

A python library for generating ABCD graphs.

Installation

pip install abcd-graph

Usage

from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build()

Parameters

  • params: An instance of ABCDParams class.
  • n: Number of nodes in the graph.
  • logger A boolean to enable or disable logging to the console. Default is False - no logs are shown.

Exporting

The graph object can be exported to networkx.Graph object using the to_networkx method.

from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build().to_networkx()

This requires the networkx library to be installed.

pip install abcd-graph[networkx]

Another option is an igraph.Graph object.

from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build().to_igraph()

This requires the igraph library to be installed.

pip install abcd-graph[igraph]

Finally, the graph can be exported to a numpy.ndarray object that represents the adjacency matrix.

from abcd_graph import Graph, ABCDParams

params = ABCDParams()
graph = Graph(params).build().adj_matrix

[!IMPORTANT] If the build() method is not run before calling any of the export methods, a RuntimeError will be raised.

[!NOTE] The numpy array is of type numpy.bool_. If the graph was not properly generated (loops or multi-edges), a MalformedGraphError will be raised.

Project details


Download files

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

Source Distribution

abcd_graph-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

abcd_graph-0.1.0-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file abcd_graph-0.1.0.tar.gz.

File metadata

  • Download URL: abcd_graph-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.13 Linux/6.5.0-35-generic

File hashes

Hashes for abcd_graph-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5623b93a9c97e344679cbffe656e59cc9a6e1fa893dfb540df6c56e504dc993f
MD5 ed26d9646e1f61247d68613a4f44f147
BLAKE2b-256 ece6e24e95e37bae0a14dc7a2b7823914d78e6a51413add65536b2a48cb61149

See more details on using hashes here.

File details

Details for the file abcd_graph-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: abcd_graph-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.8.13 Linux/6.5.0-35-generic

File hashes

Hashes for abcd_graph-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d989acc71fcb85c49339ffc24289d32526b838caab02ea5c67ec4995c18c99f9
MD5 a9c192e16acc8b7d80ff7016f1fec1bd
BLAKE2b-256 442b2d18a955acfae504eacd68a64255682ad98c06526fc99d9f2f64733fb97a

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page