寻找一个简单的 Java API 来创建图形(边 + 节点)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/745048/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 18:59:41  来源:igfitidea点击:

Looking for a simple Java API for creating graphs (edges + nodes)

javaapigraph-theory

提问by David Koelle

I'm trying to find a simple Java API for creating graph relationships. It should have some functionality like addEdge(), addNode(), isConnected(node1, node2), findPaths(node1, node2), etc. I need no UI, just logic.

我试图找到一个简单的 Java API 来创建图形关系。它应该有这样一些功能addEdge()addNode()isConnected(node1, node2)findPaths(node1, node2),等我不需要UI,只是逻辑。

I found a bunch of academic projects, but none seems to be "The Definitive Graph API".

我找到了一堆学术项目,但似乎没有一个是“ The Definitive Graph API”。

Does anyone know about such an API?

有人知道这样的API吗?

采纳答案by Ben S

JGraphTsounds like what you're after.

JGraphT听起来像你想要的。

JGraphT is a free Java graph library that provides mathematical graph-theory objects and algorithms. JGraphT supports various types of graphs.

JGraphT 是一个免费的 Java 图库,提供数学图论对象和算法。JGraphT 支持各种类型的图。

Their API can create graphs from various input and also supports creating graphs using addVertex, addEdge. They support finding shortest paths using various well know algorithms such as Bellman-Ford and Dijkstra They also have a complete javadoc available online.

他们的 API 可以从各种输入创建图形,还支持使用addVertex, 来创建图形addEdge。它们支持使用各种众所周知的算法(例如 Bellman-Ford 和 Dijkstra)来查找最短路径。它们还提供完整的在线 javadoc

回答by MahdeTo

a really decent one can be found here: http://javaddlib.sourceforge.net/jdd/

一个非常体面的可以在这里找到: http://javaddlib.sourceforge.net/jdd/

回答by erickson

Jdigraphis yet anothergraph library.

Jdigraph另一个图形库。

回答by paweloque

JDLSis a great library for Graphs and Datastructures in general. You could also use the Grappalibrary. Its advantage is that it can use the graphVizlibraries for graph layouting.

JDLS是一个很棒的图形和数据结构库。您还可以使用Grappa库。它的优点是可以使用graphViz库进行图形布局。

回答by Marcin Kapusta

Definitly You should try the http://neo4j.org/This is great Graph database written in Java but It can work as a embedded database to very small application too.

绝对你应该尝试http://neo4j.org/这是用 Java 编写的很棒的图形数据库,但它也可以作为嵌入式数据库工作到非常小的应用程序。

This database have everything You need even if you plan to store billions of nodes. Good luck.

即使您计划存储数十亿个节点,该数据库也拥有您需要的一切。祝你好运。

回答by Federico Giorgi

JUNG— the Java Universal Network/Graph Framework - is one of the fastest available (implementing the CERN math library COLT), especially if you want to do graph analysis, centrality measurements (betweennes, pagerank, etc.). Furthermore it allows for network visualization.

JUNG——Java 通用网络/图形框架——是可用的最快的框架之一(实现 CERN 数学库 COLT),特别是如果你想进行图形分析、中心性测量(之间、pagerank 等)。此外,它还允许网络可视化。