A graph data structure library for Elm, inspired by Haskell Data.Graph. This package implements a finite, directed graph type using an adjacency list representation, where vertices are identified by integers. It also includes an SCC (Strongly Connected Component) type for managing and analyzing strongly-connected components within the graph.
To install the package, run the following:
elm install guida-lang/graph
Here’s an example of how to use the Data.Graph
in Elm:
import Data.Graph as Graph exposing (Graph)
graphWith3Vertices : Graph
graphWith3Vertices =
let
( graph, nodeFromVertex, vertexFromKey ) =
Graph.graphFromEdges [ ( "a", 'a', [ 'b' ] ), ( "b", 'b', [ 'c' ] ), ( "c", 'c', [] ) ]
in
graph
For full API documentation and more examples, please visit the Elm package documentation.
Contributions are welcome! If you have ideas for improvements or find bugs, feel free to open an issue or submit a pull request.
- Fork the repository.
- Create a new feature branch.
- Commit your changes.
- Submit a pull request.