In the following problem, goods will be transported from farmers to stores. I know how to minimise the transport costs in such problems.
The complication comes because the goods have to go to some warehouses beforehand.
What will be the purpose function and limitations? Ed: I think he means 'objective function' and 'constraints'.
Costs are given by the following tables:



It appears that the goods are taken from the farmers to collection points, then from the collection points to the warehouses and finally from the warehouses to the shops/stores.
Provided there are no limits to how much can be taken to each collection point or warehouse, then this can be simplified by first finding the cheapest path from each farmer to each shop.
For example, to get from farmer R1 to shop M1 we need to consider the six possible alternatives:
R1 - P1 - E1 - M1: costs $8+3+2 = 13$
R1 - P1 - E2 - M1: costs $8+2+5 = 15$
R1 - P2 - E1 - M1: costs $4+4+2 = 10$
R1 - P2 - E2 - M1: costs $4+5+5 = 14$
R1 - P3 - E1 - M1: costs $1+6+2 = 9$
R1 - P3 - E2 - M1: costs $1+1+5 = 7$
So the cheapest way to get from R1 to M1 costs 7 units.