We formulate Aubry-Mather theory for Hamiltonians/Lagrangians defined on graphs, study the structure of minimizing measures, and discuss the relationship with weak KAM theory developed in Siconolfi and Sorrentino (2018 Anal. PDE 1 171-211). Moreover, we describe how to transport and interpret these results on networks.