{"id":13413752,"url":"https://github.com/yourbasic/graph","last_synced_at":"2026-01-14T15:45:57.395Z","repository":{"id":37359562,"uuid":"89629521","full_name":"yourbasic/graph","owner":"yourbasic","description":"Graph algorithms and data structures","archived":false,"fork":false,"pushed_at":"2023-05-11T18:52:43.000Z","size":97,"stargazers_count":703,"open_issues_count":6,"forks_count":64,"subscribers_count":22,"default_branch":"master","last_synced_at":"2024-10-15T05:11:45.980Z","etag":null,"topics":["data-structures","go","golang","graph-algorithms","graph-theory","library"],"latest_commit_sha":null,"homepage":"https://yourbasic.org/golang/your-basic-func/","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yourbasic.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-27T18:43:54.000Z","updated_at":"2024-09-26T08:51:40.000Z","dependencies_parsed_at":"2024-06-18T12:24:07.067Z","dependency_job_id":null,"html_url":"https://github.com/yourbasic/graph","commit_stats":{"total_commits":65,"total_committers":4,"mean_commits":16.25,"dds":0.07692307692307687,"last_synced_commit":"8ecfec1c28696321a89068ad0d058846552b5dc2"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/yourbasic/graph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yourbasic%2Fgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yourbasic%2Fgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yourbasic%2Fgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yourbasic%2Fgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yourbasic","download_url":"https://codeload.github.com/yourbasic/graph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yourbasic%2Fgraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28424726,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","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":["data-structures","go","golang","graph-algorithms","graph-theory","library"],"created_at":"2024-07-30T20:01:48.168Z","updated_at":"2026-01-14T15:45:57.368Z","avatar_url":"https://github.com/yourbasic.png","language":"Go","readme":"# Your basic graph [![GoDoc](https://godoc.org/github.com/yourbasic/graph?status.svg)][godoc-graph]\n\n### Golang library of basic graph algorithms\n\n![Topological ordering](top.png)\n\n*Topological ordering, image by [David Eppstein][de], [CC0 1.0][cc010].*\n\nThis library offers efficient and well-tested algorithms for\n\n- breadth-first and depth-first search,\n- topological ordering,\n- strongly and weakly connected components,\n- bipartion,\n- shortest paths,\n- maximum flow,\n- Euler walks,\n- and minimum spanning trees.\n\nThe algorithms can be applied to any graph data structure implementing\nthe two `Iterator` methods: `Order`, which returns the number of vertices,\nand `Visit`, which iterates over the neighbors of a vertex.\n\nAll algorithms operate on directed graphs with a fixed number\nof vertices, labeled from 0 to n-1, and edges with integer cost.\nAn undirected edge {v, w} of cost c is represented by the two\ndirected edges (v, w) and (w, v), both of cost c.\nA self-loop, an edge connecting a vertex to itself,\nis both directed and undirected.\n\n\n### Graph data structures\n\nThe type `Mutable` represents a directed graph with a fixed number\nof vertices and weighted edges that can be added or removed.\nThe implementation uses hash maps to associate each vertex\nin the graph with its adjacent vertices. This gives constant\ntime performance for all basic operations.\n\nThe type `Immutable` is a compact representation of an immutable graph.\nThe implementation uses lists to associate each vertex in the graph\nwith its adjacent vertices. This makes for fast and predictable\niteration: the Visit method produces its elements by reading\nfrom a fixed sorted precomputed list.\n\n\n### Virtual graphs\n\nThe subpackage `graph/build` offers a tool for building graphs of type `Virtual`.\n\nIn a virtual graph no vertices or edges are stored in memory,\nthey are instead computed as needed. New virtual graphs are constructed\nby composing and filtering a set of standard graphs, or by writing\nfunctions that describe the edges of a graph.\n\nThe following standard graphs are predefined:\n\n- empty graphs,\n- complete graphs and complete bipartite graphs,\n- grid graphs and complete *k*-ary trees,\n- cycle graphs and circulant graphs,\n- and hypergraphs.\n\nThe following operations are supported:\n\n- adding and deleting sets of edges,\n- adding cost functions,\n- filtering graphs by edge functions,\n- complement, intersection and union,\n- subgraphs,\n- connecting graphs at a single vertex,\n- joining two graphs by a set of edges,\n- matching two graphs by a set of edges,\n- cartesian product and tensor product.\n\nNon-virtual graphs can be imported, and used as building blocks,\nby the `Specific` function. Virtual graphs don't need to be “exported‬”;\nthey implement the `Iterator` interface and hence can be used directly\nby any algorithm in the graph package.\n\n\n### Installation\n\nOnce you have [installed Go][golang-install], run this command\nto install the `graph` package:\n\n    go get github.com/yourbasic/graph\n\n    \n### Documentation\n\nThere is an online reference for the package at\n[godoc.org/github.com/yourbasic/graph][godoc-graph].\n\n\n### Roadmap\n\n* The API of this library is frozen.\n* Bug fixes and performance enhancement can be expected.\n* New functionality might be included.\n* Version numbers adhere to [semantic versioning][sv].\n\nThe only accepted reason to modify the API of this package is to\nhandle issues that can't be resolved in any other reasonable way.\n\nNew features and performance enhancements are limited to basic\nalgorithms and data structures, akin to the ones that you might find\nin a computer science textbook.\n\nStefan Nilsson – [korthaj](https://github.com/korthaj)\n\n[godoc-graph]: https://godoc.org/github.com/yourbasic/graph\n[golang-install]: http://golang.org/doc/install.html\n[cc010]: https://creativecommons.org/publicdomain/zero/1.0/deed.en\n[de]: https://commons.wikimedia.org/wiki/User:David_Eppstein\n[sv]: http://semver.org/\n\n","funding_links":[],"categories":["科学和数据分析","科学与数据分析","Science and Data Analysis","Algorithms \u0026 Data Structures","数据分析与数据科学","\u003cspan id=\"科学和数据分析-science-and-data-analysis\"\u003e科学和数据分析 Science and Data Analysis\u003c/span\u003e","科学及数据分析","科學及數據分析","Relational Databases"],"sub_categories":["Advanced Console UIs","HTTP客户端","HTTP Clients","查询语","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面","高級控制台界面","交流"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyourbasic%2Fgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyourbasic%2Fgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyourbasic%2Fgraph/lists"}