Dynamic version of earth movers' distance