0

I have a assignment on Knapsack(tree and bound) and went online to find out how to code tree and bound
in c++ but most of the resource are all theories.

Thus I don't know how to begin coding and need some help to start off.

3
Contributors
4
Replies
14
Views
4 Years
Discussion Span
Last Post by Hiroshe
0

I beleive you're asking about how to solve the knapsack problem with a branch and bound algorithm (using proper terminology will get you better results). Yes, most of the resources are theories, because how you implement the algorithm depends on the problem being solved (not to say that you can't implement B&B in a higher order). This page has a nice illistration of the proccess.

So, the first thing, before you even start coding, would be to decide how you want to branch, and how you want to bound. Once you've decided on paper how you want to do this, start implementing them. Test it against some cannidate solutions and see how well they work. Now implementing the rest of the algortihm should become more mechanical.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.