Generalized Sobolev IPM for Graph-Based Measures