graph-tool

Efficient network analysis library and tools for Python 3

brewmacoslinux
Try with needOr install directly
Source

About

Efficient network analysis for Python 3

Commands

graph-tool

Examples

Import graph-tool in Python and create a simple graph$ python3 -c "from graph_tool.all import *; g = Graph(); g.add_vertex(5); print('Graph created with', g.num_vertices(), 'vertices')"
Load and analyze a network from a GraphML file$ python3 -c "from graph_tool.all import *; g = load_graph('network.graphml'); print('Vertices:', g.num_vertices(), 'Edges:', g.num_edges())"
Compute centrality measures on a network$ python3 -c "from graph_tool.all import *; g = Graph(); [g.add_edge(i, (i+1)%5) for i in range(5)]; bc = betweenness(g); print('Betweenness centrality computed')"