In the minimum cost flow network, we are looking for homogeneous product distribution from the factory (origin) to the sales market (destination). Suppose the total number of product units produced in each factory and the total number of product required are known. Also, it is not necessary to send the product directly to the destinations, but it is possible to send it to the distribution centers through other places. In addition, the capacity constraints of some transport lines are limited. The goal of this problem is to minimize the cost of transporting products. In course 8 of the Optimization City group, this topic has been investigated.
To solve this problem, there are a few softwares that are difficult to work with them. Optimization City group has designed an online solver of minimum cost flow network. In the following, we review how to use this online solver.
Instructions of using online solver of the minimum cost flow network
The GUI of the online solver of the minimum cost flow network is as follows.
To find the optimal solution to the network flow problem with minimum cost, the required inputs are as follows:
nodes: the number of network nodes.
edges: the number of network arcs. Each edge consists of two directed arcs.
numdemand: are the number of source and destination nodes. If you have a source-destination pair, this parameter will be equal to 2. If two source-destination pairs have a common source node, this parameter will be equal to 3.
nodedemand: the demand values of the source and destination nodes. The matrix has numdemand+1 rows and two columns. In each line, the first component shows the node number and the second component shows the demand amount. If the amount of demand is positive, it means that we have supply, and if the amount of demand is negative, it means that we have demand (request for goods).
nodei: The vector has edges+1 component that stores the beginning node of each arc. The first component is considered to be zero.
nodej: The vector has edges+1 component that stores the end node of each arc. The first component is considered to be zero.
arccost: a vector with edges+1 component that stores the cost of each arc. The first component is considered to be zero. We put a zero number for the components that do not have an arc.
lowbound: the vector has edges+1 component that stores the minimum flow of each arc. The first component is considered to be zero.
upbound: the vector has edges+1 component, which stores the maximum passing current of each arc. The first component is considered to be zero.
Example: To show how to use this online solver, we use the following network. Three numbers are displayed on each arc, which are, respectively, the cost of passing each unit through the arc, the minimum flow passing through the arc, and the maximum flow passing through the arc. Find the minimum cost flow in the network below.
Solution: The input information for the given network is as follows.
Entering information in the online solver of this problem is as follows. Note that each entry should be separated by a comma.
After entering the data, we click on the RUN button.
The result of running the algorithm is as follows.
In the output, “Optimal solution found” means finding the optimal solution. In the next part of the output, it shows the amount of flow from the node (from) to the node (to) with the amount of flow. In the last part, the total cost of the flow is reported as 369.