This repository has been archived by the owner. It is now read-only.
sodium
A fast library for graph/network manipulation inspired by networkx.
Installation
Add this to your application's shard.yml
:
dependencies:
sodium:
github: EddyShure/sodium
Usage
require "sodium"
You can create a graph with nodes of any type. For example, if you want to create a graph with nodes of the type Int32
:
graph = Sodium::Graph(Int32).new()
Manipulating the graph is straightforward:
# Add individual nodes
graph.add_node(1)
graph.add_node(2)
graph.add_node(3, {weight: 232})
# Add multiple nodes
graph.add_nodes_from([31, 32, 33])
# Add an edge
graph.add_edge(1, 2)
graph.add_edge(66, 88)
# Add multiple edge
graph.add_edges_from([{2, 3}, {4, 5}, {6, 7}])
# Remove a node
graph.remove_node(1)
For more information, please check out the documentation.
Roadmap
Graph types
-
Graph
-
DiGraph
-
MultiGraph
-
MultiDiGraph
Contributing
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Contributors
- EddyShure Eddy Shure - creator, maintainer
Repository
sodium
Owner
Statistic
- 11
- 2
- 0
- 0
- 0
- over 6 years ago
- February 27, 2017
License
MIT License
Links
Synced at
Sun, 24 Nov 2024 16:34:09 GMT
Languages