Subgraph performance issue with large datasets

I am having a performance problem involving grouping large sets of nodes/links into subgraphs. I use the code from your subgraph example in my program. The entire time in issue is spent in the subgraph.addcollection routine. If I keep the number of nodes/links in the subgraph in the low thousands the performance is reasonable. But as I try larger datasets of nodes such as 85000 nodes/140000 links the amount of time to group seems to be exponential. I let it run over 8 hours without completing on some sets. If I do not group the nodes it takes under one minute to load any of these large sets.

Is there anything I can do or will I have to disable grouping for any number of nodes over a certain amount.
Thanks!

Can you give me some numbers for the number of subgraphs, the depth of subgraphs within subgraphs, number of nodes per subgraph, how much links cross subgraphs, etc?



What node class? GoLink or GoLabeledLink?



Can you post or email your code for constructing the hierarchy?

A quick test with 10,000 subgraphs with 4 GoSimpleNodes and 1 link per subgraph: create + display time of about 20 seconds on a 3 year old laptop.





Update: new test. changed “doc.gif” icon to GoRectangle. 10,000 subgraphs with 100 nodes each. (no links… so a major missing piece there). But I’m creating and displaying 100,000 nodes in about 35 seconds.



something to look at: how heavyweight are your derived node classes? If you swap out your node class for a GoSimpleNode, do the times improve? What if you don’t create links?

I use GoIconic nodes and GoLink links. I do use classes based on your classes with added variables but they are not that extensive. I can not post the code since I work in a classified environment.

The problem is not the number of subgraphs. The number rarely exceeds 5 or 6 and is often just 1,2, or 3. There can be two levels of subgraphs but its most often just one. Its the number of nodes and links in the subgraphs that is the problem. Sometimes there will be multiples of 10,000 plus nodes and 10,000 plus links.
Like I said if I draw them without subgraphs its very fast - usually under 20 seconds.
I also have problems when I have an existing graph and the user selects a couple thousand nodes to group in a subgraph. That is also very slow.
I do set skipsundomanager to true when I group and I made sure I don't have any code executing. Its just the sg.addcollection routine used in the same Makesubgraph routine that I copied from your example.
I can put a warning or not group over a certain size if performance is going to be an issue. I understand with large datasets the performance is going to be slow. Its just that without grouping the performance is fine while the grouping will take hours. I hope I am doing something wrong but I've tried to make sure I have no code executing and its just the grouping.
I appreciate the help.

It would sure help if I could reproduce what you’re seeing.



ok… try these things.



replace your node’s icon with a rectangle.



GoRectangle rect = new GoRectangle();

rect.Size = new SizeF(15, 15); // or whatever size makes sense to you



and (if you can) comment out the link creation. Let’s see if the problem exists just with very simple nodes.

If I switch to very large numbers of children in the subgraphs, I’m starting to see what you are. Let me spend some time investigating.

I’ve emailed you some code to try.

The code worked and it is fast now. Almost the same as without grouping. I really appreciate the prompt support. This was the last big performance issue I had and now I am really excited about my next release with all the speed improvements.

Thank You!!!!!