Skip to main content

tools for graph theory and network science with many generation models

Project description

graph-tools Package

graph_tools - tools for graph theory and network science with many generation models

DESCRIPTION

This manual page documents graph-tools module, a Python module that provides a number of features for handling directed/undirected graphs and complex networks. graph-tools was initially developed for networking researchers, who perform experiments in the field of graph theory and network science. graph-tools provides Graph class, which supports both directed and undirected graphs with multi-edges, vertex weights, edge weights, and graph attributes. A number of graph/network generation models and graph algorithms are supported.

Major features of graph-tools are:

  • directed/undirected graph with multi-edges, vertex weights, edge weights, and graph attributes

  • vertex operations (add, delete, degree, neighbors, random vertex, and set/get vertex attributes)

  • edge operations (add, delete, random edge, and set/get edge attributes)

  • graph operations (copy, adjacency matrix, diagonal matrix, Laplacian matrix)

  • major graph algorithms (exploration, connectivity, components, maximal component, Dijkstra, Floyd-Warshall, betweenness centrality)

  • spectral graph theory (spectral radius, spectral gap, natural connectivity, algebraic connectivity, effective_resistance, and spanning tree count)

  • a number of graph/network generation models (random graph, ER (Erdos Renyi), BA (Barabasi Albert), randomized BA, ring, tree, binary tree, BA tree, generalized BA, latent, lattice, Voronoi, DB (Degree Bounded), configuration model, random regular graph, Li-Miani graph)

  • graph import/export in DOT (GraphViz) format

HISTORY

The development of graph-tools started in 2007, which was initially an extension to Graph module in CPAN (Comprehensive Perl Archive Network) by Jarkko Hietaniemi. Our Perl module has been called graphtools for long time and Perl module names were Graph::Util and Graph::Enhanced. graphtools in Perl has been developed until 2018. Python version of graph-tools was born in 2018 by porting graphtools in Perl to Python. Hence, the internal structure and the coding style receives significant influence from Graph module by Jarkko Hietaniemi.

EXAMPLE

from graph_tools import Graph

# create a graph with four nodes and two edges
g = Graph(directed=True)
g.add_edge(1, 2)
g.add_edge(2, 3)
g.add_vertex(4)
print(g)

# find the all shortest paths from vertex 1
dist, prev = g.dijkstra(1)
print(dist)

# generate BA graph with 100 vertices
g = Graph(directed=False).create_graph('barabasi', 100)

# check if all vertices are mutually connected
print(g.is_connected())

# compute the betweenness centrality of vertex 1
print(g.betweenness(1))

INSTALLATION

pip3 install graph-tools

AVAILABILITY

The latest version of graph-tools module is available at PyPI (https://pypi.org/project/graph-tools/) .

SEE ALSO

graphviz - graph visualization software (https://graphviz.org/)

AUTHOR

Hiroyuki Ohsaki <code[atmark]lsnl.jp>

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

graph_tools-1.15.tar.gz (36.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graph_tools-1.15-py3-none-any.whl (37.4 kB view details)

Uploaded Python 3

File details

Details for the file graph_tools-1.15.tar.gz.

File metadata

  • Download URL: graph_tools-1.15.tar.gz
  • Upload date:
  • Size: 36.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for graph_tools-1.15.tar.gz
Algorithm Hash digest
SHA256 121c6c21d20c1202906ea52ef8986fae02f605be54b9ca9a86aaea92794c480e
MD5 68054a56d123dafa1c1f7eb084694755
BLAKE2b-256 7941dc207fb0985ba0bdb14d5879ae8f1d7148e2c40e7547383042c486008238

See more details on using hashes here.

File details

Details for the file graph_tools-1.15-py3-none-any.whl.

File metadata

  • Download URL: graph_tools-1.15-py3-none-any.whl
  • Upload date:
  • Size: 37.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for graph_tools-1.15-py3-none-any.whl
Algorithm Hash digest
SHA256 4756d915d1ba3328aebd1ea3e66d51360dad47efc7e2b32f359b200245e43609
MD5 df800ed4e4862a3811097511afd947fd
BLAKE2b-256 e24479b0b48e59cdfe7306742cc7965595c7548603bd43fd9508adc5fd4e8bbf

See more details on using hashes here.

Supported by

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