###### tags: `learning` # Algorithm Homework 6 CH5: 13, 18, 26, 33, CH6: 1, 4 ## 5.13 ### Sum of Subsets exercise 5.13 from section 5.4 Use the Backtracking algorithm for the Sum-of-Subsets problem (Algorithm 5.4) to find all combinations of the following numbers that sum to `target = 52`: ``` w[0] = 2; w[1] = 10; w[2] = 13; w[3] = 17; w[4] = 22; w[5] = 42; ``` Show the actions step by step. #### Java source code https://github.com/y56/algo_neapolitan_exercises/blob/master/Ch5_13SumOfSubsets.java #### print-out https://github.com/y56/algo_neapolitan_exercises/blob/master/Ch5_13SumOfSubsets.java.out ## 5.18 ### m-Coloring exercise 5.18 from section 5.5 Use the Backtracking algorithm for the m-Coloring problem (Algorithm 5.5) to find all possible colorings of the graph below using the three colors red, green, and white. Show the actions step by step. ``` v_0 --- v_1 --- v_2 | | | v_3 --- v_4 --- v_5 ``` #### Java source code https://github.com/y56/algo_neapolitan_exercises/blob/master/Ch5_18mColoring.java #### print-out https://github.com/y56/algo_neapolitan_exercises/blob/master/Ch5_18mColoring.java.out