Product
Introducing License Enforcement in Socket
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Num(py)Graph is a library for synthetic graph generation. The main principle of NumGraph is to be a lightweight library (i.e., numpy
is the only dependency) that generates graphs from a broad range of distributions. Indeed, It implements several graph distributions in both the static and temporal domain.
python3 -m pip install numgraph
>>> from numgraph import star_coo, star_full
>>> coo_matrix, coo_weights = star_coo(num_nodes=5, weighted=True)
>>> print(coo_matrix)
array([[0, 1],
[0, 2],
[0, 3],
[0, 4],
[1, 0],
[2, 0],
[3, 0],
[4, 0]]
>>> print(coo_weights)
array([[0.89292422],
[0.3743427 ],
[0.32810002],
[0.97663266],
[0.74940571],
[0.89292422],
[0.3743427 ],
[0.32810002],
[0.97663266],
[0.74940571]])
>>> adj_matrix = star_full(num_nodes=5, weighted=True)
>>> print(adj_matrix)
array([[0. , 0.72912008, 0.33964166, 0.30968042, 0.08774328],
[0.72912008, 0. , 0. , 0. , 0. ],
[0.33964166, 0. , 0. , 0. , 0. ],
[0.30968042, 0. , 0. , 0. , 0. ],
[0.08774328, 0. , 0. , 0. , 0. ]])
Other examples can be found in test/plot_static.py
and test/plot_temporal.py
.
FAQs
Utility package for generating graph structures
We found that numgraph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Ensure open-source compliance with Socket’s License Enforcement Beta. Set up your License Policy and secure your software!
Product
We're launching a new set of license analysis and compliance features for analyzing, managing, and complying with licenses across a range of supported languages and ecosystems.
Product
We're excited to introduce Socket Optimize, a powerful CLI command to secure open source dependencies with tested, optimized package overrides.