[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread dor
I think that you can solve it using dynamic programming. For instance, let d[u] = the weight of the subtree rooted at u. Then d[u] = weight[u] + sum_{v is a child of u} d[v]. Now it's your turn to think about how to prove you can compute d[u] for all u as efficiently as possible (e.g., can you fin

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread dor
Those two results hold for the max mean weight subtree problem, don't they? On Jan 29, 4:27 am, LazyBoy <[EMAIL PROTECTED]> wrote: > You can find some of the answers in this paperhttp://arxiv.org/pdf/cs/0503023 > > Some of the results given are: >  - A linear-time algorithm to  solve the problem

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread hc busy
ld); > return max( (max(R,L,R+L)+root.value), R, L, root.value ); > > } > -Original Message- > From: algogeeks@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of Debajit Adhikary > Sent: Tuesday, January 29, 2008 12:40 PM > To: Algorithm Gee

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread hc busy
ld); > return max( (max(R,L,R+L)+root.value), R, L, root.value ); > > } > -Original Message- > From: algogeeks@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of Debajit Adhikary > Sent: Tuesday, January 29, 2008 12:40 PM > To: Algorithm Gee

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Nima Aghdaie
y, January 29, 2008 12:40 PM > To: Algorithm Geeks > Subject: [algogeeks] Re: Finding the subtree with the largest weight > > > On Jan 29, 2008 3:07 PM, Debajit Adhikary <[EMAIL PROTECTED]> wrote: > > > > Lets say I have a weighted tree (with positive, zero and negative &g

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Debajit Adhikary
2:40 PM > To: Algorithm Geeks > Subject: [algogeeks] Re: Finding the subtree with the largest weight > > > On Jan 29, 2008 3:07 PM, Debajit Adhikary <[EMAIL PROTECTED]> wrote: > > > > Lets say I have a weighted tree (with positive, zero and negative > > > weig

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Nima Aghdaie
Behalf Of Debajit Adhikary Sent: Tuesday, January 29, 2008 12:40 PM To: Algorithm Geeks Subject: [algogeeks] Re: Finding the subtree with the largest weight > On Jan 29, 2008 3:07 PM, Debajit Adhikary <[EMAIL PROTECTED]> wrote: > > > Lets say I have a weighted tree (with positive,

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread LazyBoy
You can find some of the answers in this paper http://arxiv.org/pdf/cs/0503023 Some of the results given are: - A linear-time algorithm to solve the problem with positive weights - A proof of NP-Completeness when negative weights are allowed On Jan 29, 2:09 pm, Debajit Adhikary <[EMAIL PROTE

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Debajit Adhikary
> On Jan 29, 2008 3:07 PM, Debajit Adhikary <[EMAIL PROTECTED]> wrote: > > > Lets say I have a weighted tree (with positive, zero and negative > > weights for each node). > > How could I best find the subtree having the maximum weight? On Jan 29, 3:55 am, "Yingjie Xu" <[EMAIL PROTECTED]> wrote: >

[algogeeks] Re: Finding the subtree with the largest weight

2008-01-29 Thread Yingjie Xu
A rooted tree or a general tree? On Jan 29, 2008 3:07 PM, Debajit Adhikary <[EMAIL PROTECTED]> wrote: > > Lets say I have a weighted tree (with positive, zero and negative > weights for each node). > How could I best find the subtree having the maximum weight? > > > --~--~-~--~~-