{"id":19636911,"url":"https://github.com/mikegoatly/graphalo","last_synced_at":"2026-01-27T11:03:45.674Z","repository":{"id":71429034,"uuid":"308145025","full_name":"mikegoatly/Graphalo","owner":"mikegoatly","description":"A very simple graph data structure library","archived":false,"fork":false,"pushed_at":"2024-11-15T09:14:33.000Z","size":77,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-17T08:52:07.142Z","etag":null,"topics":["depth-first-search","dijkstra-algorithm","graph","graph-algorithms"],"latest_commit_sha":null,"homepage":"","language":"C#","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/mikegoatly.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,"zenodo":null}},"created_at":"2020-10-28T21:27:02.000Z","updated_at":"2024-11-15T09:14:36.000Z","dependencies_parsed_at":"2025-04-28T14:15:08.552Z","dependency_job_id":"93d74050-61cb-46d9-88f1-d75eb234dcef","html_url":"https://github.com/mikegoatly/Graphalo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mikegoatly/Graphalo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegoatly%2FGraphalo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegoatly%2FGraphalo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegoatly%2FGraphalo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegoatly%2FGraphalo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikegoatly","download_url":"https://codeload.github.com/mikegoatly/Graphalo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikegoatly%2FGraphalo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28812367,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"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":["depth-first-search","dijkstra-algorithm","graph","graph-algorithms"],"created_at":"2024-11-11T12:32:11.267Z","updated_at":"2026-01-27T11:03:45.647Z","avatar_url":"https://github.com/mikegoatly.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Build and test](https://github.com/mikegoatly/Graphalo/workflows/Build%20and%20test/badge.svg)\n\n# Graphalo\nA *very* simple graph data structure library.\n\n## Installation\n\n``` powershell\nInstall-Package Graphalo\n```\n\n## Example usage:\n\n``` csharp\n\nvar graph = new DirectedGraph\u003cstring\u003e();\n\n// You can add vertices directly...\ngraph.AddVertex(\"A\");\n\n// Alternatively, adding an edge will automatically create missing vertices\ngraph.AddEdge(new Edge\u003cstring\u003e(\"B\", \"C\"));\n\n// Get all vertices without edges coming out of them\ngraph.AllVertices.Where(v =\u003e v.HasOutEdges == false);\n\n// Order all vertices by their degree (count of in and out edges), largest first\ngraph.AllVertices.OrderByDescending(v =\u003e v.Degree);\n\n```\n\n## Searching\n\n### Depth first search\n\nReference: [Wikipedia](https://en.wikipedia.org/wiki/Depth-first_search)\n\nReturns the deepest vertices first, working back to the root(s). Does not support cyclic graphs.\n\n``` csharp\nvar graph = new DirectedGraph\u003cstring\u003e();\n\n// Search across the entire graph (in the case of multiple disconnected \n// graphs being contained in the same structure)\nforeach (var vertex in graph.Search(SearchKind.DepthFirst))\n{\n\tConsole.WriteLine(vertex);\n}\n\n// Or search from a specific starting vertex - only the connected vertices will be returned\nforeach (var vertex in graph.Search(SearchKind.DepthFirst, \"A\"))\n{\n\tConsole.WriteLine(vertex);\n}\n```\n\n## Traversal\n\n### Dijkstra's Algorithm\n\nReference: [Wikipedia](https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm)\n\nAttempts to find the shortest path between two vertices, taking into account the weights of each edge.\nCycles in the graph are supported and will not cause infinite loops.\n\n``` csharp\n//   B-\n//  /5 \\2\n// A    C\n//  \\2 /1\n//   D-\nvar graph = new DirectedGraph\u003cstring\u003e();\ngraph.AddEdge(new Edge\u003cstring\u003e(\"A\", \"B\", 5));\ngraph.AddEdge(new Edge\u003cstring\u003e(\"B\", \"C\", 2));\ngraph.AddEdge(new Edge\u003cstring\u003e(\"A\", \"D\", 2));\ngraph.AddEdge(new Edge\u003cstring\u003e(\"D\", \"C\", 1));\n\nvar traversalResult = graph.Traverse(TraversalKind.Dijkstra, \"A\", \"C\");\n\n// traversalResult.Success will be true\nforeach (var vertex in traversalResult.Results)\n{\n\tConsole.Write(vertex);\n\tConsole.Write(\" \");\n}\n\n// Output: A D C (The route via D is the cheapest)\n\n// Attempt a tranversal to an unreachable node:\ntraversalResult = graph.Traverse(TraversalKind.Dijkstra, \"B\", \"D\");\n// traversalResult.Success will be false\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikegoatly%2Fgraphalo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikegoatly%2Fgraphalo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikegoatly%2Fgraphalo/lists"}