# Return to Answer

 73 deleted 47 characters in body edited Jan 31 '16 at 23:34 user26317 First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is part of another incorrect solution $$5,4,3,3$$ 7=5+2 and 7=4+3 fromand 4 and 3 are in the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is part of another incorrect solution $$5,4,3,3$$ 7=5+2 and 7=4+3 from the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is 7=4+3 and 4 and 3 are in the solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. 72 added 8 characters in body edited Jan 31 '16 at 23:20 user26317 First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is part of another incorrect solution $$5,3,3,2,2$$$$5,4,3,3$$ 7=5+2 and 7=4+3 from the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is part of another solution $$5,3,3,2,2$$ 7=5+2 and 7=4+3 from the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is part of another incorrect solution $$5,4,3,3$$ 7=5+2 and 7=4+3 from the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. 71 added 84 characters in body edited Jan 31 '16 at 23:08 user26317 Find maximal element $$a_{m}$$ from the sum (multi)set. $$P$$, the potential minimal (multi)set is initially empty. Unless there is only one group, represent $$a_{m}$$ in all possible ways as a pair of sums that add up to $$a_{m}$$, $$S_{ij}=\{(a_{i},a_{j})|a_{i}+a_{j}=a_{m}\}$$ Check that all elements from the set of sums are included. Find maximal element $$a_{s}$$ from all $$S_{ij}$$ (meaning together) with the following property: for each $$S_{ij}$$, $$a_{s}$$ is either in $$S_{ij}$$, or we can find $$a_{p}$$ from the set of sums so that $$a_{p}+a_{s}$$ is in $$S_{ij}$$. If it is the case that $$S_{ij}$$ does not contain $$a_{s}$$, just the sum $$a_{s}+a_{p}$$, remove $$a_{p}+a_{s}$$ from $$S_{ij}$$ (or just set a mark to ignore it) and insert $$a_{p}$$ and $$a_{s}$$ in $$S_{ij}$$ instead. If an element is present in every $$S_{ij}$$ remove it from all $$S_{ij}$$ once (or just set a mark to ignore it and not to touch it any longer) and add it to the list of elements of potential minimal set $$P$$. Repeat until all $$S_{ij}$$ are empty If some of $$S_{ij}$$ remains non-empty and we cannot continue, try again the entire procedure fromwith the largest elementmaximum value from all remaining $$S_{ij}$$. Recreate the recursive steps without removals and continue with power set coverage algorithm over $$P$$. (Before this, you can make a safe-check that $$P$$ includes all elements that cannot be represented as a sum of two elements so they must be in underlying set for sure. For example, the minimal element must be in $$P$$.) First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. ThisThe reason is that 7 is part of another solution $$5,3,3,2,2$$ 7=5+2 and 7=4+3 from the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. Find maximal element $$a_{m}$$ from the sum (multi)set. $$P$$, the potential minimal (multi)set is initially empty. Unless there is only one group, represent $$a_{m}$$ in all possible ways as a pair of sums that add up to $$a_{m}$$, $$S_{ij}=\{(a_{i},a_{j})|a_{i}+a_{j}=a_{m}\}$$ Check that all elements from the set of sums are included. Find maximal element $$a_{s}$$ from all $$S_{ij}$$ (meaning together) with the following property: for each $$S_{ij}$$, $$a_{s}$$ is either in $$S_{ij}$$, or we can find $$a_{p}$$ from the set of sums so that $$a_{p}+a_{s}$$ is in $$S_{ij}$$. If it is the case that $$S_{ij}$$ does not contain $$a_{s}$$, just the sum $$a_{s}+a_{p}$$, remove $$a_{p}+a_{s}$$ from $$S_{ij}$$ (or just set a mark to ignore it) and insert $$a_{p}$$ and $$a_{s}$$ in $$S_{ij}$$ instead. If an element is present in every $$S_{ij}$$ remove it from all $$S_{ij}$$ once (or just set a mark to ignore it and not to touch it any longer) and add it to the list of elements of potential minimal set $$P$$. Repeat until all $$S_{ij}$$ are empty If some of $$S_{ij}$$ remains non-empty and we cannot continue, try again the entire procedure from the largest element from all remaining $$S_{ij}$$. Recreate the recursive steps without removals and continue with power set coverage algorithm over $$P$$. (Before this, you can make a safe-check that $$P$$ includes all elements that cannot be represented as a sum of two elements so they must be in underlying set for sure. For example, the minimal element must be in $$P$$.) First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. This does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. Find maximal element $$a_{m}$$ from the sum (multi)set. $$P$$, the potential minimal (multi)set is initially empty. Unless there is only one group, represent $$a_{m}$$ in all possible ways as a pair of sums that add up to $$a_{m}$$, $$S_{ij}=\{(a_{i},a_{j})|a_{i}+a_{j}=a_{m}\}$$ Check that all elements from the set of sums are included. Find maximal element $$a_{s}$$ from all $$S_{ij}$$ (meaning together) with the following property: for each $$S_{ij}$$, $$a_{s}$$ is either in $$S_{ij}$$, or we can find $$a_{p}$$ from the set of sums so that $$a_{p}+a_{s}$$ is in $$S_{ij}$$. If it is the case that $$S_{ij}$$ does not contain $$a_{s}$$, just the sum $$a_{s}+a_{p}$$, remove $$a_{p}+a_{s}$$ from $$S_{ij}$$ (or just set a mark to ignore it) and insert $$a_{p}$$ and $$a_{s}$$ in $$S_{ij}$$ instead. If an element is present in every $$S_{ij}$$ remove it from all $$S_{ij}$$ once (or just set a mark to ignore it and not to touch it any longer) and add it to the list of elements of potential minimal set $$P$$. Repeat until all $$S_{ij}$$ are empty If some of $$S_{ij}$$ remains non-empty and we cannot continue, try again with the maximum value from all $$S_{ij}$$. Recreate the recursive steps without removals and continue with power set coverage algorithm over $$P$$. (Before this, you can make a safe-check that $$P$$ includes all elements that cannot be represented as a sum of two elements so they must be in underlying set for sure. For example, the minimal element must be in $$P$$.) First part of the algorithm may fail, if we have started it on the wrong foot. For example $$2,3,4,5,6,7,8,9,10,11,12,13,15$$ has the basic solution $$2,3,4,6$$ which you get if you start algorithm from 6. However we can start our algorithm from 7, since there is nothing in step 4. that would say not to, and lock ourselves in, the algorithm cannot end properly. The reason is that 7 is part of another solution $$5,3,3,2,2$$ 7=5+2 and 7=4+3 from the first solution. So locked algorithm does not always mean that there is no solution, just to try again with lower initial value. In that case, some ideas about the possible values are hidden within remaining $$S_{ij}$$. That is why we suggested starting from there in case of failure. 70 added 1 character in body edited Jan 31 '16 at 20:40 user26317 69 added 339 characters in body edited Jan 31 '16 at 20:09 user26317 68 added 339 characters in body edited Jan 31 '16 at 20:03 user26317 67 added 1507 characters in body edited Jan 31 '16 at 18:50 user26317 66 added 955 characters in body edited Jan 31 '16 at 1:14 user26317 65 added 14 characters in body edited Jan 31 '16 at 0:35 user26317 64 added 395 characters in body edited Jan 31 '16 at 0:19 user26317 63 added 46 characters in body edited Jan 31 '16 at 0:03 user26317 62 deleted 3989 characters in body edited Jan 30 '16 at 21:51 user26317 61 deleted 3989 characters in body edited Jan 30 '16 at 21:42 user26317 60 deleted 3989 characters in body edited Jan 30 '16 at 21:07 user26317 59 deleted 500 characters in body edited Jan 30 '16 at 1:25 user26317 58 deleted 500 characters in body edited Jan 30 '16 at 1:15 user26317 57 deleted 79 characters in body edited Jan 30 '16 at 0:26 user26317 56 added 61 characters in body edited Jan 30 '16 at 0:15 user26317 55 added 1636 characters in body edited Jan 30 '16 at 0:06 user26317 54 added 38 characters in body edited Jan 29 '16 at 16:26 user26317 53 added 61 characters in body edited Jan 29 '16 at 15:17 user26317 52 added 40 characters in body edited Jan 29 '16 at 14:22 user26317 51 added 40 characters in body edited Jan 29 '16 at 14:16 user26317 50 added 785 characters in body edited Jan 29 '16 at 14:08 user26317 49 added 2602 characters in body edited Jan 29 '16 at 10:11 user26317