permaculture playing cards*
The moose likes Java in General and the fly likes How to find Path with Max weight Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to find Path with Max weight" Watch "How to find Path with Max weight" New topic
Author

How to find Path with Max weight

Harry Singh
Ranch Hand

Joined: May 02, 2001
Posts: 124
Hi Guru's,

I have created a tree with all the tree nodes and then stored everything in TreeMap and this way i have created a tree with each tree node having refernce to its parent and children...

So can anyone tell me ho can i traverse this tree to find the maximum weight (profit)by following path in the tree...

Class Tree Node is



and i am constructing a Tree as



so can Anyone telll me how can i find a path which is having max weight..i Actually dont need a path, i just need to get max weight (profit)..

Any ideas...
 
 
subject: How to find Path with Max weight
 
Similar Threads
really need some help here concerning treeNode data types and the like. (data type issues really)
trying to get a richfaces tree to populate nodes using data from xml
Trees in Java
Richfaces tree binding does not seem to work?
TreeNode ClassCastException?