RGraph is an implementation of Graph in Ruby and is still under heavy development so don't use it in any kind of production. Graph is internally represented with adjacency list.
- convert project to gem
- implement adjacency matrix
- implement MultiGraph
- Path analysis
I've found some inspiration in the amazing Python's NetworkX library.
How to install
$ git clone https://github.com/warriorkitty/rgraph.git $ cd rgraph $ gem install rspec # for running tests $ rspec # run tests
Graph is represented with Vertex and EdgeSet classes.
- represents a single Vertex (node) in Graph
- has degree information about itself
- represents a single Edge in Graph
- contains two vertices
- this is a set of edges
- simple methods such as add, count, edge?
- makes sure there are no duplicates
- changes a degree of a single vertex when adding it to edgeset
- represented with vertices and edgeset
- simple methods for checking degree, adjacent?
- simple unit tests
- look at the file if you want to see simple usage