ä¸é¢å
æ¯æ±è¯-----
ãMCMFé®é¢åæ°å¦æ¨¡åã
å¨ä»ç»æ大æµé®é¢æ¶ï¼æ们å举äºä¸ä¸ªæ大ç©èµè¾éæµé®é¢ãå¦æè¿ä¸ªé®é¢çå·²ç¥æ¡ä»¶è¿å
æ¬æ¯æ¡è¾¹è¿éåä½ç©èµçè´¹ç¨ï¼é£ä¹ææ ·è¿éï¼æè½å¾å°æ大è¿è¾éï¼å¹¶ä¸è¾éè´¹ç¨æå°ï¼è¿ä¾¿æ¯æè°æå°è´¹ç¨æ大æµé®é¢ã
å¨æ大æµçæå
³å®ä¹çåºç¡ä¸ï¼è¥æ¯æ¡æåè¾¹é¤ææ°c(e)ï¼è¡¨ç¤ºè¾¹å®¹éï¼å¤è¿æå¦å¤ä¸ä¸ªææ°w(e)ï¼è¡¨ç¤ºåä½æµæéè´¹ç¨ï¼ï¼å¹¶ä¸å·²æ±å¾è¯¥ç½ç»çæ大æµå¼ä¸ºFï¼ é£ä¹æå°è´¹ç¨æ大æµé®é¢ï¼æ¾ç¶å¯ç¨ä»¥ä¸çº¿æ§è§å模åå 以æè¿°ï¼
Min â w(e)f(e)
eâE
满足 0â¤f(e)â¤c(e) ï¼å¯¹ä¸åeâE
f+(v)=f-(v) ï¼å¯¹ä¸åvâV
f+(x)=F ï¼æ大æµçº¦æï¼
ï¼æf-(y)=F )
ãç®æ³æè·¯ã
解å³æå°è´¹ç¨æ大æµé®é¢ï¼ä¸è¬æ两æ¡éå¾ãä¸æ¡éå¾æ¯å
ç¨æ大æµç®æ³ç®åºæ大æµï¼ç¶åæ ¹æ®è¾¹è´¹ç¨ï¼æ£æ¥æ¯å¦æå¯è½å¨æµé平衡çåæä¸éè¿è°æ´è¾¹æµéï¼ä½¿æ»è´¹ç¨å¾ä»¥åå°ï¼åªè¦æè¿ä¸ªå¯è½ï¼å°±è¿è¡è¿æ ·çè°æ´ãè°æ´åï¼å¾å°ä¸ä¸ªæ°çæ大æµã
ç¶åï¼å¨è¿ä¸ªæ°æµçåºç¡ä¸ç»§ç»æ£æ¥ï¼è°æ´ãè¿æ ·è¿ä»£ä¸å»ï¼ç´è³æ è°æ´å¯è½ï¼ä¾¿å¾å°æå°è´¹ç¨æ大æµãè¿ä¸æè·¯çç¹ç¹æ¯ä¿æé®é¢çå¯è¡æ§ï¼å§ç»ä¿ææ大æµï¼ï¼åæä¼æ¨è¿ãå¦ä¸æ¡è§£å³éå¾ååé¢ä»ç»çæ大æµç®æ³æè·¯ç¸ç±»ä¼¼ï¼ä¸è¬é¦å
ç»åºé¶æµä½ä¸ºåå§æµãè¿ä¸ªæµçè´¹ç¨ä¸ºé¶ï¼å½ç¶æ¯æå°è´¹ç¨çãç¶å寻æ¾ä¸æ¡æºç¹è³æ±ç¹çå¢æµé¾ï¼ä½è¦æ±è¿æ¡å¢æµé¾å¿
é¡»æ¯ææå¢æµé¾ä¸è´¹ç¨æå°çä¸æ¡ãå¦æè½æ¾åºå¢æµé¾ï¼åå¨å¢æµé¾ä¸å¢æµï¼å¾åºæ°æµãå°è¿ä¸ªæµå为åå§æµçå¾
ï¼ç»§ç»å¯»æ¾å¢æµé¾å¢æµãè¿æ ·è¿ä»£ä¸å»ï¼ç´è³æ¾ä¸åºå¢æµé¾ï¼è¿æ¶çæµå³ä¸ºæå°è´¹ç¨æ大æµãè¿ä¸ç®æ³æè·¯çç¹ç¹æ¯ä¿æ解çæä¼æ§ï¼æ¯æ¬¡å¾å°çæ°æµé½æ¯è´¹ç¨æå°çæµï¼ï¼èéæ¸åå¯è¡è§£é è¿ï¼ç´è³æ大æµæ¶ææ¯ä¸ä¸ªå¯è¡è§£ï¼ã
ç±äºç¬¬äºç§ç®æ³åå·²ä»ç»çæ大æµç®æ³æ¥è¿ï¼ä¸ç®æ³ä¸å¯»æ¾æå°è´¹ç¨å¢æµé¾ï¼å¯ä»¥è½¬å为ä¸ä¸ªå¯»æ±æºç¹è³æ±ç¹çæçè·¯å¾é®é¢ï¼æ以è¿éä»ç»è¿ä¸ç®æ³ã
å¨è¿ä¸ç®æ³ä¸ï¼ä¸ºäºå¯»æ±æå°è´¹ç¨çå¢æµé¾ï¼å¯¹æ¯ä¸å½åæµï¼é建ç«ä¼´éè¿ä¸ç½ç»æµçå¢æµç½ç»ãä¾å¦å¾ 1 ç½ç»G æ¯å
·ææå° è´¹ç¨çæµï¼è¾¹æåæ°ä¸ºc(e) , f(e) , w(e)ï¼èå¾ 2 å³ä¸ºè¯¥ç½ç»æµ çå¢æµç½ç»Gâ²ãå¢æµç½ç»ç顶ç¹ååç½ç»ç¸åã æ以ä¸åå建 ç«å¢æµç½ç»çè¾¹ï¼è¥Gä¸è¾¹(uï¼v)æµéæªé¥±ï¼å³f(u,v) ï¼ e(u,v)ï¼åG ' ä¸å»ºè¾¹(u,v)ï¼èµæw ' (u,v)=w(u,v)ï¼è¥Gä¸è¾¹(u, v)å·²ææµéï¼å³f(u,v)ã0ï¼åGâ²ä¸å»ºè¾¹(v,u)ï¼èµæwâ²(v,u) =-w(u,v)ã建ç«å¢æµç½ç»åï¼å³å¯å¨æ¤ç½ç»ä¸æ±æºç¹è³æ±ç¹çæçè·¯å¾ï¼ä»¥æ¤å³å®å¢æµè·¯å¾ï¼ç¶åå¨åç½ç»ä¸å¾ªæ¤è·¯å¾å¢æµãè¿éï¼è¿ç¨çä»ç¶æ¯æ大æµç®æ³çå¢æµåçï¼å¯å¿
é¡»éå®æå°è´¹ç¨çå¢æµé¾å¢æµã
计ç®ä¸æä¸ä¸ªé®é¢éè¦è§£å³ãè¿å°±æ¯å¢æµç½ç»G â²ä¸æè´æè¾¹ï¼å èä¸è½ç´æ¥åºç¨æ å·æ³æ¥å¯»æ¾xè³yçæçè·¯å¾ï¼éç¨å
¶å®è®¡ç®æè´æè¾¹çç½ç»æçè·¯å¾çæ¹æ³æ¥å¯»æ¾xè³yçæçè·¯å¾ï¼å° 大大éä½è®¡ç®æçã为äºä»ç¶éç¨æ å·æ³è®¡ç®æçè·¯å¾ï¼å¨æ¯æ¬¡å»ºç«å¢æµç½ç»æ±å¾æçè·¯å¾å,å¯å°ç½ç»Gçæw(e)åä¸æ¬¡ä¿®æ£ï¼ä½¿å建çå¢æµç½ç»ä¸ä¼åºç°è´æè¾¹ï¼å¹¶ä¿è¯æçè·¯å¾ä¸è³äºå æ¤èæ¹åãä¸é¢ä»ç»è¿ç§ä¿®æ¹æ¹æ³ã
å½æµå¼ä¸ºé¶ï¼ç¬¬ä¸æ¬¡å»ºå¢æµç½ç»æ±æçè·¯å¾æ¶ï¼å æ è´æè¾¹ï¼å½ç¶å¯ä»¥éç¨æ å·æ³è¿è¡è®¡ç®ã为äºä½¿ä»¥å建ç«å¢æµç½ç»æ¶ä¸åºç°è´æè¾¹ï¼éåçåæ³æ¯å° Gä¸ææµè¾¹ï¼f(e)ï¼0ï¼çæw(e)ä¿®æ£ä¸º0ã为æ¤ï¼ æ¯æ¬¡å¨å¢æµç½ç»ä¸æ±å¾æçè·¯å¾åï¼ä»¥ä¸å¼è®¡ç®Gä¸æ°çè¾¹æw " (u,v)ï¼
w " (u,v)=L(u)-L(v)+w(u,v) (*)
å¼ä¸ L(u),L(v) -- 计ç®Gâ²çxè³yæçè·¯å¾æ¶uåvçæ å·å¼ã第ä¸æ¬¡æ±æçå¾æ¶å¦æ(u,v)æ¯å¢æµè·¯å¾ä¸çè¾¹ï¼ åæ®æç è·¯å¾ç®æ³ä¸å®æ L(v)=L(u)+w ' (u,v)=L(u)+w(u,v)ï¼ ä»£å
¥(*)å¼å¿
æ
wã(u,v)=0ã
å¦æ(u,v)ä¸æ¯å¢æµè·¯å¾ä¸çè¾¹ï¼åä¸å®æï¼
L(v)â¤L(u)+w(u,v)ï¼
代å
¥(*)å¼åæ w(u,v)â¥0ã
å¯è§ç¬¬ä¸æ¬¡ä¿®æ£w(e)åï¼å¯¹ä»»ä¸è¾¹ï¼çæw(e)â¥0ï¼ ä¸ææµ çè¾¹ï¼å¢æµé¾ä¸çè¾¹ï¼ï¼ä¸å®æw(e)=0ã以åæ¯æ¬¡è¿ä»£è®¡ç®ï¼è¥ f(u,v)ï¼0ï¼å¢æµç½ç»é建ç«(v,u)è¾¹ï¼è¾¹ææ°w ' (v,u)=-w(u,v) =0ï¼å³ä¸ä¼ååºç°è´æè¾¹ã
æ¤å¤ï¼æ¯æ¬¡è¿ä»£è®¡ç®ç¨(*)å¼ä¿®æ£ä¸åw(e)ï¼ ä¸é¾è¯æ对æ¯ä¸æ¡xè³yçè·¯å¾èè¨ï¼å
¶è·¯å¾é¿åº¦é½åæ ·å¢å L(x)-L(y)ãå æ¤ï¼xè³yçæçè·¯å¾ä¸ä¼å 对w(e)çä¿®æ£èåçååã
ã计ç®æ¥éª¤ã
1. 对ç½ç»G=[V,E,C,W]ï¼ç»åºæµå¼ä¸ºé¶çåå§æµã
2. ä½ä¼´éè¿ä¸ªæµçå¢æµç½ç»Gâ²=[Vâ²,Eâ²,Wâ²]ã
Gâ²ç顶ç¹åGï¼Vâ²=Vã
è¥Gä¸f(u,v)ï¼c(u,v)ï¼åGâ²ä¸å»ºè¾¹(u,v)ï¼w(u,v)=w(u,v)ã
è¥Gä¸f(u,v)ï¼0ï¼åGâ²ä¸å»ºè¾¹(v,u)ï¼wâ²(v,u)=-w(u,v)ã
3. è¥Gâ²ä¸åå¨xè³yçè·¯å¾ï¼åGçæµå³ä¸ºæå°è´¹ç¨æ大æµï¼
åæ¢è®¡ç®ï¼å¦åç¨æ å·æ³æ¾åºxè³yçæçè·¯å¾Pã
4. æ ¹æ®Pï¼å¨Gä¸å¢æµï¼ 对Pçæ¯æ¡è¾¹(u,v)ï¼è¥Gåå¨(u,v)ï¼å(u,v)å¢æµï¼è¥Gåå¨(v,u)ï¼å(v,u)åæµãå¢ï¼åï¼æµåï¼åºä¿è¯å¯¹ä»»ä¸è¾¹æc(e)⥠f(e)â¥0ã
5. æ ¹æ®è®¡ç®æçè·¯å¾æ¶çå顶ç¹çæ å·å¼L(v)ï¼æä¸å¼ä¿® æ¹Gä¸åè¾¹çææ°w(e):
L(u)-L(v)+w(e)âw(e)ã
6. å°æ°æµè§ä¸ºåå§æµï¼è½¬2ã
-----------------
======================
ä¸é¢æ¯è±æ-----
ãMCMF problems and the mathematical modelã
Maximum flow problem in the introduction, we listed one of the largest flow of goods delivery. If this issue also includes the known conditions of delivery of each unit while the cost of goods, then how to transport, to get the most traffic, and transportation costs to a minimum? This is the so-called maximum flow problem minimum cost.
The maximum flow based on the definition, if each side of a first-priority claim to the number of c (e) (that the edge capacity) but also have another weights w (e) (that the unit cost flow), and has been seeking a maximum flow of the network value of F, then the minimum cost maximum flow problem, it is clear the following linear programming model can be used to describe:
Min â w (e) f (e)
e â E
Satisfy 0 ⤠f (e) ⤠c (e), for all e â E
f + (v) = f-(v), for all v â V
f + (x) = F (maximum flow constraints)
(Or f-(y) = F)
ã ãAlgorithm ideas
Solve the minimum cost maximum flow problem, there are two general ways. Way is to use a maximum flow algorithm to calculate the maximum flow, and then based on the cost side, check whether it is possible to balance the flow by adjusting the flow side, so that to reduce the total cost? As long as there is a possibility, on such adjustments. After adjusting for a new maximum flow.
Then, on the basis of the new flow to continue to check and adjust. This iteration continues until no adjustment may be, they will have the minimum cost maximum flow. The characteristics of this line of thought is to maintain the feasibility of the problem (always maintain maximum flow), to promote optimal. Solution to another and in front of the maximum flow algorithm, introduced a similar line of thought, first of all, given the general flow as the initial flow of zero. The cost of the flow to zero, of course, is the smallest cost. And then find a source to the Meeting Point by flow chain, but by the requirements of this chain must be a stream flow of all chain costs by a minimum. If we can find out by flow chain, the chain in the flow by increasing flow, a new flow. The flow will be treated as the initial flow, continue to search for links by increasing stream flow. This iteration continues, until found by flow chain, then the flow is the minimum cost maximum flow. Idea of the characteristics of this algorithm is to maintain the optimal solution of (each of the new fees are the smallest stream flow), but gradually close to the feasible solution (up to maximum flow is a feasible solution when).
As a result of the second algorithm and has introduced close to the maximum flow algorithm and the algorithm by finding the minimum cost flow chain, can be turned into a source to find the shortest path to the Meeting Point, so this algorithm here.
In this algorithm, in order to seek to increase the minimum cost flow chain, the current flow of each, accompanied by the need to establish a network flow by the flow network. For example, Figure 1 is a network G of minimum cost flow, next to parameters c (e), f (e), w (e), and Figure 2 is the network flow by the flow network G '. By the peak-flow network and the same as the original network. By the following principles in accordance with the establishment of the network edge flow: If G in the edge (u, v) is not enough traffic, that is, f (u, v) <e (u, v), then G 'in the building edge (u, v), Empowering w '(u, v) = w (u, v); edge of G if (u, v) has been the flow, that is, f (u, v)> 0, then G' in the building edge (v, u ), to empower the w '(v, u) =- w (u, v). The establishment of the network by streaming, you can seek in this network to the Meeting Point source shortest path, as decided by flow path, and then in the original network by flow in this path. Here, the use of maximum flow algorithm is still the principle of increasing flow, but the cost must be selected by the smallest chain by stream flow.
Calculation, there is a need to address the problem. This is the stream network by G 'the right to have a negative side, thus labeling law can not be directly applied to find x to y of the shortest path, using the right of other negative side computing network approach to the shortest path x to y to find the shortest path, will greatly reduce the computational efficiency. In order to still use the labeling method to calculate the shortest path, each flow set up by the network to achieve the shortest path, the network G can be the right of w (e) an amendment to do so by the stream to build the network will not be a negative right side, and guarantee the shortest path does not change. This modified method described below.
When the flow value is zero, the first built by the shortest path for flow network, the result of non-negative right side, of course, can be used to calculate labeling law. In order to increase flow network after the establishment of a negative time is not right side of the approach taken is to have stream G edge (f (e)> 0) the right to w (e) amendment to 0. To this end, each time a flow network obtained by the shortest path, the following computing G in the right side of the new w "(u, v):
w "(u, v) = L (u)-L (v) + w (u, v) (*)
Where L (u), L (v) - calculation of G 'of the shortest path x to y when u and v the value of the label. For the first time if the shortest path (u, v) is the flow path by the edge, then, according to the shortest path algorithm must have L (v) = L (u) + w '(u, v) = L (u) + w (u, v), substituting into (*) type must
w "(u, v) = 0.
If (u, v) rather than by the side of flow path, it must have:
L (v) ⤠L (u) + w (u, v),
Into the (*)-type, there w (u, v) ⥠0.
Shows that the first amendment to w (e), against either side, there are w (e) ⥠0, and a stream side (by side chain flow), there will be w (e) = 0. Calculated after each iteration, if f (u, v)> 0, by the need to establish the network flow (v, u) edge, edge weights w '(v, u) =- w (u, v) = 0, that is, the right will not be a negative side.
In addition, the calculation of each iteration with (*) fixes all the w (e), it is not difficult to prove that to each path x to y, its all the same to increase the path length L (x)-L (y). Therefore, x and y will not be the shortest path to w (e) the amendment changes.
ã ãCalculation steps
1. On the network G = [V, E, C, W], given the initial value is zero flow streams.
2. Be accompanied by this stream flow network G '= [V', E ', W'].
G 'the vertex-G: V' = V.
If G in f (u, v) <c (u, v), then G 'in the building edge (u, v), w (u, v) = w (u, v).
If G in f (u, v)> 0, then G 'in the building edge (v, u), w' (v, u) =- w (u, v).
3. If G 'does not exist the path x to y, then G is the minimum cost flow of maximum flow,
To stop calculation; otherwise labeling method used to find x to y of the shortest path P.
4. According to P, the increased flow in G: each edge of P of (u, v), if G exists (u, v), then (u, v) by flow; if G exists (v, u), while (v, u) by flow. Increase (decrease) in flow should be on either side to ensure that there is c (e) ⥠f (e) ⥠0.
5. According to the calculation of the shortest path at the time of peak value of the label L (v), press the G-type modification of all the edge weights w (e):
L (u)-L (v) + w (e) â w (e).
6. The new stream as the initial flow to 2
温馨提示:答案为网友推荐,仅供参考