Skip to content
This repository has been archived by the owner on Jun 27, 2022. It is now read-only.
/ sodium Public archive

A fast library for graph/network manipulation

License

Notifications You must be signed in to change notification settings

mntns/sodium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sodium logo

A fast library for graph/network manipulation inspired by networkx.

Build Status

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

About

A fast library for graph/network manipulation

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published