{"id":17652540,"url":"https://github.com/barakugav/jgalgo","last_synced_at":"2025-04-15T12:19:09.480Z","repository":{"id":37913401,"uuid":"421945057","full_name":"barakugav/JGAlgo","owner":"barakugav","description":"A high-performance library for graph algorithms written in Java. It contains a wide collection of optimized algorithms and data structures for a range of problems on graphs.","archived":false,"fork":false,"pushed_at":"2025-04-13T07:01:35.000Z","size":146209,"stargazers_count":18,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T12:18:48.608Z","etag":null,"topics":["algorithms","data-structures","graph-algorithms","graph-api","graph-theory","java","java-library"],"latest_commit_sha":null,"homepage":"https://www.jgalgo.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/barakugav.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":"2021-10-27T19:16:50.000Z","updated_at":"2025-04-13T06:50:51.000Z","dependencies_parsed_at":"2023-01-25T17:15:16.511Z","dependency_job_id":"21a5a322-551d-46ea-8c17-5140bb172b8b","html_url":"https://github.com/barakugav/JGAlgo","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakugav%2FJGAlgo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakugav%2FJGAlgo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakugav%2FJGAlgo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/barakugav%2FJGAlgo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/barakugav","download_url":"https://codeload.github.com/barakugav/JGAlgo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249067787,"owners_count":21207396,"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":["algorithms","data-structures","graph-algorithms","graph-api","graph-theory","java","java-library"],"created_at":"2024-10-23T11:47:17.976Z","updated_at":"2025-04-15T12:19:09.462Z","avatar_url":"https://github.com/barakugav.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build](https://github.com/barakugav/JGAlgo/actions/workflows/build.yaml/badge.svg)](https://github.com/barakugav/JGAlgo/actions/workflows/build.yaml)\r\n[![Coverage](https://github.com/barakugav/JGAlgo/blob/coverage/badges/jacoco.svg?raw=true)](https://github.com/barakugav/JGAlgo/tree/coverage)\r\n[![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://barakugav.github.io/JGAlgo)\r\n[![Benchmarks](https://github.com/barakugav/JGAlgo/actions/workflows/benchmarks.yaml/badge.svg)](https://github.com/barakugav/JGAlgo/actions/workflows/benchmarks.yaml)\r\n[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.jgalgo/jgalgo/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.jgalgo/jgalgo)\r\n\r\n\r\n# JGAlgo\r\n\r\nThe \u003cb\u003e*J*\u003c/b\u003eava \u003cb\u003e*G*\u003c/b\u003eraph \u003cb\u003e*Algo*\u003c/b\u003erithm library is a high-performance library for graph algorithms written in Java.\r\nIt contains a wide collection of optimized algorithms and data structures for a range of problems on graphs.\r\nFrom calculating shortest paths and maximum flows to computing minimum spanning trees, maximum matchings, vertex covers, and minimum coloring.\r\nThe library runs on Java 11 or higher, and it is installed using [Maven](https://central.sonatype.com/artifact/com.jgalgo/jgalgo).\r\n\r\nJGAlgo offer [unparalleled speed](https://github.com/barakugav/JGAlgo/actions/workflows/benchmarks.yaml) and efficiency by implementing algorithms with theoretically guaranteed running times using the most efficient underlying building blocks and data-structures.\r\nA few concrete reasons for the library performance are:\r\n- All building blocks of the library are primitives, rather than Objects\r\n- The underlying [Graph](https://barakugav.github.io/JGAlgo/0.5.1/com/jgalgo/graph/Graph.html) implementations and algorithms do not use costly hash maps, only plain primitive arrays, yielding faster query time, smaller memory footprint and better cache hit rate\r\n- Extensive use of [fastutil](https://fastutil.di.unimi.it/) for all collections\r\n- Memory allocations are postpone and reused by algorithms objects\r\n\r\n**Notice:** This project is still under active development and does not guarantee a stable API.\r\n\r\n* [Documentation](https://barakugav.github.io/JGAlgo)\r\n* [Website](https://www.jgalgo.com/)\r\n\r\nIf you are passionate about graph algorithms and data structure, come help develop the most performant competitive graph library in Java! There are still many real-world problems not addressed by the library, and newer or better algorithms not implemented yet.\r\n\r\n### Quick Start\r\n\r\nAdd the following lines to your `pom.xml`:\r\n```\r\n\u003cdependency\u003e\r\n\t\u003cgroupId\u003ecom.jgalgo\u003c/groupId\u003e\r\n\t\u003cartifactId\u003ejgalgo-core\u003c/artifactId\u003e\r\n\t\u003cversion\u003e0.5.1\u003c/version\u003e\r\n\u003c/dependency\u003e\r\n```\r\n\r\n\r\nThe most basic object in the library is a [Graph](https://barakugav.github.io/JGAlgo/0.5.1/com/jgalgo/graph/Graph.html).\r\nA graph consist of vertices and edges (directed or undirected) connecting between pairs of vertices, all represented by some hashable objects.\r\nAlgorithms such as [shortest path algorithm](https://barakugav.github.io/JGAlgo/0.5.1/com/jgalgo/alg/shortestpath/ShortestPathSingleSource.html) accept a graph as an input and perform some computation on it.\r\nHere is a snippet creating an undirected graph representing the roads between cities in Germany, and computing the shortest path from a source city to all others with respect to a weight function:\r\n\r\n```java\r\n/* Create an undirected graph with three vertices and edges between them */\r\nGraph\u003cString, Integer\u003e g = Graph.newUndirected();\r\ng.addVertex(\"Berlin\");\r\ng.addVertex(\"Leipzig\");\r\ng.addVertex(\"Dresden\");\r\ng.addEdge(\"Berlin\", \"Leipzig\", 9);\r\ng.addEdge(\"Berlin\", \"Dresden\", 13);\r\ng.addEdge(\"Dresden\", \"Leipzig\", 14);\r\n\r\n/* Assign some weights to the edges */\r\nWeightsDouble\u003cInteger\u003e w = g.addEdgesWeights(\"distance-km\", double.class);\r\nw.set(9, 191.1);\r\nw.set(13, 193.3);\r\nw.set(14, 121.3);\r\n\r\n/* Calculate the shortest paths from Berlin to all other cities */\r\nShortestPathSingleSource ssspAlgo = ShortestPathSingleSource.newInstance();\r\nShortestPathSingleSource.Result\u003cString, Integer\u003e ssspRes = ssspAlgo.computeShortestPaths(g, w, \"Berlin\");\r\n\r\n/* Print the shortest path from Berlin to Leipzig */\r\nSystem.out.println(\"Distance from Berlin to Leipzig is: \" + ssspRes.distance(\"Leipzig\"));\r\nSystem.out.println(\"The shortest path from Berlin to Leipzig is:\");\r\nfor (Integer e : ssspRes.getPath(\"Leipzig\").edges()) {\r\n\tString u = g.edgeSource(e), v = g.edgeTarget(e);\r\n\tSystem.out.println(\" \" + e + \"(\" + u + \", \" + v + \")\");\r\n}\r\n```\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarakugav%2Fjgalgo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbarakugav%2Fjgalgo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbarakugav%2Fjgalgo/lists"}