Question

I have an oriented graph on my hard drive, and I think it may be a forest of polytree.

  • I would like to create independent partitions of connected vertex.
  • I would like to confirm that each partition is a polytree, and to find the roots.

Can JUNG do it for me ? Have you another java graph library to suggest ?

Was it helpful?

Solution

WeakComponentClusterer will divide the graph into connected components.

The library does not include a method to check whether something is a polytree. But it shouldn't be hard for you to whip up some code that uses the JUNG API to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top