Jannat Arora
Jannat Arora

Reputation: 2989

Weighted page rank graph representation

I have a graph like:

(A, 900, B) //implying it takes 900 hours to move from task A to task B
(B, 800, C) // implying it takes 800 hours to move from B to C.

Now I assume in my page rank algorithm task C should have higher page rank. But it is not happening. I am using Neo4j's page rank algorithm to import the graph. My question is am I representing the graph in an incorrect way.

I think this is a general problem of representing graphs and calculating page ranks based on them.

Should I represent the graph as:

(A, 900/1700, B) //implying weight of edge is 900/1700, where 1700 is sum of edge weights
(B, 800/1700, C) // implying weight of edge is 800/1700

I also wrote a program in python, but the basic question is the same how to represent the edge graph

Upvotes: 0

Views: 235

Answers (1)

Jack Daniels
Jack Daniels

Reputation: 123

You can use the weight of the edge as the property of the relationship between the two nodes.

(A)-[:CONNECTED_TO {"Time" : 900 }]->(B)

I hope this format helps. For further application, you can refer the docs

Upvotes: 1

Related Questions