{"id":13529753,"url":"https://github.com/graphaware/neo4j-algorithms","last_synced_at":"2025-12-30T17:16:40.852Z","repository":{"id":16599614,"uuid":"19354144","full_name":"graphaware/neo4j-algorithms","owner":"graphaware","description":"Custom graph algorithms for Neo4j with own Java and REST APIs","archived":true,"fork":false,"pushed_at":"2016-08-15T19:41:19.000Z","size":716,"stargazers_count":34,"open_issues_count":0,"forks_count":8,"subscribers_count":31,"default_branch":"master","last_synced_at":"2024-11-02T16:35:25.694Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/graphaware.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}},"created_at":"2014-05-01T18:49:36.000Z","updated_at":"2023-01-28T09:08:43.000Z","dependencies_parsed_at":"2022-09-13T08:12:08.860Z","dependency_job_id":null,"html_url":"https://github.com/graphaware/neo4j-algorithms","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-algorithms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-algorithms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-algorithms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/graphaware%2Fneo4j-algorithms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/graphaware","download_url":"https://codeload.github.com/graphaware/neo4j-algorithms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246680194,"owners_count":20816650,"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":[],"created_at":"2024-08-01T07:00:39.106Z","updated_at":"2025-12-17T01:17:41.714Z","avatar_url":"https://github.com/graphaware.png","language":"Java","readme":"GraphAware Neo4j Algorithms - RETIRED\n=====================================\n\nAlgorithms Have Been Retired\n----------------------------\n\nAs of August 14th 2016, this module is retiring. This means it will no longer be maintained and released together with\nnew versions of the GraphAware Framework and Neo4j. The last compatible Neo4j version is 3.0.4.\n\nIf you're interested in Graph Generators, please use [APOC](https://github.com/neo4j-contrib/neo4j-apoc-procedures#generating-graphs) instead. Unlike many other GraphAware modules, nobody is\nusing Algorithms in production, to the best of our knowledge.\n\nThis repository will remain public. Please \u003ca href=\"http://graphaware.com/contact/\"\u003eget in touch\u003c/a\u003e if you've been using Algorithms (especially the Path Finding part which hasn't been carried over to APOC) and APOC isn't good enough for you.\n\nIntroduction\n============\n\n[![Build Status](https://travis-ci.org/graphaware/neo4j-algorithms.png)](https://travis-ci.org/graphaware/neo4j-algorithms) | \u003ca href=\"http://graphaware.com/downloads/\" target=\"_blank\"\u003eDownloads\u003c/a\u003e | \u003ca href=\"http://graphaware.com/site/algorithms/latest/apidocs/\" target=\"_blank\"\u003eJavadoc\u003c/a\u003e | Latest Release: 3.0.4.43.5\n\nGraphAware Algorithms is a library of graph algorithms for Neo4j.\n\n* [Graph Generators](#graph-generators)\n* [Path Finding](#path-finding)\n\n\nGetting the Software\n--------------------\n\n### Server Mode\n\nWhen using Neo4j in the \u003ca href=\"http://docs.neo4j.org/chunked/stable/server-installation.html\" target=\"_blank\"\u003estandalone server\u003c/a\u003e mode,\nyou will need the \u003ca href=\"https://github.com/graphaware/neo4j-framework\" target=\"_blank\"\u003eGraphAware Neo4j Framework\u003c/a\u003e and GraphAware Neo4j Algorithms .jar files (both of which you can \u003ca href=\"http://graphaware.com/downloads/\" target=\"_blank\"\u003edownload here\u003c/a\u003e) dropped\ninto the `plugins` directory of your Neo4j installation. After Neo4j restart, you will be able to use the REST APIs of the Algorithms.\n\n### Embedded Mode / Java Development\n\nJava developers that use Neo4j in \u003ca href=\"http://docs.neo4j.org/chunked/stable/tutorials-java-embedded.html\" target=\"_blank\"\u003eembedded mode\u003c/a\u003e\nand those developing Neo4j \u003ca href=\"http://docs.neo4j.org/chunked/stable/server-plugins.html\" target=\"_blank\"\u003eserver plugins\u003c/a\u003e,\n\u003ca href=\"http://docs.neo4j.org/chunked/stable/server-unmanaged-extensions.html\" target=\"_blank\"\u003eunmanaged extensions\u003c/a\u003e,\nGraphAware Runtime Modules, or Spring MVC Controllers can include use the Algorithms as a dependency for their Java project.\n\n#### Releases\n\nReleases are synced to \u003ca href=\"http://search.maven.org/#search%7Cga%7C1%7Ca%3A%22algorithms%22\" target=\"_blank\"\u003eMaven Central repository\u003c/a\u003e. When using Maven for dependency management, include the following dependency in your pom.xml.\n\n    \u003cdependencies\u003e\n        ...\n        \u003cdependency\u003e\n            \u003cgroupId\u003ecom.graphaware.neo4j\u003c/groupId\u003e\n            \u003cartifactId\u003ealgorithms\u003c/artifactId\u003e\n            \u003cversion\u003e3.0.4.43.5\u003c/version\u003e\n        \u003c/dependency\u003e\n        ...\n    \u003c/dependencies\u003e\n\n#### Snapshots\n\nTo use the latest development version, just clone this repository, run `mvn clean install` and change the version in the\ndependency above to 3.0.4.43.6-SNAPSHOT.\n\n#### Note on Versioning Scheme\n\nThe version number has two parts. The first four numbers indicate compatibility with Neo4j GraphAware Framework.\n The last number is the version of the Algorithms library. For example, version 2.1.3.10.2 is version 2 of the library\n compatible with GraphAware Neo4j Framework 2.1.3.10.\n\nUsing the Software\n------------------\n\n### Graph Generators\n\nIt is often required for testing and implementation to work with a randomly generated graph. Getting one isn't as simple\nas it sounds - care has to be taken when generating relationships in order to obtain the desired network shape. A lot of\nresearch has gone into networks in the past decades; we have taken some of it and implemented a number of random graph\ngenerators. For a theoretical introduction, please take a look at the following blog posts:\n* [Random Graph Models (Part I)](http://graphaware.com/graph/theory/2014/07/16/random-graphs-part-one.html)\n* [Random Graph Models (Part II)](http://graphaware.com/graph/theory/2014/08/06/random-graphs-part-two.html)\n\n#### Java\n\nIn order to use the graph generators from Java, get the library following the instructions above and have a look at the\n[Javadoc](http://graphaware.com/site/algorithms/latest/apidocs) and tests. This will give you a really good idea of how the generators can be used. Provided implementations\ninclude:\n* Erdos-Renyi Model\n* Barabasi-Albert Model\n* Watts-Strogatz Model\n* Configuration Model\n\nYou have to choose two things: the shape of the network (one of the models above) and its contents (what labels will nodes\nget? what properties? what types of relationships will you generate?).\n\nTo choose the contents of the network, you can plug in your own implementations of [`NodeCreator`](http://graphaware.com/site/algorithms/latest/apidocs/com/graphaware/module/algo/generator/node/NodeCreator.html) and [`RelationshipCreator`](http://graphaware.com/site/algorithms/latest/apidocs/com/graphaware/module/algo/generator/relationship/RelationshipCreator.html) to create nodes and relationships\nwith types, labels, and properties of your choosing. You can use the provided `SocialNetworkNodeCreator` and\n`SocialNetworkRelationshipCreator` to get started quickly.\n\n#### Cypher\n\ncoming soon\n\n#### REST API\n\nFor now, the provided REST API allows you to create social networks only with FRIEND_OF relationships and randomly generated\n English names and uniformly assigned genders for people nodes.\n\n* `POST` to `http://your-server:7474/graphaware/algorithm/generator/social/watts-strogatz/{numberOfNodes}/{meanDegree}/{beta}` will\nreturn a `201 CREATED` status when your Watts-Strogatz network has been successfully created. Please refer to [`WattsStrogatzConfig`](http://graphaware.com/site/algorithms/latest/apidocs/com/graphaware/module/algo/generator/config/WattsStrogatzConfig.html) for explanation\nof the parameters you need to provide.\n\n* `POST` to `http://your-server:7474/graphaware/algorithm/generator/social/erdos-renyi/{numberOfNodes}/{numberOfEdges}` will\nreturn a `201 CREATED` status when your Erdos-Renyi network has been successfully created. Please refer to [`ErdosRenyiConfig`](http://graphaware.com/site/algorithms/latest/apidocs/com/graphaware/module/algo/generator/config/ErdosRenyiConfig.html) for explanation\nof the parameters you need to provide.\n\n* `POST` to `http://your-server:7474/graphaware/algorithm/generator/social/barabasi-albert/{numberOfNodes}/{edgesPerNewNode}` will\nreturn a `201 CREATED` status when your Barabasi-Albert network has been successfully created. Please refer to [`BarabasiAlberConfig`](http://graphaware.com/site/algorithms/latest/apidocs/com/graphaware/module/algo/generator/config/BarabasiAlbertConfig.html) for explanation\nof the parameters you need to provide.\n\n\u003ca name=\"algos\"/\u003e\n### Path Finding\n\n#### Increasingly Longer (Weighted) Shortest Paths\n\nThis library allows to find a given number of shortest paths between two nodes.\nIt is different from standard shortest path finding, because it allows to specify the desired number of results. Provided\nthat there are enough paths between the two nodes in the graph, this path finder will first return all the shortest paths,\nthen all the paths one hop longer, then two hops longer, etc., until enough paths have been returned.\n\nPlease note that nodes that are on a path with certain length will not be considered for paths with greater lengths.\n\nFor example, given the following graph:\n\n    (1)-\u003e(2)-\u003e(3)\n    (1)-\u003e(4)-\u003e(5)-\u003e(3)\n    (4)-\u003e(2)\n\nthe shortest path from (1) to (3) is (1)-\u003e(2)-\u003e(3) and has a length of 2. If more paths are needed, the next path\nreturned will be (1)-\u003e(4)-\u003e(5)-\u003e(3) with a length of 3. Note that there is another path of length 3:\n(1)-\u003e(4)-\u003e(2)-\u003e(3), but it is not returned, since (2)-\u003e(3) is contained in a shorter path.\n\n#### Cypher\n\ncoming soon\n\n##### REST API\n\nWhen deployed in server mode, issue a POST request to `http://your-server-address:7474/graphaware/algorithm/path/increasinglyLongerShortestPath`\nwith the following JSON minimal payload\n\n```json\n{\n     \"startNode\": 0,\n     \"endNode\": 2\n }\n```\n\nin order to find all paths between nodes with ID 0 and 2, sorted by increasing length.\n\nYou can also optionally specify the following:\n* maximum path depth (`maxDepth`), 3 by default\n* maximum number of results (`maxResults`), unlimited by default\n* cost property (`costProperty`), which must be a number-valued relationship property that indicates the cost of the path, none by default\n* sort order (`sortOrder`):\n    * LENGTH_ASC (By increasing length. Ordering of paths with the same lengths is unspecified. This is the default.)\n    * LENGTH_ASC_THEN_COST_ASC (By increasing length, then by increasing cost. The cost property must be specified.)\n    * LENGTH_ASC_THEN_COST_DESC (By increasing length, then by decreasing cost. The cost property must be specified.)\n* whether to include node labels in the result (`includeNodeLabels`) set to true or false, default is true\n* which node properties to include in the result (`nodeProperties`) as an array of Strings, default is all\n* which relationship properties to include in the result (`relationshipProperties`) as an array of Strings, default is all\n* which relationships to traverse by supplying one of the following (default is all relationships in both directions):\n    * the direction in which to traverse relationships (`direction`), INCOMING, OUTGOING, or BOTH\n    * relationship types and directions for each (`typesAndDirections` array with `type` and optionally `direction`)\n\nAn example input with most of these parameters would look like this:\n\n```json\n{\n    \"startNode\": 0,\n    \"endNode\": 2,\n    \"costProperty\": \"cost\",\n    \"sortOrder\": \"LENGTH_ASC_THEN_COST_DESC\",\n    \"maxDepth\": 2,\n    \"maxResults\": 10,\n    \"includeNodeLabels\": true,\n    \"nodeProperties\": [\n            \"name\"\n    ],\n    \"relationshipProperties\": [\n            \"cost\"\n    ],\n    \"typesAndDirections\": [\n        {\n            \"type\": \"R1\"\n        },\n        {\n            \"type\": \"R2\",\n            \"direction\": \"INCOMING\"\n        }\n\n    ]\n}\n```\n\nThe output depends on the specification, but could look something like this:\n\n```json\n[\n    {\n        \"nodes\": [\n            {\n                \"id\": 0,\n                \"labels\": [\"L1\", \"L2\"],\n                \"name\": \"one\"\n            },\n            {\n                \"id\": 1,\n                \"labels\": [\"L2\"],\n                \"name\": \"two\"\n            },\n            {\n                \"id\": 2,\n                \"labels\": [\"L1\", \"L2\"],\n                \"name\": \"three\"\n            }\n        ],\n        \"relationships\": [\n            {\n                \"id\": 0,\n                \"type\": \"R1\",\n                \"direction\": \"OUTGOING\",\n                \"cost\": 5\n            },\n            {\n                \"id\": 1,\n                \"type\": \"R2\",\n                \"direction\": \"OUTGOING\",\n                \"cost\": 1\n            }\n        ]\n    }\n]\n```\n\n##### Java API\n\nFor the Java API, please refer to the Javadoc of `NumberOfShortestPathsFinder` and `PathFinderInput`.\n\n\nLicense\n-------\n\nCopyright (c) 2014-2016 GraphAware\n\nGraphAware is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License\nas published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied\nwarranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\nYou should have received a copy of the GNU General Public License along with this program.\nIf not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","funding_links":[],"categories":["Extensions","REST API"],"sub_categories":["REST API","Other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-algorithms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraphaware%2Fneo4j-algorithms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraphaware%2Fneo4j-algorithms/lists"}