Group buying offers products at significantly reduced prices on the condition that a pre-specified number of buyers would make the purchase. Given the ever-increasing popularity of mobile devices and applications coupled with the typically high price-sensitivity of a significant percentage of users, group buying in mobile environments has the potential to attain dramatically increasing popularity. However, existing solutions for group buying typically involve web-based portals, which are not capable of handling user mobility. Hence, this work proposes an end-to-end mobile group-buying system that can be used for targeted decentralized advertisement and discovery of group buying deals, and group formation to avail a deal. The key contributions are three-fold. First, it proposes an ILP (Integer Linear Programming)-based optimal algorithm for the problem of efficiently forming groups of buyers with the objective of maximizing the overall utility of the solution. Second, it proposes a greedy algorithm for the same problem since solving ILP can take significant time for some problem instances. The greedy algorithm takes an input parameter, which can be tweaked to trade-off its optimality with its running time. Third, performance study shows that the proposed algorithms exhibit good performance in terms of the number of groups formed w.r.t. The requests in the system. Notably, the greedy algorithm provides near-optimal solution and runs significantly faster than the ILP-based optimal algorithm. © 2016 IEEE.