turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- How to sum under a tree structure efficiently?

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2014 05:58 PM

Hi,

I have a tree with the root node at the top. Each node value is a vector of length 100k.

The goal is to find values of all nodes especially the parent nodes. The input

are the leaf node vectors: if there are ten leaves, then there will be ten

vectors of length 100k, or a 100k by 10 matrix . The output will be all the

aggregated vectors: the value of any parent is the sum of all its children and

the value of the leaf is simply the input. If there are 30 nodes in the tree,

the output will be a 100k –by- 30 matrix with each column representing a node. Does anyone know a data structure and

algorithm to do this efficiently? The tree can be any given tree. Thanks.