dag
Version, currently 0.9.02 versions
- 1.0.0latestJul 5, 2024
- 0.9.0not indexedJul 5, 2024
github.com/dseres/dag
Directed Acyclic Graph API written in crystal
Nothing has been indexed for 0.9.0 yet. The tag is recorded, its shard.yml has not been read, so the manifest and dependency list below are empty because they are unknown rather than because they are absent.
Installation
# Add this to your shard.yml
dependencies:
dag:
github: dseres/dag
version: ~> 0.9.0Then run:
shards installshard.yml
No shard.yml has been indexed for 0.9.0. You can read it on the repository.
Dependencies
Unknown: the shard.yml for this version has not been read yet.
README
This README is the one indexed from the repository at its latest ref, not from the tag for this version.
DAG - Directed Acyclic Graph API
A directed acyclic graph (DAG) API written in the crystal programming languge. This DAG implementation can be used for creating schedulers. E.g.: running multiple tasks which has predefined dependencies.
Installation
-
Add the dependency to your
shard.yml:dependencies: dag: github: dseres/dag -
Run
shards install
Usage
Create a new Graph object. You can add and delete vertices and edges easily. If you enumarate the vertices with the #each method, the enumeration will be topologically sorted. The graph structure uses adjacency lists in the backend (implemented with Hash(K,V)), and you can store any hashable objects in it.
require "dag"
dag = Dag::Graph(Int32).new
(1...10).each { |i| dag.add i}
dag.add_edge({1, 3} , {5, 9} , {8, 7} , {8, 6} , {6, 4} , {4, 3} , {4, 7})
dag.successors 4 # => [3,7]
dag.each { |v| p! v}
dag.to_a # => [1, 2, 5, 9, 8, 6, 4, 3, 7]
Contributing
- Fork it (https://github.com/your-github-user/dag_cr/fork)
- 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
- dseres - creator and maintainer
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.9.0- Tagged
- Jul 5, 2024
- Commit
5c340082141f- Indexed
- not yet
Dependents
No indexed shard depends on this one yet.
Repository
github.com/dseres/dag
Metadata
- Created
- Aug 12, 2026
- Updated
- Aug 14, 2026
- Synced
- Aug 14, 2026
- Versions
- 2