{"id":37174579,"url":"https://github.com/alecthomas/topsort","last_synced_at":"2026-01-14T20:23:48.074Z","repository":{"id":65001133,"uuid":"580539141","full_name":"alecthomas/topsort","owner":"alecthomas","description":"Topological Sorting for Golang","archived":false,"fork":true,"pushed_at":"2022-12-21T02:44:31.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-06-21T12:57:31.023Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"stevenle/topsort","license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alecthomas.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}},"created_at":"2022-12-20T20:16:03.000Z","updated_at":"2022-12-20T20:25:56.000Z","dependencies_parsed_at":"2023-01-30T02:31:24.600Z","dependency_job_id":null,"html_url":"https://github.com/alecthomas/topsort","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/alecthomas/topsort","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Ftopsort","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Ftopsort/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Ftopsort/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Ftopsort/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alecthomas","download_url":"https://codeload.github.com/alecthomas/topsort/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alecthomas%2Ftopsort/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":[],"created_at":"2026-01-14T20:23:47.624Z","updated_at":"2026-01-14T20:23:48.067Z","avatar_url":"https://github.com/alecthomas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"topsort\n=======\n\nTopological Sorting for Golang\n\nTopological sorting algorithms are especially useful for dependency calculation, and so this particular implementation is mainly intended for this purpose. As a result, the direction of edges and the order of the results may seem reversed compared to other implementations of topological sorting.\n\nFor example, if:\n\n* A depends on B\n* B depends on C\n\nThe graph is represented as:\n\n```\nA -\u003e B -\u003e C\n```\n\nWhere `-\u003e` represents a directed edge from one node to another.\n\nThe topological ordering of dependencies results in:\n\n```\n[C, B, A]\n```\n\nThe code for this example would look something like:\n\n```go\n// Initialize the graph.\ngraph := topsort.NewGraph[string]()\n\n// Add edges.\ngraph.AddEdge(\"A\", \"B\")\ngraph.AddEdge(\"B\", \"C\")\n\n// Topologically sort node A.\ngraph.TopSort(\"A\")  // =\u003e [C, B, A]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Ftopsort","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falecthomas%2Ftopsort","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falecthomas%2Ftopsort/lists"}