{"id":27595689,"url":"https://github.com/caioopra/exgraphs","last_synced_at":"2026-03-14T20:39:56.390Z","repository":{"id":284391859,"uuid":"953531521","full_name":"caioopra/ExGraphs","owner":"caioopra","description":"A graph library in Elixir","archived":false,"fork":false,"pushed_at":"2025-04-14T22:11:24.000Z","size":85,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T12:16:43.942Z","etag":null,"topics":["elixir","graphs","graphs-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/caioopra.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-03-23T15:29:54.000Z","updated_at":"2025-04-14T22:11:29.000Z","dependencies_parsed_at":"2025-04-14T23:21:53.724Z","dependency_job_id":"916b96e0-71f7-4e85-b17f-3de3e1aadb40","html_url":"https://github.com/caioopra/ExGraphs","commit_stats":null,"previous_names":["caioopra/exgraphs"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caioopra%2FExGraphs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caioopra%2FExGraphs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caioopra%2FExGraphs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/caioopra%2FExGraphs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/caioopra","download_url":"https://codeload.github.com/caioopra/ExGraphs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250237844,"owners_count":21397403,"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","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":["elixir","graphs","graphs-algorithms"],"created_at":"2025-04-22T12:16:49.203Z","updated_at":"2026-03-14T20:39:56.321Z","avatar_url":"https://github.com/caioopra.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExGraphs\n\nExGraphs is an Elixir library for creating, manipulating, and analyzing graphs. It provides a simple and intuitive API for working with graph data structures.\n\n## Features\n\n- **Graph Creation**: Create graphs with vertices and edges\n- **File I/O**: Import graphs from standard `.net` files\n- **Graph Operations**: Add vertices, create edges, check connectivity\n- **Basic Queries**: Check vertex/edge existence, count vertices/edges\n\n## Installation\n\nAdd `ex_graphs` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_graphs, \"~\u003e 0.1.0\"}\n  ]\nend\n```\n\n## Usage\n\n### Creating a Graph\n\n```elixir\nalias ExGraphs.Graph\n\n# Create an empty graph\ngraph = %Graph{}\n\n# Add vertices\n{:ok, graph} = Graph.create_vertex(graph, 1, \"A\")\n{:ok, graph} = Graph.create_vertex(graph, 2, \"B\")\n{:ok, graph} = Graph.create_vertex(graph, 3, \"C\")\n\n# Create edges between vertices\n{:ok, graph, _, _} = Graph.create_edge(graph, 1, 2)\n{:ok, graph, _, _} = Graph.create_edge(graph, 2, 3, 2.5) # with weight\n```\n\n### Reading a Graph from File\n\nExGraphs supports reading graphs from `.net` files:\n\n```elixir\nalias ExGraphs.Utils\n\n# Read from a .net file\n{:ok, graph} = Utils.read_graph(\"path/to/file.net\")\n```\n\nThe `.net` file should have the following format:\n\n```\n*vertices 3\n1 A\n2 B\n3 C\n*edges\n1 2 1.0\n2 3 2.5\n```\n\n### Graph Operations\n\n```elixir\n# Check if a vertex exists\nGraph.vertex_in_graph?(graph, 1) # =\u003e true\n\n# Get vertex info\nvertex = Graph.get_vertex(graph, 1)\n\n# Check if an edge exists\nGraph.has_edge?(graph, 1, 2) # =\u003e true\n\n# Count vertices and edges\nGraph.vertices_amount(graph) # =\u003e 3\nGraph.edges_amount(graph) # =\u003e 2\n```\n\n## Graph Structure\n\nGraphs in ExGraphs are composed of:\n\n- **Vertices**: Each vertex has an index, label, neighbors list, and degree\n- **Edges**: Each edge connects two vertices with an optional weight\n\n## Development\n\n### Running Tests\n\n```bash\nmix test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaioopra%2Fexgraphs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcaioopra%2Fexgraphs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcaioopra%2Fexgraphs/lists"}