can anyone plz help me find the variable size solution for sum of subsets problem using backtracking

Recommended Answers

All 2 Replies

Sure, but first you'll have to help yourself. We won't do it for you, so show what you've considered so far and why you think it's right or wrong and what you're stuck on.

in general when we consider a set of numbers(weights)....the number of subsets whose sums are m have to be found out.
For example let there b a set of numbers {5,10,12,13,15,18}(ascending order) and the value of m is 30 then i can select the different pairs as {5,10,15},{5,12,13},{12,18}...these are the variable sized tuples that can b formed
the solution for the fixed sized tuples is formed by either selecting or not selecting the weight i.e.,the solution can b written as {1,1,0,0,1,0},{1,0,1,1,0,0},{0,0,1,0,0,1}
ive got the algorithm to find this fixed sized tuples using backtraking but m not able to formulate an algo for the variable sized tuples using the backtraking technique

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.