0

earth movers algorithm for histogram comparison is based on the producer-consumer problem

Suppose we have m producers and each producer comes with a weight representing the amount of product he has. We denote producer set P as: P = {(p1, w1), ...,(pm, wm)} Suppose we also have n customers and each consumer comes with a weight indicating the amount of product he needs. We denote the consumer set C as: C = {(c1, w1), ..., (cn, wn)}

in analogy to the histogram comparison problem, we have 2 histograms, each histogram is a vector of a bin, and the amount of pixels in that bin, and the 2 histogram vectors are the producers vector and the consumer vector

also consider we already have a distance matrix D of size m X n, we want to calculate the flow matrix that describes how much "product" are to be moved from every producer to every consumer, where the total sum of this flow matrix should be minimized.

i tried and failed to find an algorithm (preferebly an implementation in python) to calculate this flow matrix.

if anyone knows or can point me in the right direction i would really appreciate it

thanks

Shahaf Stein
  • 165
  • 2
  • 14
  • 1. I didn't understand where the producer-consumer part comes in. Say you had a hypothetical (Python) solver for calculating earth movers, why wouldn't it solve it? 2. Are your weights discrete or continuous? – Ami Tavory Oct 20 '16 at 19:51
  • No, more like i'm trying to implement a different kind of earth movers, and thats why im deconstructing the pieces of the algorithm. and the producer-consumer part comes from having 2 vectors, one with producers and how much product they have, and the other with consumers and how much product they want to consume, and lastly the distance matrix between each producer to each consumer. i need to calculate the minimum cost of transferring all the products from the producers to the consumers – Shahaf Stein Oct 21 '16 at 07:37

0 Answers0