Seed labels in Label Propagation Algorithm


I try to run Label Propagation with my data in Neo4j.

I have two types of nodes : "Articles" and "Keyword"
I have one relationship that link nodes keyword with nodes articles : "Appears_in"

Some articles has labels (string labels) and I don't know how to put this labels in seed labels.

I also don't know how to call LPA with two types of nodes.

Can you help me ?

Thank you

Can you share your code? And those seed labels will need to be numeric values as far as I'm aware, so you might need to translate the string values to numbers.

Once you've done that you need to specify the seedProperty before you call the algorithm -

1 Like


This is what I have in my database. But I don't know how to code it to call the Label Propagation Algorithm. I think I need to call the LPA in my Jupyter Notebook in order to translate the string values to numbers and then put them in seed property.

I need to call the LPA with seed labels, weight property in the relationship and two types of nodes.

Have you already installed the Graph Data Science Library? You can find installation instructions here -

Once you've done that you can run this query:

call gds.list("") and you should see a list of the available procedures.

Label Propagation documentation is here:

1 Like

Yes I already installed the GDS library. Thank you very much for your answer. Do you know if it is possible to call algorithms from Neo4j in a jupyter notebook ?

Yes - you can either do that by using the Neo4j Python driver and execute GDS queries using that...or yo could use a library like pygds -

1 Like

Thank you very much, I'm going to try it