parallel tree traversal in C#
#1
Hey Tyson,

I'm currently trying to write a multi-threaded function to traverse a tree structure. The function is called continuously  and compute various values, like tree height, node depth, children sum, etc. Most algorythms I found on the web for parallel tree traversal, start from the root, so I need to convert the flat list of particleIDs/parentIDs to a nested tree stucture of objects with a children list property. I use a concurrentDictionary to grab the parenting refs based on ids. For now the performances are not that great :/ using your threaded function or a parallelForeach function give me approximatively the same results.

I was wondering if your bind search functions or your recursive child count function in the propertyTest operator were multi-threaded? and how would you approach the parallel "flat list to tree" and tree traversal problems..?

here is the method I use with concurrentDictionary to build the tree structure:
.txt   flatToTree.txt (Size: 2.57 KB / Downloads: 234)
ps: couldn't add a .cs attachement and can't even type code on forum posts..
  Reply


Forum Jump: