Creating Custom Algorithm to use a plugin in NEO4j

I am new to NEO4j. I have been working on NEO4j for a month now, but I am unable to find a solution to write my own algorithm in python or java and import it as a package in NEO4j to execute on my graph and gain insights.

I searched neo4j docs and I got to know about Pregel API. I wanted to know whether this is the right approach to address my issue of creating an algorithm in java and running it on neo4j?

If this is the right approach can you please guide me where I can learn more about how to proceed ahead with this, i.e. tutorials or thorough documentation?

If I have made any wrong inferences please feel free to correct me.

I am grateful for all suggestions and solutions.

Thank you for your time.

Hi @shrivastavsuyash

You can write your own algorithm in Java and put it in the plugins folder and it will work.
I have also created my procedure for my own algorithm.

Yes, if you want to write your own algorithm the best place to start is our Pregel API: it provides many of the building blocks for graph algorithms, without having to learn all the internals. We have a pretty thorough explanation in our docs, or you can check out this presentation from NODES 2020.


We have some example Pregel implementations in our github repo to get you started, as well.

2 Likes

Hi @koji

Thank you for the advice. I will try it and get back to you.

1 Like

Hi @alicia.frame1

Thank you for the help. I will try and get back to you.

Thank you for the information I'm doing my research on the subject of algorithms in neo4j and I have watched a session made by neo4j about the subject and it mentioned that there are two ways to develop an algorithm in neo4j. The first is the prequel API which I found some good references about, and the second one is graph API, they mentioned it needs a low level of understanding of the internal codes and structure of neo4j. But I couldn't find any references or videos explaining how to use it.
Please, if you can support me with any links or references that may help me and thanks.

Hi @mohanedmoh : We cover using the Pregel API in our docs, and provide examples in our Github Repo

No, we don't have documentation on using our internal APIs. You can look at the algorithm implementations in our repo, though, to see examples - eg. graph-data-science/algo/src/main/java/org/neo4j/gds/pagerank at master · neo4j/graph-data-science · GitHub

1 Like

Thank you for your response