{"id":20157566,"url":"https://github.com/g4s8/go-graph","last_synced_at":"2025-10-12T22:53:19.319Z","repository":{"id":38320758,"uuid":"497042805","full_name":"g4s8/go-graph","owner":"g4s8","description":"Graph common functions for Go","archived":false,"fork":false,"pushed_at":"2024-11-16T10:29:32.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-03T02:14:32.802Z","etag":null,"topics":["algorithm","go","graph"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/g4s8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-27T15:13:59.000Z","updated_at":"2024-11-16T10:29:20.000Z","dependencies_parsed_at":"2025-01-13T12:46:39.734Z","dependency_job_id":"fb6d575a-50de-4023-8ba6-48d24ad8fdc7","html_url":"https://github.com/g4s8/go-graph","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/g4s8/go-graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g4s8%2Fgo-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g4s8%2Fgo-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g4s8%2Fgo-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g4s8%2Fgo-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/g4s8","download_url":"https://codeload.github.com/g4s8/go-graph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/g4s8%2Fgo-graph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279013280,"owners_count":26085250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["algorithm","go","graph"],"created_at":"2024-11-13T23:46:53.939Z","updated_at":"2025-10-12T22:53:19.282Z","avatar_url":"https://github.com/g4s8.png","language":"Go","readme":"This go library provides packages with functions for\ncommon graph operations. It doesn't provide graph data structures.\nIt's designed to be structure agnostic,\nit depends only on required API for each operation declared as interface\n(similar to standard Go `sort` package).\n\n[![CI](https://github.com/g4s8/go-graph/actions/workflows/go.yml/badge.svg)](https://github.com/g4s8/go-graph/actions/workflows/go.yml)\n[![GoDoc](https://godoc.org/github.com/g4s8/go-graph?status.svg)](https://godoc.org/github.com/g4s8/go-graph)\n\n\n## Packages\n\n### Search\n\nPackage search provides graph search operations:\n - `DepthFirstSearch(Graph g, v int, visitor Visitor)` - implements DFS stack-based\n algorithm for graph `g` from vertex `v` using `visitor`.\n - `BreathFirstSearch(g Graph, v int, visitor Visitor)` - implements BFS queue-based\n algorithm for graph `g` from vertex `v` using `visitor`.\n - `HasCicle(g Graph)` - detects if graph `g` has any cicle.\n - `SimplePaths(g Graph, from, to int)` - finds all simple paths (without cicles)\n in graph `g` from vertex `from` to `to`.\n\nGraph type for `search` package should be able to say its size of vertices and edges,\nand iterate all neighors for each vertex:\n```go\ntype Graph interface {\n\t// Size of vertices and edges\n\tSize() (vertices, edges int)\n\n\t// Neighbors of vertex\n\tNeighbors(v int) []int\n}\n```\n\nThe `search` package provides standard visitors for DFS and BFS like:\n - `NewFullVisitor(Graph)` which allows to visit all vertices\n - `NewShortPathVisitor(g Graph, vertex int)` which stops when destination `vertex`\n is visited.\n\nUsers are free to implement custom visitor as `Visitor` interface.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg4s8%2Fgo-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fg4s8%2Fgo-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fg4s8%2Fgo-graph/lists"}