0

我正在尝试使用 WebGraph 框架压缩图形。我已经设置了我需要的罐子,并使用以下代码:

ImmutableGraph ig = ArcListASCIIGraph.load(BoldiTest.class.getResource("/citation-csconf-mult5-PaperJSON.graph.txt").getFile());
System.out.println(ig.numNodes()+" "+ig.numArcs());
ImmutableGraph.store(BVGraph.class, ig, "output");

该图已正确加载,但无法为我感兴趣的图存储。对于一个小得多的图(3 个弧),一切顺利,所以我猜代码是正确的。

我在下面提供堆栈跟踪。有任何想法吗?(数字是节点和弧)

124538 249755 
Exception in thread "main" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at it.unimi.dsi.big.webgraph.ImmutableGraph.store(ImmutableGraph.java:623)
    at it.unimi.dsi.big.webgraph.ImmutableGraph.store(ImmutableGraph.java:638)
    at gr.di.uoa.a8.boldi.BoldiTest.main(BoldiTest.java:22)
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at it.unimi.dsi.big.webgraph.ImmutableGraph.store(ImmutableGraph.java:619)
    ... 2 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
    at it.unimi.dsi.big.webgraph.BVGraph.updateBins(BVGraph.java:1701)
    at it.unimi.dsi.big.webgraph.BVGraph.storeInternal(BVGraph.java:1808)
    at it.unimi.dsi.big.webgraph.BVGraph.store(BVGraph.java:1650)
    at it.unimi.dsi.big.webgraph.BVGraph.store(BVGraph.java:1678)
    at it.unimi.dsi.big.webgraph.BVGraph.store(BVGraph.java:1690)
    ... 7 more
4

1 回答 1

0

在消除重复边并对输入文件进行排序后,我设法存储了图形。

于 2013-10-13T10:48:28.650 回答