8.
Найти максимальный поток из вершины X1 в вершину X13
(вариант работы с картинками в файле)
В
начале положим для всех дуг (x,
y)
f(x,y) = 0
Все
дуги є I, так как f(x, y) < c(x, y)
(x1, x2) (x2, x6)
(x6, x9) (x9, x13)
i(x1, x2) = 3 (x1, x2) є IR
i(x2, x6) = 2 (x2, x6) є R
i(x6, x9) = 3 (x6, x9) є IR
i(x9, x13) = 4 (x9, x13) є IR
min{3, 2, 3, 4} = 2
f(x1, x2) = 0 + 2 = 2
f(x2, x6) = 0 + 2 = 2
f(x6, x9) = 0 + 2 = 2
f(x9, x13) = 0 + 2 = 2
(x1, x3) (x3, x6)
(x6, x9) (x9, x13)
i(x1, x3) = 3
i(x3, x6) = 1
i(x6, x9) = 3 – 2 = 1
i(x9, x13) = 4 – 2 = 2
min{3, 1, 1, 2} = 1
f(x1, x3) = 0 + 1 = 1
f(x3, x6) = 0 + 1 = 1
f(x6, x9) = 2 + 1 = 3
f(x9, x13) = 2 + 1 = 3
(x1, x3) (x3, x7)
(x7, x9) (x9, x13)
i(x1, x3) = 3 – 1 = 2
i(x3, x7) = 2
i(x7, x9) = 1
i(x9, x13) = 4 – 3 = 1
min{2, 2, 1, 1} = 1
f(x1, x3) = 1 + 1 = 2
f(x3, x7) = 0 + 1 = 1
f(x7, x9) = 0 + 1 = 1
f(x9, x13) = 3 + 1 = 4
(x1, x4) (x4, x6)
(x6, x10) (x10, x13)
i(x1, x4) = 3 – 0 = 3
i(x4, x6) = 1 – 0 = 1
i(x6, x10) = 2 – 0 = 2
i(x10, x13) = 3 – 0 = 3
min{3, 1, 2, 3} = 1
f(x1, x4) = 1
f(x4, x6) = 1
f(x6, x10) = 1
f(x10, x13) = 1
(x1, x2) (x2, x8)
(x8, x10) (x10, x13)
i(x1, x2) = 3 – 2 = 1
i(x2, x8) = 2 – 0 = 2
i(x8, x10) = 2 – 0 = 2
i(x10, x13) = 3 – 1 = 2
min{1, 2, 2, 2} = 1
f(x1, x2) = 2 + 1 = 3
f(x2, x8) = 0 + 1 = 1
f(x8, x10) = 0 + 1 = 1
f(x10, x13) = 1 + 1 = 2
(x1, x5) (x5, x8)
(x8, x10) (x10, x13)
i(x1, x5) = 3
i(x5, x8) = 3
i(x8, x10) = 2 – 1 = 1
i(x10, x13) = 3 – 2 = 1
min{3, 3, 1, 1} = 1
f(x1, x5) = 0 + 1 = 1
f(x5, x8) = 0 + 1 = 1
f(x8, x10) = 1 + 1 = 2
f(x10, x13) = 2 + 1 = 3
(x1, x3) (x3, x7)
(x7, x11) (x11, x13)
i(x1, x3) = 3 – 2 = 1
i(x3, x7) = 2 – 1 = 1
i(x7, x11) = 2 – 0 = 2
i(x11, x13) = 4 – 0 = 4
min{1, 1, 2, 4} = 1
f(x1, x3) = 2 + 1 = 3
f(x3, x7) = 1 + 1 = 2
f(x7, x11) = 0 + 1 = 1
f(x11, x13) = 0 + 1 = 1
(x1, x4) (x4, x7)
(x7, x11) (x11, x13)
i(x1, x4) = 3 – 1 = 2
i(x4, x7) = 2 – 0 = 2
i(x7, x11) = 2 – 1 = 1
i(x11, x13) = 4 – 1 = 3
min{2, 2, 1, 3} = 1
f(x1, x4) = 1 + 1 = 2
f(x4, x7) = 0 + 1 = 1
f(x7, x11) = 1 + 1 = 2
f(x11, x13) = 1 + 1 = 2
(x1, x5) (x5, x8)
(x8, x11) (x11, x13)
i(x1, x5) = 3 – 1 = 2
i(x5, x8) = 3 – 1 = 2
i(x8, x11) = 1 – 0 = 1
i(x11, x13) = 4 – 2 = 2
min{2, 2, 1, 2} = 1
f(x1, x5) = 1 + 1 = 2
f(x5, x8) = 1 + 1 = 2
f(x8, x11) = 0 + 1 = 1
f(x11, x13) = 2 + 1 = 3
(x1, x4) (x4, x7)
(x7, x12) (x12, x13)
i(x1, x4) = 3 – 2 = 1
i(x4, x7) = 2 – 1 = 1
i(x7, x12) = 1 – 0 = 1
i(x12, x13) = 3 – 0 = 3
min{1, 1, 1, 3} = 1
f(x1, x4) = 2 + 1 = 3
f(x4, x7) = 1 + 1 = 2
f(x7, x12) = 0 + 1 = 1
f(x12, x13) = 0 + 1 = 1
(x1, x5) (x5, x8)
(x8, x12) (x12, x13)
i(x1, x5) = 3 – 2 = 1
i(x5, x8) = 3 – 2 = 1
i(x8, x12) = 3 – 0 = 3
i(x12, x13) = 3 – 1 = 2
min{1, 1, 3, 2} = 1
f(x1, x5) = 3
f(x5, x8) = 3
f(x8, x12) = 1
f(x12, x13) = 2
Увеличивающего
пути нет!
Максимальный
поток = 2 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 = 12