{"id":38279073,"url":"https://github.com/heimdalr/dag","last_synced_at":"2026-01-17T01:55:44.260Z","repository":{"id":39902321,"uuid":"230253045","full_name":"heimdalr/dag","owner":"heimdalr","description":"Yet another directed acyclic graph (DAG) implementation in golang.","archived":false,"fork":false,"pushed_at":"2024-07-26T07:18:10.000Z","size":132,"stargazers_count":169,"open_issues_count":10,"forks_count":33,"subscribers_count":7,"default_branch":"master","last_synced_at":"2024-07-27T07:27:45.474Z","etag":null,"topics":["dag","directed-acyclic-graph","golang","golang-module"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/heimdalr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-12-26T11:32:48.000Z","updated_at":"2024-07-26T07:08:51.000Z","dependencies_parsed_at":"2023-12-07T13:24:55.076Z","dependency_job_id":"f2f39e36-dc85-4973-94a6-b9c1a8177e80","html_url":"https://github.com/heimdalr/dag","commit_stats":null,"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/heimdalr/dag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdalr%2Fdag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdalr%2Fdag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdalr%2Fdag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdalr%2Fdag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/heimdalr","download_url":"https://codeload.github.com/heimdalr/dag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/heimdalr%2Fdag/sbom","scorecard":{"id":459751,"data":{"date":"2025-08-11","repo":{"name":"github.com/heimdalr/dag","commit":"5f5ea29118974b6483459035fb04eb2d3f99e196"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":6,"reason":"Found 8/12 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/heimdalr/dag/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/heimdalr/dag/test.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/test.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/heimdalr/dag/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/heimdalr/dag/test.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/heimdalr/dag/test.yml/master?enable=pin","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/test.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"CII-Best-Practices","score":2,"reason":"badge detected: InProgress","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: BSD 3-Clause \"New\" or \"Revised\" License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T10:47:18.588Z","repository_id":39902321,"created_at":"2025-08-19T10:47:18.588Z","updated_at":"2025-08-19T10:47:18.588Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28491851,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T00:50:05.742Z","status":"ssl_error","status_checked_at":"2026-01-17T00:43:11.982Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dag","directed-acyclic-graph","golang","golang-module"],"created_at":"2026-01-17T01:55:44.152Z","updated_at":"2026-01-17T01:55:44.240Z","avatar_url":"https://github.com/heimdalr.png","language":"Go","funding_links":[],"categories":["\u003ca name=\"Go\"\u003e\u003c/a\u003eGo"],"sub_categories":[],"readme":"# dag\n\n[![run tests](https://github.com/heimdalr/dag/workflows/Run%20Tests/badge.svg?branch=master)](https://github.com/heimdalr/dag/actions?query=branch%3Amaster)\n[![PkgGoDev](https://pkg.go.dev/badge/github.com/heimdalr/dag)](https://pkg.go.dev/github.com/heimdalr/dag)\n[![Go Report Card](https://goreportcard.com/badge/github.com/heimdalr/dag)](https://goreportcard.com/report/github.com/heimdalr/dag)\n[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/heimdalr/dag)\n[![CodeQL](https://github.com/heimdalr/dag/actions/workflows/codeql-analysis.yml/badge.svg)](https://github.com/heimdalr/dag/actions/workflows/codeql-analysis.yml)\n\u003c!--[![Scorecards supply-chain security](https://github.com/heimdalr/dag/actions/workflows/scorecards.yml/badge.svg)](https://github.com/heimdalr/dag/actions/workflows/scorecards.yml)--\u003e\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/6402/badge)](https://bestpractices.coreinfrastructure.org/projects/6402)\n\n\nImplementation of directed acyclic graphs (DAGs).\n\nThe implementation is fast and thread-safe. It prevents adding cycles or \nduplicates and thereby always maintains a valid DAG. The implementation caches\ndescendants and ancestors to speed up subsequent calls. \n\n\u003c!--\ngithub.com/heimdalr/dag:\n\n3.770388s to add 597871 vertices and 597870 edges\n1.578741s to get descendants\n0.143887s to get descendants 2nd time\n0.444065s to get descendants ordered\n0.000008s to get children\n1.301297s to transitively reduce the graph with caches poupulated\n2.723708s to transitively reduce the graph without caches poupulated\n0.168572s to delete an edge from the root\n\n\n\"github.com/hashicorp/terraform/dag\":\n\n3.195338s to add 597871 vertices and 597870 edges\n1.121812s to get descendants\n1.803096s to get descendants 2nd time\n3.056972s to transitively reduce the graph\n--\u003e\n\n\n\n\n## Quickstart\n\nRunning: \n\n``` go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/heimdalr/dag\"\n)\n\nfunc main() {\n\n\t// initialize a new graph\n\td := NewDAG()\n\n\t// init three vertices\n\tv1, _ := d.AddVertex(1)\n\tv2, _ := d.AddVertex(2)\n\tv3, _ := d.AddVertex(struct{a string; b string}{a: \"foo\", b: \"bar\"})\n\n\t// add the above vertices and connect them with two edges\n\t_ = d.AddEdge(v1, v2)\n\t_ = d.AddEdge(v1, v3)\n\n\t// describe the graph\n\tfmt.Print(d.String())\n}\n```\n\nwill result in something like:\n\n```\nDAG Vertices: 3 - Edges: 2\nVertices:\n  1\n  2\n  {foo bar}\nEdges:\n  1 -\u003e 2\n  1 -\u003e {foo bar}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimdalr%2Fdag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fheimdalr%2Fdag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fheimdalr%2Fdag/lists"}