# Return to Answer

 2 additional considerations edited Apr 9 '13 at 21:01 GlenH7♦ 34.2k1313 gold badges101101 silver badges159159 bronze badges Ignoring the outliers of your question that Telastyn brings up, it sounds like you have a variation on the knapsack problem. Fortunately, it's a pretty well documented algorithm. From Wikipedia Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. There are some potentially relevant variations listed in that article along with an additional list of knapsack problems One variation of the knapsack problem is the multi-objective knapsack problem. The ant colony algorithm is suggested as a means of solving that problem. The ant colony approach might be the easiest way for you to avoid the NP-hard aspects of your question. I could also see considering your problem as an extreme variant of the traveling salesman problem. Each city to visit is really a song that you want played, but I'm not sure how you would specify the intervals between artists. This suggestion is also related to / can be solved by the ant colony approach. Ignoring the outliers of your question that Telastyn brings up, it sounds like you have a variation on the knapsack problem. Fortunately, it's a pretty well documented algorithm. From Wikipedia Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. There are some potentially relevant variations listed in that article along with an additional list of knapsack problems Ignoring the outliers of your question that Telastyn brings up, it sounds like you have a variation on the knapsack problem. Fortunately, it's a pretty well documented algorithm. From Wikipedia Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. There are some potentially relevant variations listed in that article along with an additional list of knapsack problems One variation of the knapsack problem is the multi-objective knapsack problem. The ant colony algorithm is suggested as a means of solving that problem. The ant colony approach might be the easiest way for you to avoid the NP-hard aspects of your question. I could also see considering your problem as an extreme variant of the traveling salesman problem. Each city to visit is really a song that you want played, but I'm not sure how you would specify the intervals between artists. This suggestion is also related to / can be solved by the ant colony approach. 1 answered Apr 9 '13 at 20:43 GlenH7♦ 34.2k1313 gold badges101101 silver badges159159 bronze badges Ignoring the outliers of your question that Telastyn brings up, it sounds like you have a variation on the knapsack problem. Fortunately, it's a pretty well documented algorithm. From Wikipedia Given a set of items, each with a weight and a value, determine the number of each item to include in a collection so that the total weight is less than or equal to a given limit and the total value is as large as possible. There are some potentially relevant variations listed in that article along with an additional list of knapsack problems