Crystal Graph Library (CGL)

Build Status

CGL is a Crystal library for the creation and manipulation of graph data structures.

All graph data structures are based on an adjacency list representation and heavily rely on Crystal Hash data structure.

Features

Documentation

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      cgl:
        github: RomainFranceschini/cgl
  2. Run shards install

Usage

Import the CGL module with :

require "cgl"

Directed and undirected graphs types are provided. For each of those, multiple variants are offered so users can carefully select the ones that consume the least memory for their needs.

Undirected graphs

The following classes all implements undirected graphs. They allow self-loop edges that connects a vertex to itself. They ignore multiple edges between two vertices.

Directed graphs

The following classes all implements directed graphs. They allow self-loop edges, that connects a vertex to itself. They ignore multiple edges between two vertices.

Multigraphs and Hypergraphs

TBD

Contributing

  1. Fork it (https://github.com/RomainFranceschini/cgl/fork)
  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