faster encoder:extrema in graph.R, do not call EMD