The study of network structure is pervasive in sociology, biology, computer science, and many other disciplines. One of the most important areas of network science is the algorithmic detection of cohesive groups of nodes called "communities." One popular approach to finding communities is to maximize a quality function known as modularity to achieve some sort of optimal clustering of nodes. In this paper, we interpret the modularity function from a novel perspective: we reformulate modularity optimization as a minimization problem of an energy functional that consists of a total variation term and an -2 balance term. By employing numerical techniques from image processing and ≤1 compressive sensing-such as convex splitting and the Merriman-Bence-Osher (MBO) scheme-we develop a variational algorithm for the minimization problem. We present our computational results using both synthetic benchmark networks and real data. Copyright © by SIAM.