Suppose xij is the supply from I factory to J production area.
Ai is the output of I plant bj, and the demand cij freight rate of J area.
Minimum value = sum (cx)
The constraint condition is that the sum of each i xij is ai.
Every JXiji is bj.
It's as simple as that