0
1 <- 2
1 <- 3
2 <- 3
2 <- 4
3 <- 4

each number represent the node id and each row represent the edge . I need to get the second level neighbor from each node with first level neighbor. So the output will be like this

1 <- 2 3 (3 4) (4)
2 <- 3 4 (4)
3 <- 4

Please help. thanks

  • Can you show what you have and need in real data structure? Also please tag the programming language you are using. – Psidom Dec 09 '17 at 06:40
  • I am using scala in spark. What do you mean with real data structure? – Kristianto Karim Dec 09 '17 at 06:51
  • Real data structure, such as RDD or Array. It's not clear how you want the output to be formatted. Maybe a `Map[Double, Seq[Double]]`? – Psidom Dec 09 '17 at 06:54
  • You can use Pregel API of GraphX. Example, https://blog.knoldus.com/2016/12/22/finding-the-impact-of-a-tweet-using-spark-graphx/ – himanshuIIITian Dec 09 '17 at 14:45

0 Answers0