[ 
https://issues.apache.org/jira/browse/SPARK-5343?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ankur Dave resolved SPARK-5343.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 1.3.0

Issue resolved by pull request 4478
https://github.com/apache/spark/pull/4478

> ShortestPaths traverses backwards
> ---------------------------------
>
>                 Key: SPARK-5343
>                 URL: https://issues.apache.org/jira/browse/SPARK-5343
>             Project: Spark
>          Issue Type: Bug
>          Components: GraphX
>    Affects Versions: 1.2.0
>            Reporter: Michael Malak
>             Fix For: 1.3.0
>
>
> GraphX ShortestPaths seems to be following edges backwards instead of 
> forwards:
> import org.apache.spark.graphx._
> val g = Graph(sc.makeRDD(Array((1L,""), (2L,""), (3L,""))), 
> sc.makeRDD(Array(Edge(1L,2L,""), Edge(2L,3L,""))))
> lib.ShortestPaths.run(g,Array(3)).vertices.collect
> res1: Array[(org.apache.spark.graphx.VertexId, 
> org.apache.spark.graphx.lib.ShortestPaths.SPMap)] = Array((1,Map()), (3,Map(3 
> -> 0)), (2,Map()))
> lib.ShortestPaths.run(g,Array(1)).vertices.collect
> res2: Array[(org.apache.spark.graphx.VertexId, 
> org.apache.spark.graphx.lib.ShortestPaths.SPMap)] = Array((1,Map(1 -> 0)), 
> (3,Map(1 -> 2)), (2,Map(1 -> 1)))
> The following changes may be what will make it run "forward":
> Change one occurrence of "src" to "dst" in
> https://github.com/apache/spark/blob/master/graphx/src/main/scala/org/apache/spark/graphx/lib/ShortestPaths.scala#L64
> Change three occurrences of "dst" to "src" in
> https://github.com/apache/spark/blob/master/graphx/src/main/scala/org/apache/spark/graphx/lib/ShortestPaths.scala#L65



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to