Enforcing connectivity of parts or their complement space during automated design is essential for various manufacturing and functional considerations such as removing powder, wiring internal components, and flowing internal coolant. The global nature of connectivity makes it difficult to incorporate into generative design methods that rely on local decision making, e.g., topology optimization (TO) algorithms whose update rules depend on the sensitivity of objective functions or constraints to locally change the design. Connectivity is commonly corrected for in a post-processing step, which may result in suboptimal designs. We propose a recasting of the connectivity constraint as a locally differentiable violation measure, defined as a “virtual” compliance, modeled after physical (e.g., thermal or structural) compliance. Such measures can be used within TO alongside other objective functions and constraints, using a weighted penalty scheme to navigate tradeoffs. By carefully specifying the boundary conditions of the virtual compliance problem, the designer can enforce connectivity between arbitrary regions of the part’s complement space while satisfying a primary objective function in the TO loop. We demonstrate the effectiveness of our approach using both 2D and 3D examples, show its flexibility to consider multiple virtual domains, and confirm the benefits of considering connectivity in the design loop rather than enforcing it through post-processing.