aditya-grover / node2vec

http://snap.stanford.edu/node2vec/
MIT License
2.6k stars 912 forks source link

Find a error when creating the edge2attr variable #79

Open wsgtcyx opened 4 years ago

wsgtcyx commented 4 years ago

Hello! In the file "node2vec/node2vec_spark/src/main/scala/com/navercorp/Node2vec.scala", in the "randomWalk" function, I saw the edge2attr created and s"${edgeTriplet.srcId}${edgeTriplet.dstId}" as the key of edge, which is not a unique key Indeed. such as the edge of Node No.12 between Node No.14, and the edge of Node No1. between No.214. They are two different edges which have the same key? I think when performing the join operation, everything would go wrong.

Hope to receive your reply~ Thank for your code~ !

Super-Louis commented 4 years ago

Hello! In the file "node2vec/node2vec_spark/src/main/scala/com/navercorp/Node2vec.scala", in the "randomWalk" function, I saw the edge2attr created and s"${edgeTriplet.srcId}${edgeTriplet.dstId}" as the key of edge, which is not a unique key Indeed. such as the edge of Node No.12 between Node No.14, and the edge of Node No1. between No.214. They are two different edges which have the same key? I think when performing the join operation, everything would go wrong.

Hope to receive your reply~ Thank for your code~ !

you're right, I found the same error

caomeibaobao1994 commented 4 years ago

yes, how to fix it? Randomwalk result is wrong

snaillp commented 4 years ago

insert a seprator between src and dstId, and same in "(paths.slice(paths.size-2, paths.size).mkString("_"), pathBuffer)" ?