有人对图形算法的Java库有很好的经验吗?我试过JGraph,发现它还行,谷歌中有很多不同的。有哪些是人们在实际生产代码中成功使用或推荐的?

澄清一下,我不是在寻找一个生成图形/图表的库,我在寻找一个有助于图算法的库,例如最小生成树,Kruskal的算法节点,边等。理想情况下,它在一个漂亮的Java OO API中具有一些良好的算法/数据结构。


当前回答

如果你喜欢图形算法,JDSL (Java中的数据结构库)应该足够好了——http://www.cs.brown.edu/cgc/jdsl/

其他回答

如果你喜欢图形算法,JDSL (Java中的数据结构库)应该足够好了——http://www.cs.brown.edu/cgc/jdsl/

If you were using JGraph, you should give a try to JGraphT which is designed for algorithms. One of its features is visualization using the JGraph library. It's still developed, but pretty stable. I analyzed the complexity of JGraphT algorithms some time ago. Some of them aren't the quickest, but if you're going to implement them on your own and need to display your graph, then it might be the best choice. I really liked using its API, when I quickly had to write an app that was working on graph and displaying it later.

http://incubator.apache.org/hama/是Hadoop上用于大量矩阵和图形数据的分布式科学软件包。

试试Annas吧,它是一个开源的图形包,很容易掌握

http://annas.googlecode.com

JGraphT是一个非常简单而强大的Java图形库,它做得非常好,为了消除任何困惑,它与JGraph不同。一些示例代码:

UndirectedGraph<String, DefaultEdge> g =
        new SimpleGraph<String, DefaultEdge>(DefaultEdge.class);

    String v1 = "v1";
    String v2 = "v2";
    String v3 = "v3";
    String v4 = "v4";

    // add the vertices
    g.addVertex(v1);
    g.addVertex(v2);
    g.addVertex(v3);
    g.addVertex(v4);

    // add edges to create a circuit
    g.addEdge(v1, v2);
    g.addEdge(v2, v3);
    g.addEdge(v3, v4);
    g.addEdge(v4, v1);