Zadanie. |
|
Zorganizować maksymalny dowóz turystów mikrobusami z miasta 1 do miasta 6 w jednostce czasu, jeżeli maksymalny |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dowóz pomiędzy miastem i a j wynosi rij: |
|
|
|
|
|
|
|
r12 |
r13 |
r14 |
r23 |
r24 |
r25 |
r35 |
r45 |
r46 |
r56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
4 |
2 |
8 |
4 |
1 |
2 |
8 |
4 |
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
Na podstawie danych stworzymy macierz przepustowości żeber (maksymalnych potoków) i narysujemy graf połączeń |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Macierz przepustowości |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2 |
3 |
4 |
5 |
6 |
|
|
|
|
|
|
|
|
|
|
|
|
1 |
0 |
7 |
4 |
2 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
2 |
7 |
0 |
8 |
4 |
1 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
3 |
4 |
8 |
0 |
0 |
2 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
4 |
2 |
4 |
0 |
0 |
8 |
4 |
|
|
|
|
|
|
|
|
|
|
|
|
5 |
0 |
1 |
2 |
8 |
0 |
5 |
|
|
|
|
|
|
|
|
|
|
|
|
6 |
0 |
0 |
0 |
4 |
5 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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8 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
Zbiór nienasyconych wierzchołków: |
|
|
|
|
|
|
1|2,3 |
|
2|3,4 |
|
3|. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4|5,6 |
|
5|6 |
- potok nie optymalny. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3|. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tworzymy potok 1-2-4-6 i zwiększamy moc potoku w sieci na min( |
|
|
|
|
|
|
|
|
|
|
|
6 |
4 |
2 |
)= |
2 |
jednostki |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Sieć połączeń: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Potok w sieci: |
|
|
7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tabela potoku: |
|
|
|
|
|
|
Tabela nasyconych żeber: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2 |
3 |
4 |
5 |
6 |
|
|
1 |
2 |
3 |
4 |
5 |
6 |
|
|
|
|
|
|
|
|
1 |
0 |
3 |
2 |
2 |
0 |
0 |
|
1 |
0 |
4 |
2 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
2 |
-3 |
0 |
0 |
2 |
1 |
0 |
|
2 |
10 |
0 |
8 |
2 |
0 |
0 |
|
|
|
|
|
|
|
|
3 |
-2 |
0 |
0 |
0 |
2 |
0 |
|
3 |
6 |
8 |
0 |
0 |
0 |
0 |
|
|
|
|
|
|
|
4 |
-2 |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ywana pokazuję cięcie minimalne C(A,B) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Zbiór A zawiera wierzchołki {1,2,3} - wynika ze zbioru nienasyconych wierzchołków na ostatnim kroku. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Zbiór B zawiera pozostałe wierzchołki {4,5,6}. Przepustowość cięcia wynosi 2+1+4+2=9. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Solver |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Zmienne decyzyjne: |
|
|
|
|
|
Funkcja celu |
|
|
|
Ograniczenia |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
x12 |
7 |
|
|
|
Z= |
8,99999999996458 |
---> max |
|
|
1 |
8,99999999996458 |
= |
8,99999999996458 |
|
|
r12 |
7 |
|
|
|
|
|
|
|
|
|
|
x13 |
-3,54170026639622E-11 |
|
|
|
|
|
|
|
|
2 |
7 |
= |
7,00000000005403 |
|
|
r13 |
4 |
|
|
|
|
|
|
|
|
|
|
x14 |
2 |
|
|
|
|
|
|
|
|
3 |
2,00000000001861 |
= |
2 |
|
|
r14 |
2 |
|
|
|
|
|
|
|
|
|
|
x23 |
2,00000000005403 |
|
|
|
|
|
|
|
|
4 |
6 |
= |
6 |
|
|
r23 |
8 |
|
|
|
|
|
|
|
|
|
|
x24 |
4 |
|
|
|
|
|
|
|
|
5 |
5,0000000000373 |
= |
5 |
|
|
r24 |
4 |
|
|
|
|
|
|
|
|
|
|
x25 |
1 |
|
|
|
|
|
|
|
|
6 |
8,9999999999627 |
= |
8,99999999996458 |
|
|
r25 |
1 |
|
|
|
|
|
|
|
|
|
|
x35 |
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r35 |
2 |
|
|
|
|
|
|
|
|
|
|
x45 |
2,0000000000373 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r45 |
8 |
|
|
|
|
|
|
|
|
|
|
x46 |
3,9999999999627 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r46 |
4 |
|
|
|
|
|
|
|
|
|
|
x56 |
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r56 |
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Tabela potoku: |
|
|
|
|
|
|
Tabela nasyconych żeber: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
2 |
3 |
4 |
5 |
6 |
|
|
1 |
2 |
3 |
4 |
5 |
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
0 |
7 |
-3,54170026639622E-11 |
2 |
0 |
0 |
|
1 |
0 |
0 |
4,00000000003542 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
-7 |
0 |
2,00000000005403 |
4 |
1 |
0 |
|
2 |
14 |
0 |
5,99999999994597 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
3,54170026639622E-11 |
-2,00000000005403 |
0 |
0 |
2 |
0 |
|
3 |
3,99999999996458 |
10,000000000054 |
0 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
-2 |
-4 |
0 |
0 |
2,0000000000373 |
3,9999999999627 |
|
4 |
4 |
8 |
0 |
0 |
5,9999999999627 |
3,73039377166151E-11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
0 |
-1 |
-2 |
-2,0000000000373 |
0 |
5 |
|
5 |
0 |
2 |
4 |
10,0000000000373 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
0 |
0 |
0 |
-3,9999999999627 |
-5 |
0 |
|
6 |
0 |
0 |
0 |
7,9999999999627 |
10 |
0 |
|
|
|
|
|
|
|
|