gpt4 book ai didi

java - 推荐一个免费的Java库来构建树并获取叶节点之间的路径?

转载 作者:太空宇宙 更新时间:2023-11-04 08:15:12 24 4
gpt4 key购买 nike

您能推荐一个用于创建树的 Java 库吗?我正在寻找一个库,它可以计算叶节点之间的各种路径,报告树具有的叶节点的数量,以及其他实用方法。

最佳答案

尝试jgrapht 。来自网页:

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

  • directed and undirected graphs.
  • graphs with weighted / unweighted / labeled or any user-defined edges.
  • various edge multiplicity options, including: simple-graphs, multigraphs, pseudographs.
  • unmodifiable graphs - allow modules to provide "read-only" access to internal graphs.
  • listenable graphs - allow external listeners to track modification events.
  • subgraphs graphs that are auto-updating subgraph views on other graphs.
  • all compositions of above graphs.

Although powerful, JGraphT is designed to be simple and type-safe (via Java generics). For example, graph vertices can be of any objects. You can create graphs based on: Strings, URLs, XML documents, etc; you can even create graphs of graphs!

其他SO users report成功 Jung 。我对他们的 API 进行了 30 秒的仔细审查,建议您应该开始 HERE .

关于java - 推荐一个免费的Java库来构建树并获取叶节点之间的路径?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10550122/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com