Mathematical morphology (MM) operators can be defined in terms of algebraic sets or as partial differential equations. In this paper, we introduce a novel formulation of MM over weighted graphs of arbitrary topology. The proposed framework recovers local algebraic and PDEs-based formulations of MM and introduces nonlocal configurations. This enables to PDEs-based methods to process any discrete data that can be described by a graph such as high dimensional data defined on irregular domains. Index Terms — Nonlocal, graphs, morphology.