jaxball / k-shortest-paths

Factory code exported from code.google.com/p/k-shortest-paths
0 stars 1 forks source link

Null Pointer Exception in YenTopKShortestPathsAlg #5

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Execute the YenTopKShortestPathsAlgTest JUnit test with the following:
- the attached network file as data input.
- //look for the KShortestPaths between node 1 and node 3
   List<Path> shortest_paths_list = yenAlg.get_shortest_paths(
    graph.get_vertex(1), graph.get_vertex(3), k);
where is k >=5
the problem appears with other node pairs

What is the expected output? What do you see instead?
Null pointer exception: line 207 class YenTopKShortestPathsAlg

What version of the product are you using? On what operating system?
Java version 0.9 of the project, Windows XP, java version 1.6.0_03

Please provide any additional information below.
Surrounding the code between line 207 and 215 with:

if (dijkstra_alg.get_start_vertex_distance_index().get(cur_recover_vertex)
!= null 
     && dijkstra_alg.get_start_vertex_distance_index().get(succ_vertex) !=
null) {
    ........
}

seems to solve the issue, however I didn't go through the code to see if
it's the correct way to do it.

Thanks

Original issue reported on code.google.com by yharzal...@gmail.com on 12 Aug 2008 at 5:27

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thanks a lot for your post.
There was a bug in the previous version of implementation. Please use the latest
version of the package. 
If you have any question, please let me know. 

Original comment by yan.qi....@gmail.com on 24 Aug 2008 at 1:36