A context in sponsored search is additional information about a query, such as the user’s age, gender or location, that can change an advertisement’s relevance or an advertiser’s value for that query. Given a set of contexts, advertiser welfare is maximized if the search engine runs a separate auction for each context; however, due to lack of competition within contexts, this can lead to a significant loss in revenue. In general, neither separate auctions nor pure bundling need maximize revenue. With this motivation, we study the algorithmic question of computing the revenue-maximizing partition of a set of items under a second-price mechanism and additive valuations for bundles. We show that the problem is strongly NP-hard, and present an algorithm that yields a 1 2 -approximation of the revenue from the optimal partition. The algorithm simultaneously yields a 1 2 -approximation of the optimal welfare, thus ensuring that the gain in revenue is not at the cost of welfare. Final...