The class social network is a momentous factor when it comes to educational, personal and professional student success as well as achieving course learning outcomes. Students and teachers benefit from expanded network connectivity via augmented engagement, more inclusivity, and efficient diffusion of information. We present a novel method for positively influencing the class social network. We develop an in-class grouping strategy based on optimization and sociocentric network analysis that pragmatically expands the students' social networks. In contrast to existing routines, our technique focuses on maximizing individual student opportunities to establish new ties. Based on the knowledge of existing connections, our procedure systematically optimizes the overall number of new ties that can be established during a team project. Our data-driven approach is designed for practical use in class. We show that the underlying combinatorial problem of maximizing unrelated intra-team students can be modeled as a bin packing variant. Using an integer programming formulation, we demonstrate the efficient spreadsheet implementation. We discuss model extensions to account for high-density networks, team balancing, and teammate forcing and forbidding, allowing for hybridization using existing grouping techniques. In an empirical study, we provide evidence for the efficacy of our approach using data from 10 industrial engineering classes with 253 students and 77 project teams - in both face-to-face and virtual modes. We demonstrate the impact of our grouping method compared to random-assignment, self-selection, and maximizing existing intra-team ties. We report an impressive 62% increase of ties compared to only 17% when self-assigning.