views:

48

answers:

1

I'm a big fan of JGraphT, a Java library for graphs. Could anyone recommend a similar Java library for trees? Preferrably FOSS.

What I need is a good API, preferrably typesafe with generics which allows modelling different kinds of trees (with some user data attached to verticies/edges) and run different algorithms and operations on these trees. For instance, traverse or balance.

At the moment I'm not interested in visualization of trees.

A: 

Jung, IMO, is a much better implementation of graph data structure than jgraph. It has implementations for Trees as well.

NOTE: I have utilized both Jung and jgraph in the same project effectively. I use Jung for heavy lifting on working with the model, and use Jgraph to be the UI to display the graph.

harschware
Please distinguish JGraphT (http://www.jgrapht.org/) which I was referring to and JGraph which is a different thing.
lexicore
oops, my oversight. Yes, they are different.
harschware