hi all,
when using labelPropagation (in neo4j-graph-algorithms-3.5.14.0-standalone),i met a problem . how to use cypher projection and seedProperty in labelPropagation.
here is the example network.
i tried 3 methods to do label propagation. the second the third used cypher projection and seedProperty seperately and got right answer.the first used both but get wrong answer,which partition all nodes into one community,showed as following.
all codes are here:
MERGE (nAlice:node {id:'Alice'}) SET nAlice.seed_label=52
MERGE (nBridget:node {id:'Bridget'}) SET nBridget.seed_label=21
MERGE (nDoug:node {id:'Doug'}) SET nDoug.seed_label=21
MERGE (nMark:node {id:'Mark'}) SET nMark.seed_label=19
MERGE (nMichael:node {id:'Michael'}) SET nMichael.seed_label=52
MERGE (nAlice)-[:FOLLOW]->(nBridget)
MERGE (nMark)-[:FOLLOW]->(nDoug)
MERGE (nBridget)-[:FOLLOW]->(nMichael)
MERGE (nDoug)-[:FOLLOW]->(nMark)
MERGE (nMichael)-[:FOLLOW]->(nAlice)
MERGE (nAlice)-[:FOLLOW]->(nMichael)
MERGE (nBridget)-[:FOLLOW]->(nAlice)
MERGE (nMichael)-[:FOLLOW]->(nBridget)
CALL algo.labelPropagation(
'MATCH (a:node) RETURN id(a) as id',
'MATCH (a:node)-[r:FOLLOW]-(b:node) RETURN id(a) as source ,id(b) as target',
{graph:'cypher',iterations:50,partitionProperty:'seed_label',write:true,writeProperty:'s1'}
)
CALL algo.labelPropagation(
'MATCH (a:node) RETURN id(a) as id',
'MATCH (a:node)-[r:FOLLOW]-(b:node) RETURN id(a) as source ,id(b) as target',
{graph:'cypher',iterations:50,write:true,writeProperty:'s2'}
)
CALL algo.labelPropagation('node','FOLLOW',
{iterations:50,partitionProperty:'seed_label',write:true,writeProperty:'s3'}
)
hi all, when using labelPropagation (in neo4j-graph-algorithms-3.5.14.0-standalone),i met a problem . how to use cypher projection and seedProperty in labelPropagation. here is the example network.