Question

I am trying to create a Delegate Forest in which the nodes appear in a pre-sorted order. I can currently create a forest and display it, however the order of the nodes changes between runs.

I can set the order of nodes in individual trees by using a DirectedOrderedSparseMultigraph (as suggested here: JUNG: placing tree nodes in order) but I am unsure how to handle the Forest as a whole.

Currently the code I am using to generate the DelegateForest is as follows:

this.forest = new DelegateForest();

whereas the code I think I need is:

this.forest = new DelegateForest(aDirectedOrderedSparseMultigraph);

basically what I'm asking is how do I create a DirectedOrderedSparseMultigraph which contains multiple trees / DirectedOrderedSparseMultigraph's?

Was it helpful?

Solution

You shouldn't have to do anything special. Just create a DOSM and pass that in, and DelegateForest will take care of it. The backing DOSM instance will have one component for each tree in your forest, but you shouldn't have to care about any of that.

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