graphneo4jgraph-theorygiraph

Link Nodes Together


I have a Graph based database like Neo4j or Giraph with say existing 50 vertices and some edges linking them together.

Now i want to introduce a new Vertex - X into the Graph. However the Vertex needs to run a similarity algo against all of the other nodes. The node/nodes with which the similarity score is the highest will form the new edges of the Graph.

My question - 1 - Is this possible to do in Giraph/Neo4j? 2 - Any reference link that you can provide for the implementation of this?

Thanks, Manish


Solution

  • Yes it is possible, e.g. imagine your nodes have a numeric value property:

    MATCH (n:Label)
    WITH abs(n.value-{new_value}) as delta,n
    ORDER BY delta DESC LIMIT 1
    CREATE (m:Label {value:{new_value})-[:LINKED]->(n)