From: John S. <js...@gm...> - 2012-06-21 20:05:44
|
Hi, Please send messages such as this to the jgrapht-users lists (not me personally). If you submit an isolated JUnit test case demonstrating the problem, there's a better chance of someone being able to help with it. JVS On Mon, Jun 18, 2012 at 2:13 AM, Genliang Guan <gen...@sy...> wrote: > Dear John, > > This is Ron Guan, studying at School of IT, University of Sydney. > > I am using the fantastic JGraphT library, or more specifically the > KShortestPaths, to implement the algorithm proposed at "Multi-Sentence > Compression: Finding Shortest Paths inWord Graphs" > (http://dejanseo.com.au/research/google/36338.pdf). You may just look at > the graph in the paper to understand the ideas. > > The included testing cases work fine, but when I run the examples in the > paper (Hillary sentences), it gives me this error: > graph must contain the start vertex: visit > > I tried to fix it by modifying ConnectivityInspector.pathExists(). > > Originally, it was > > -------------------------------------------------------------------------------------------------------------- > Set<V> sourceSet = connectedSetOf(sourceVertex); > return sourceSet.contains(targetVertex); > -------------------------------------------------------------------------------------------------------------- > > Then I added a few lines to catch the exception: > > ======================================================== > //ron > Set<V> sourceSet = null; > try{ > sourceSet = connectedSetOf(sourceVertex); > } > catch(IllegalArgumentException e) > { > return false; > } > > return sourceSet.contains(targetVertex); > ======================================================== > > This seems fix the problem and gives correct output, but I am not sure what > really happens deep in the algorithm and whether it is a good fix. > > Could you help on this issue? Many thanks! > > > > Best regards, > > Ron > |