Network flow and graph (4)

For the application of the network flow model, we continue to extend more variants and learn more applications of real-world cases.

Portal: Network Flow and Graph (1) Network Flow and Graph (2) Network Flow and Graph (3)

1

Maximum flow and minimum cut

The transportation and distribution problem is a special network flow model with only source set and sink, and there is also a special situation extended from it-the maximum flow and minimum cut problem . Let us define first,

The problem of max flow on a given directed graph G(V,A) is to find the maximum feasible flow between a specific source node s and a specific sink node t, and it is required to satisfy the flow conservation on all other arcs conditions, and the limits for a given arc capacity u.

A st-cut set (ST) in a directed graph G(V,A) is a set of arcs that, after deletion, divide the graph into two non-overlapping parts, some of which are based on the node S⊂ V containing the source node s , and the other part is based on T=V\S including the sink node t. The minimum cut (min cut) problem is to find a st-cut set with the smallest total capacity in the forward arc (i, j), where i∈S, j∈T

The example of maximum flow for building evacuation is introduced.

Below is a proposal for an arena. In an emergency, people in the arena can leave through the doors located on the four sides, which can accommodate 600 people per minute. These doors lead to an external hall, which allows the movement of 350 people per minute in each direction. To get out of the lobby, you need to go through 4 fire stairs, which can accommodate 400 people per minute; or through a tunnel leading to the parking lot, which can accommodate 800 people per minute. What we want to focus on is the maximum evacuation possible under this design.

157a764f8e91ae77907ea20da8db37a9.png

First, add nodes to the arena design diagram to indicate the direction of evacuation:

76990fc27fea3a3eac6b91860dbd6642.png

Then, add information for each node and simplify it to a network flow model (add node 10 after evacuation):

6bba4e4a3ff78863f28d070a0e9f8f4c.png

People flow starts from source node 1 and finally reaches sink node 10. Capacities limit the flow of individual arcs. We want the maximum flow from 1 to 10 under this constraint.

To solve this problem, first introduce knowledge: flow augmenting path

599ef3c05914537697f09c89102edad5.png

The augmented path is actually a chain corresponding to the original graph, and it is a path in the residual directed graph. This concept needs to be clarified. Then we give the algorithm steps:

f84fca26ff97b15335e176b1657259ee.png

Give an example to demonstrate the process of the algorithm. The figure below shows the capacity of each arc from the source node s to the sink node t and the initial feasible flow. Let k=0.

91b012531ca08f73b2f84f8fb457cacf.png

The residual directed graph and update flow at time k=1 are:

426bd96749a9f59d44a5ab7a13db3bb3.png

The residual directed graph and update flow at time k=2 are:

7aeaaa039c4451315dd7b9e7cfce7168.png

The iteration stops at k=3:

adb784b3619f4c70a5824a8b60484110.png

2

Multi-Commodity and Gain-Loss Flow Models

So far, for a special class of linear programming problems, we have proposed network flow models to solve them. And developed the Hungarian algorithm for more special network flow (bipartite graph) and the extended maximum flow-minimum cut problem. These flow models all have an implicit assumption—the models only correspond to a single commodity (single commodity) . For example, the single-commodity bread oven in the OOI case, the single-commodity flow of people in the arena, and the single-commodity work task in the CAM case. These all assume that the demand of the sink node can be satisfied by any supply point.

The multi-commodity flow problem arises when several flows passing through a common network must be kept separate :

The multicommodity flow model is to find a minimum cost flow in which separate commodities are passed through a common network.

For ease of understanding, let’s introduce it with a practical case— sea port ferry multi-commodity flow:

The figure below shows the traffic flow in a community around a harbor. Every morning, people from the three residential areas go to the two industrial centers and the two commercial centers in the area. The table details the number of trips from the origin to the destination. For example, 1250 of the 6000 total daily trips originating from residential node 4 have industrial zone node 7 as their destination.

8b0c38e0edb0b075cf2b743fd43d1127.png

3dad70958d1acec083039ae6c2563441.png

At present, due to geographical constraints, each type of travel has only a single road. The numbers on the arcs in the figure represent the distances (unit: kilometers) between different points. For example, from node 1 to node 7, you must travel around the harbor all the way, passing nodes 2 to 6 on the way. The three residential areas generated a total of 21,100 trips per day, and the total distance traveled along these routes was 399,250 km/day.

Regional planners are considering several improvements to reduce air pollution by reducing the number of kilometers driven. One of the ideas is to use dashed lines (2, 6) and (6, 2) in the figure to represent the ferries. Introducing a single ferry, which could carry 2000 vehicles in each direction during morning peak hours. We want to know how many kilometers of driving distance can be saved by doing this.

Obviously, if the travel is regarded as a flow, the solution obtained in this way is meaningless. Because for the source node 4 and the sink node 7, the algorithm that satisfies the minimum distance is naturally satisfied by selecting node 5 for it. In this problem, the travel needs of each dwelling are irreplaceable.

We have to build separate commodity networks for trips from each of the three sources, but the commodities are still not independent since all share the ferry's 2000 trip capacity. We will give a general model of the multi-commodity flow problem:

7e51b8721fd4de885696b12ea1852146.png

This is obviously a special linear programming problem. In fact, it was able to develop very efficient algorithms. Let's look at another issue first - Technic's cash flow .

Cash flow management deals with cash and similar equivalents such as short-term bonds. The goal is to have cash available when debt needs to be paid, while earning as much interest as possible with funds that are not immediately needed. In some situations, it may also be possible to borrow cash for future income.

The figure below shows a concrete example of Technic. Nodes 1 to 5 represent cash over a period of time, and the number b next to each node represents the net cash demand for each month (unit: thousand dollars). Nodes 6 and 7 represent funds investing in short-term bonds starting with an initial holding of $200,000.

c47b2cd1b6bad1c5ddf0d8f8f7f7ad7a.png

We assume that invested cash returns 0.5% per month and bonds return 0.9% per month, which allows the gain multiplier a shown in the box above the arc to run ahead of time. For example the multiplier a = 1.005 for arc (3, 4), because at a monthly rate of 0.5%, every dollar invested in month 3 becomes $1.005 a month later. By modeling the borrowing of cash, the wear arc can be represented by the backward arc of the cash portion along the way. Assume the company has access to at most $100,000 in cash at 1% monthly interest. Therefore, every dollar borrowed next month to meet current needs corresponds to 1/1.01 = $0.9901 today. Similarly, a similar loss is used to connect the cash and bond nodes. For example, the arc (2, 7) represents the cash invested in bonds in the second week, and the loss multiplier a=0.998 corresponds to an investment tax of 0.2%. A similar loss on arc (7, 2) shows that exchanging bonds for cash would also be taxed at the same rate.

The goal of a management problem is to hold as much money as possible at the end of the planning cycle. Therefore, the only non-zero coefficient in the objective function occurs at node 5's inflow and outflow.

To reduce gain/loss flow applications such as cash management problems to standard network flow forms, we need to incorporate multipliers into the minimum fee network flow form.

978c178e61dae582cd5d7273939e92e9.png

Obviously, this type of problem is also a linear programming problem. It is easy for us to solve to get the optimal solution of the Titanic case.

3

min/max spanning tree

The min/max spanning tree problem (min/max spanning tree) is a simple solution to a special class of linear programming. In order to better demonstrate the content of the algorithm, we still start with a case - wasteland energy (WE)

Wasteland Energy, a natural gas drilling company that drills wells in a piece of wildland it controls, currently wants to build roads to/from the ring location and between the drilling locations. The map below shows the corresponding area and the seven diamond ring locations selected by aerial and satellite analysis. Also shown are identified possible road alignments between the two locations, including the expected cost (in thousands of dollars) of their construction. Only location 1 is able to connect other locations to the outside world. WE hopes to choose a road set with the minimum total cost to generate a network in which there is a road between each pair of locations. The optimal solution to this problem is indicated by the thick red line, and its total cost is $80,000.

6067712ae6d033c63d280702193735d5.png

The optimal solution is a spanning tree, which is a connected subgraph. The minimum/maximum spanning tree is the spanning tree with the minimum and maximum total weight respectively. The wasteland energy example is finding a minimum spanning tree for the road network shown.

Faced with this kind of problem, using the greedy algorithm is very simple and efficient:

718ac7d378df4508be30dd7c66a42c92.png

The following table shows the search process of the energy wasteland using the greedy algorithm:

a5f010b78cfc1b8edef6b0ba1547da1b.png

4

knowledge supplement

Finally, we add some details about the network flow model. We know that if there are discrete variables in the decision variables, the optimization model is an integer program (IP), and if the objective function equation and constraint equation of the integer program are linear, the integer program is called an integer linear program ( integer linear program, ILP). The ILP problem is usually more difficult to deal with than the LP problem, but if an integer programming problem can be expressed in the form of a network, then the algorithm of the minimum cost network flow model can easily obtain an integer solution. This is what we call the "start at integers and stay integers" property of the minimum cost network flow model: when all constrained data are integers, the network flow optimal solution is an integer. This property is called totally unimodular

As for why this is so, we will not show the details here. One more exception here is that for multi-commodity flow and gain/loss flow models, even if all constraints are integers, the optimal solution is not necessarily an integer.

Guess you like

Origin blog.csdn.net/qq_27388259/article/details/129358756