Skip to content

atsushi-green/networkc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NetworkC

This Python package written in C is a faster version of NetworkX. I will implement the ShortestPath algorithm one after the other.

Install

Install the latest version of NetworkC:

$ pip install git+https://github.com/atsushi-green/networkc

Example

import networkx as nx
import numpy as np

import networkc as nc

G = nx.DiGraph()
G.add_nodes_from(range(4))
G.add_edge(0, 0, weight=0)
G.add_edge(1, 1, weight=0)
G.add_edge(2, 2, weight=0)
G.add_edge(3, 3, weight=0)

G.add_edge(0, 1, weight=1)
G.add_edge(1, 2, weight=2)
G.add_edge(2, 3, weight=1)
G.add_edge(3, 0, weight=1)

res_c = nc.all_pairs_dijkstra_path(G, weight="weight")
res_x = dict(nx.all_pairs_dijkstra_path(G, weight="weight"))
print(res_c == res_x)
# True

About

Package with NetwrokX algorithm rewritten in C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published