From: Joris K. <de...@gm...> - 2012-11-01 16:44:07
|
Dear, It seems that the StoerWagnerMinimumCut is bugged in jgrapht 0.8.3. Attached are two small code samples, both resulting in a runtime error. Sample Test2. The graph contains just 2 vertices, joined with an edge. StoerWagner fails to return a minimum cut for this trivial case. When a third vertex+edge is added, StoerWagner works correctly. Suggestion: either verify that this is a bug, or specify in the documentation that the graph requires at least 3 vertices and 2 edges. Sample Test. StoerWagner's constructor takes a WeightedGraph<V,E> graph. So per definition, I should be able to run it on a DefaultDirectedWeightedGraph. This however results in a runtime error: Exception in thread "main" java.lang.NullPointerException at org.jgrapht.graph.AbstractBaseGraph.setEdgeWeight(Unknown Source) at org.jgrapht.alg.StoerWagnerMinimumCut.<init>(Unknown Source) at algorithms.mip.Test.<init>(Test.java:37) at algorithms.mip.Test.main(Test.java:44) When I however switch the DefaultDirectedWeightedGraph to a SimpleWeightedGraph, everything works fine again. Suggestion: either verify that this is a bug, or change the constructor of the class such that it only accepts a SimpleWeightedGraph. br, Joris Ps. The bug report link on the home page of jgrapht returns an error: Permission Denied Access to this page is restricted (either to project members or to project administrators) and you do not meet the requirements to access this page. Please contact the administrator of this project for further assistance. |