OK, I'm starting to understand the shape of the data better.  However, you
say, "the ability to arbitrarily look into any node on the tree and then
walk up it getting all of the parents until root."  What does the query for
this look like and specifically what information do you want returned?
What I'm getting at is, are you only querying by name (e.g. "theta") and
hoping to get all the paths down to all the nodes with a name of "theta",
or do you have some other way of distinguishing between the two theta nodes
in the tree, and you only want the path for one of them?  If the latter,
how are you uniquely identifying the nodes?

Is there any other information you need to access than the the upward path
from a node to the root?


On Mon, Sep 9, 2013 at 9:23 AM, Peter Mancini <peter.manc...@gmail.com>wrote:

> On Sunday, September 8, 2013 11:26:35 PM UTC-5, puzzler wrote:
>>
>>
>> Rather than describing it in terms of how you'd implement it, can you be
>> clearer about the shape of the data and what specific sorts of operations
>> and queries you need to perform quickly on the data?  That would make it
>> easier to brainstorm another way to implement it.
>>
>
> Fair point. Here is an example tree:
>
> {"epsilon"
>  {:entity {:count 1, :name "epsilon", :n 2},
>   :children
>   {"phi" {:entity {:count 1, :name "phi", :n 1}, :children {}}}},
>  "beta"
>  {:entity {:count 1, :name "beta", :n 4},
>   :children
>   {"delta"
>    {:entity {:count 1, :name "delta", :n 3},
>     :children
>     {"theta"
>      {:entity {:count 1, :name "theta", :n 1}, :children {}}}}}},
>  "alpha"
>  {:entity {:count 2, :name "alpha", :n 7},
>   :children
>   {"beta"
>    {:entity {:count 2, :name "beta", :n 6},
>     :children
>     {"theta"
>      {:entity {:count 1, :name "theta", :n 2},
>       :children
>       {"zeta" {:entity {:count 1, :name "zeta", :n 1}, :children {}}}},
>      "delta"
>      {:entity {:count 1, :name "delta", :n 5},
>       :children
>       {"gamma"
>        {:entity {:count 1, :name "gamma", :n 4}, :children {}}}}}}}}}
>
>
> It captures the data perfectly and I can find anything by scanning from
> the root to the leaves. The problem is that I may have 10000 items off of
> my root and high branch perplexity. The solution there is to have a head
> list of each of the entities and the ability to arbitrarily look into any
> node on the tree and then walk up it getting all of the parents until root.
> That isn't possible with this scheme as is. I thought about adding
> references and using them like pointers but then I run into the problem
> that the tree can't be saved to disk and that I would have to recreate it
> every time. So now I am starting to look at more state of the art methods
> and anyone who has a link to a paper they can share that might help would
> be greatly appreciated if they shared it here.
>
> So, I need the ability to follow a pointer to an arbitrary point in the
> tree, read up and get the results, an ability to save the tree in parts or
> whole and read it back. Finally, have the benefits of the data compression
> that comes with trees and the fast ability to get results that come with
> this scheme.
>
> The data that creates the tree above would look like this:
>
> (def transaction-list [[{:name "alpha" :n 7} {:name "beta" :n 6} {:name
> "delta" :n 5} {:name "gamma" :n 4}]
>                        [{:name "alpha" :n 4} {:name "beta" :n 3} {:name
> "theta" :n 2} {:name "zeta" :n 1}]
>                        [{:name "beta" :n 4} {:name "delta" :n 3} {:name
> "theta" :n 1}]
>                        [{:name "epsilon" :n 2} {:name "phi" :n 1}]])
>
>
>  --
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@googlegroups.com
> Note that posts from new members are moderated - please be patient with
> your first post.
> To unsubscribe from this group, send email to
> clojure+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to