Sunteți pe pagina 1din 87

Probleme programare liniara

Problema 1

O firma produce 3 produse A, B, C folosind 3 resurse R1, R2, R3. Consumurile


specific, contabilitatile disponibile din fiecare resursa si beneficiile unitare sunt
prezentate in tabelul urmator:

A B C Disponibil
R1 2 4 0 20
R2 0 4 5 40
R3 1 2 3 55
beneficiu 20 45 60

Solutie:

Forma canonica
Notam cu x1, x2, x3 cantitatile necunoscute ce trebuie fabricate din fiecare
produs

Functia obiectiv:
max f(x) = 20x1+ 45x2 + 60x3
Sistemul de restrictii:

2x1 + 4x2 ≤ 20

4x2 + 5x3 ≤ 40

x1 + 2x2 +3x3 ≤ 55

Conditiile de nenegativitate:

x1, x2, x3 ≥ 0.

Forma standard
Introducem variabilele de compensare nenegative

Functia obiectiv:

max f(x) = 20x1 + 45x2 + 60x3

Sistemul de restrictii:

2x1 + 4x2 + y1 = 20

4x2 + 5x3 +y2 = 40

x1 + 2x2 + 3x3 + y3 = 55

Conditiile de nenegativitate:

x1, x2, y1, y2, y3 ≥ 0.

2 4 0 1 0 0

A= 0 4 5 0 1 0

1 2 3 0 0 0

X1=0 y1=20

X2=0 y2=40

X3=0 y3=55

Cj 20 45 60 0 0 0 VVB
aij(p)
VB CjVB VVB x1 x2 X3 y1 y2 y3
y1 0 20 2 4 0 1 0 0 10

Y2 0 40 0 4 5 0 1 0 -

Y3 0 55 1 2 3 0 0 0 55
zj 0 0 0 0 0 0

∆j = zj - Cj -20 -45 -60 0 0 0


X3 Intra in baza, Y1 iese din baza
Cj 20 45 60 0 0 0 VVB
aij(p)
VB CjVB VVB x1 x2 X3 y1 y2 y3
X3 60 0 0 0 1 0 0 0
Y2 0 20 2 4 0 0 0 0
Y3 0 20 2 4 0 0 0 0

zj 0 0 60 0 0 0

∆j = zj - Cj 20 45 0 0 0 0

Sol optima:

X1=20

X2=45

X3=60

Problema 2

O intreprindere dispune de doua resurse: R1 si R2 in cantitatile b1=40 unitati si


b2= 50 unitati. Din aceste resurse se fabrica doua produse P1 si P2 care aduc
intreprinderii beneficiile unitare c1=20 unitati monetare. Coeficienii de consum
specific sunt dati in tabelul de mai jos:

P1 P2
R1 2 4
R2 5 2

Solutie:
Forma canonica

Notam cu x1 si x2 cantitatile necunoscute ce trebuie fabricate din fiecare produs.

Functia obiectiv:

max f(x)=10x1+20x2
Sistemul de restrictii:

2x1 + 4x2 ≤ 40

5x1 + 2x2 ≤ 50

Conditiile de nenegativitate:

X1 , x2 ≥ 0

Forma standard

Notam cu y1 si y2 variabilele de compensare nenegative.

Functia obieciv:

max f(x) = 10x1 + 20x2

Sistemul de restrictii:

2x1 + 4x2 + y1 = 40

5x1 + 2x2 + y2 = 50

Conditiile de nenegativitate:

X1, x2, y1, y2 ≥ 0.

A= 2 4 1 0

5 2 0 1
Cj 40 50 0 0 VVB
aij(p)
VB CjVB VVB x1 x2 y1 y2
y1 0 10 2 4 1 0 5

Y2 0 20 5 2 0 1 4

zj 0 0 0 0 0

∆j = zj - Cj -40 -50 0 0

X2 intra in baza, y2 iese din baza

Cj 40 50 0 0 VVB
aij(p)
VB CjVB VVB x1 x2 y1 y2
y1 0 10 -8 0 4 0
X2 0 50 5/2 1 0 1/2

zj 0 0 0 0 0

∆j = zj - Cj 40 50 0 0
Problema 3

O firma realizeaza 2 produse folosind 3 produse, coeficientii tehnologici,


cantitatea disponibila de resurse si beneficiul unitar adus firmei prin
vanzareafiecarui produs sunt date in tabelul de mai jos:

P1 P2 Bi
R1 1 2 6
R2 1 1 4
R3 1 0 3
Cj 2 1

Solutie:

Forma canonica

Functia obiectiv:

max f(x) = 2x1 + x2

Sistemul de restrictii:

x1+ 2x2 ≤ 6

x1 + x2 ≤ 4

x1 ≤ 3

Conditiile de nenegativitate

x1, x2 ≥ 0

Forma standard

Functia obiectiv:

max f(x) = 2x1 + x2


Sistemul de restrictii:

x1 + 2x2 +y1 = 6

x1 + x2 +y2 = 4

x1 + y1 = 3

Conditiile de nenegativitate:

x1, x2, y1, y2, y3 ≥ 0.

Matricea coeficientilor tehnologici:

1 2 1 0 0

1 1 0 1 0

A= 1 0 0 0 1

Cj 2 1 0 0 0 VVB
VB CjVB VVB x1 x2 y1 y2 y3 aij
(p)
y1 0 4 1 2 1 0 0 4
y2 0 6 1 1 0 1 0 6
y3 0 3 1 0 0 0 1 3
zj 0 0 0 0 0 0
∆j= zj –Cj -2 -1 0 0 0

Iese y3 din baza si intra x1.

1-pivot

Pivotul ia valoarea 1 iar celelalte elemente de pe coloana lui devin 0


Cj 2 1 0 0 0 VVB
VB CjVB VVB x1 x2 y1 y2 y3 aij (p)
y1 0 3 0 2 1 0 -1 3/2
y2 0 1 0 1 0 1 -1 1
x1 2 3 1 0 0 0 0 -
zj 6 2 0 0 0 0
∆j = zj - Cj 0 -1 0 0 0
Aplicam regula dreptunghiului pentru a afla restul elementelor

1-pivot

Iese y2 din baza si intra x2.

Cj 2 1 0 0 0 VVB
VB CjVB VVB x1 x2 y1 y2 y3 aij(p)
y1 0 1 0 0 1 -2 1
x2 1 1 0 1 0 1 1
x1 2 3 1 0 0 0 1
zj 7 2 1 0 1 1
∆j = zj - Cj 0 0 0 1 1

Solutia optima:

x1 = 3

x2 = 1

max f(x) = 7

Problema 4

O firma realizeaza 3 produse folosind 4 tipuri de resurse. Datele problemelor


sunt date in tabelul urmator:
P1 P2 P3 Disponibil
R1 1 1 2 860
R2 2 3 0 920
R3 0 1 4 860
R4 1 1 1 600
Beneficiu 60 40 100

Sa se determine planul optim de productie pentru un beneficiu maxim.

Solutie:

Forma canonica

Functia obiectiv:

max f(x) = 60x1 + 40x2 + 100x3

Sistemul de restrictii:

x1 + x2 + 2x3 ≤ 860

2x1 + 3x2 ≤ 920

x2 + 4x3 ≤ 860

x1 + x2 + x3 ≤ 600

Conditiile de nenegativitate:

x1, x2, x3 ≥ 0

Forma standard

Functia obiectiv:

max f(x) = 60x1 + 40x2 + 100x3


Sistemul de restrictii:
x1 + x2 + 2x3 + y1 = 860

2x1 + 3x2 + y2 = 920

x2 + 4x3 + y3 = 860

x1 + x2 + x3 + y4 =600

Conditiile de nenegativitate:

x1, x2, x3, y1, y2, y3, y4 ≥

Matricea coeficientilor tehnologici:

1 1 2 1 0 0 0

2 3 0 0 1 0 0

A= 0 1 4 0 0 1 0

1 1 1 0 0 0 1

Cj 60 40 100 0 0 0 0 VVB
VB CjVB VVB x1 x2 x3 y1 y2 y3 y4 aij(p)
y1 0 860 1 1 2 1 0 0 0 430
y2 0 920 2 3 0 0 1 0 0 -
y3 0 860 0 1 4 0 0 1 0 215
y4 0 600 1 1 1 0 0 0 1 600
zj 0 0 0 0 0 0 0 0
∆j = zj – Cj -60 -40 -100 0 0 0 0

Iese y3 din baza si intra x3.

0-pivot
Cj 60 40 100 0 0 0 0 VVB
VB CjVB VVB x1 x2 x3 y1 y2 y3 .y4 aij(p)
y1 0 430 1 1/2 0 1 0 -1/2 0 430
y2 0 960 2 3 0 0 1 0 0 480
x3 100 215 0 1/4 1 0 0 0 0 -
y4 0 385 1 3/4 0 0 0 -1/4 1 385
zj 21500 0 140 100 0 0 0 0
∆j = zj - Cj -60 100 0 0 0 0 0

Iese y4 din baza si intra x1

Cj 60 40 100 0 0 0 0 VVB
VB CjVB VVB x1 x2 x3 y1 y2 y3 y4 aij(p)
y1 0 45 0 -1/4 0 1 0 -1/4 -1
y2 0 190 0 3/2 0 0 1 1/2 -2
x3 100 215 0 ¼ 1 0 0 0 0
x1 60 385 1 0 0 0 0 0 0
zj 4460 60 140 100 0 0 0 0
0
∆j = zj - Cj 0 40 0 0 0 0 0
1-pivot

Solutia optima este:

x1 = 385
x3 = 100
y1 = 45
y2 = 190
max f(x) = 44600

Problema 5
Sa se rezolve urmatoarea problema:

max f(x) = 3x1 + 5x2

x1 ≤ 4

x2 ≤ 6

3x1 + 2x2 ≤ 18

x1, x2 ≥ 0

Forma standard

max f(x) = 3x1 + 5x2

x1 + y1 = 4

x2 + y2 = 6

3x1 + 2x2 + y3 = 18

x1, x2, y1, y2, y3 ≥ 0

Matricea coeficientilor tehnologici

1 0 1 0 0

A= 0 1 0 1 0

3 2 0 0 1
Cj 3 5 0 0 0 VVB

aij(p)
VB CjVB VVB x1 x2 y1 y2 y3
y1 0 4 1 0 1 0 0 -
y2 0 6 0 1 0 1 0 6
y3 0 18 3 2 0 0 1 9
zj 0 0 0 0 0 0
∆ j = zj - C j -3 -5 0 0 0
Iese y2 din baza si intra x2

1-pivot

Cj 3 5 0 0 0 VVB
VB CjVB VVB x1 x2 y1 y2 y3 aij(p)
y1 0 4 1 0 1 0 0 4
x2 5 6 0 1 0 0 0 -
y3 0 6 3 0 0 -2 1 3
zj 30 0 5 0 0 0
∆ j = zj - C j -3 0 0 0 0

Iese y3 din baza si intra x1

3-pivot

Cj 3 5 0 0 0 VVB
VB CjVB VVB x1 x2 y1 y2 y3 aij(p)
y1 0 2 0 0 1 2/3 -1/3
x2 5 6 0 1 0 0 0
x1 3 3 1 0 0 0 0
zj 39 3 5 0 0 0
∆j = zj - Cj 0 0 0 0 0
Solutia optima este:

y1 = 2
x2 = 6
x1 = 3
max f(x) = 39

Probleme de transport

Problema 1

Din 3 depozite D1,D2,D3 trebuie transportate cantităţi de produs la 3 centre


de vânzare B1,B2,B3,,astfel încât costul total al transportului să fie
minim.Datele problemei sunt prezentate în tabelul de mai jos:

Di B1 B2 B3 di
  D1 2 5 4 50
  D2 2 3 1 50
  D3 3 4 3 30
bj 50   20   60   130  130

130¿ 130 ⇛ problemaeste echilibrată


   
Di B1 B2 B3 Di
  D1 50 2 - 5 - 4 50
  2 3 1
D2 - - 50 50
  D3 - 3 20 4 10 3 30
bj 50   20   60   130  130

m+n-1=3+3-1=5≠ 4 rute ⇛ soluţie degenerată

Aplicăm metoda perturbării.

Di B1 B2 B3 di
  D1 50 2 - 5 Ɛ 4 50+Ɛ
  D2 - 2 - 3 50+Ɛ 1 50+Ɛ
  D3 - 3 20 4 10+Ɛ 3 30+Ɛ
bj 50   20   60+3Ɛ   130+3Ɛ  130+3Ɛ

Egalăm Ɛ cu 0:
v1 v2 v3

B1 B2 B3 di
D1 50 - 0 50
Di 130
D2 - - 50 50
uu321     130431324 5 
D3 - 20 10 30 ui + v j=cij
bj 50 20 60
u1=0

u1 + v1 = 2 v1 =2

u1 + v3 =4 v3 =4

u2 + v 3=¿1 u2=−3

u3 + v 2=4 v 2=5

u3 + v 3=3 u3=−1
Formăm matricea △ ij: △ ij =ui +v j−c ij
v1 v2 v3
u1 0 0 -2
u2 -3 -1 0
u3 -2 0 0
△ ij ≤ 0 amajuns la soluţia optimă

Soluţia optimă:

x 11=50

x 22=50

x 32=20

x 33=10

minf ( x )=50∗2+ 50∗1+20∗4 +10∗3=260 u . m

Problema 2

Trei unităţi militare U1,U2 şi U3 sunt alimentate cu carburant de la


depozitele teritoriale D1,D2 şi D3. Costurile unitare de transport, disponibilul şi
necesarul sunt date în tabelul de mai jos:

Cj
Di U1 U2 U3 disponibil
  D1 2 5 3 100
  D2 4 2 1 120
  D3 7 8 3 70
cerere 80   110   100   290 290

290¿ 290 ⇛ problemaeste echilibrată

Aplicăm metoda minim pe linie pentru găsirea unei soluţii de bază.


v1 v2 v3

Di U1 U2 U3 disponibil
u1  D1 80 2 - 5 20 3 100
u2   D2 - 4 40 2 80 1 120
u3  D3 - 7 70 8 - 3 70
      290
cerere 80 110 100 290

m+n-1=3+3-1=5¿5 rute ⇛ soluţie nedegenerată


ui + v j=cij u1=0

u1 + v1 = 2 v1 =2

u1 + v3 =3 v3 =3

u2 + v 2=2 u2=−2

u2 + v 3=1 v 2=4

u3 + v 2=8 u3=4

Formăm matricea △ ij: △ ij =ui +v j−c ij

v1 v2 v3
u1 0 -1 0
u2 -4 0 0
u3 -1 0 -2

△ ij ≤ 0 ⇛ am ajunsla soluţiaoptimă

Soluţia optimă:

minf(x)=80*2+20*3+40*2+80*1+70*8= 940 u.m


x 11=80

x 13=20

x 22=40

x 23=80

x 32=70
Problema 3

Fie problema de transport definită prin tabelul următor:

Di B1 B2 B3 B4 Disponibil
  D1 3 5 3 2 18
 
D2 8 5 4 5 22
  D3 1 6 2 7 20
cerere 15   12   8   25 60 60
Să se afle planul optim de transport pentru cost total minim.

60=60⇛problema este echilibrată

Folosim metoda minim în tabel

Di B1 B2 B3 B4 disponibil
  D1 - 3 - 5 - 3 18 2 18
  D2 - 8 12 5 3 4 7 5 22
  D3 15 1 - 6 5 2 - 7 20
cerere 15   12   8   25 60 60

m+n-1=4+3-1=6=6 rute⇛ soluţie nedegenerată


ui + v j=cij u1=0

u1 + v 4 = 2 v 4 =2

u2 + v 2=5 v 2=2

u2 + v 3=¿4 v3 =1

u2 + v 4=5 u2=3

u3 + v 1=1 v1 =0

u3 + v 3=2 u3=1

Formăm matricea △ ij: △ ij =ui +v j−c ij


v1 v2 v3 v4
u1 -3 -3 -2 0
u2 -5 0 0 0
u3 0 -3 0 -4
△ ij ≤ 0 amajuns la soluţia optimă

Soluţia optimă:

x 14=18

x 22=12

x 23=3

x 24=7

x 31=15

x 33=5

minf ( x )=18∗2+ 12∗5+3∗4 +7∗5+15∗1+5∗2=240u . m

Problema 4

Sa se rezolve problema de transport folosind datele din tabelul de mai jos. Sa se


afle planul optim de transport pentru cost total minim.

B1 B2 B3 di
7 3 4
D1 2
2 1 3
D2 3
3 4 6
D3 5
10
bj 4 1 5 10

Se aplica metoda costului minim

B1 B2 B3 di
7 3 4
D1 - - 2 2
2 1 3
D2 2 1 - 3
3 4 6
D3 2 - 3 5
10
bj 4 1 5 10
4+1+5=2+3+5⇛10=10⇛problema este echilibrată

m+n–1=3+3–1=5
u1 = 0

u1 + v3 = 4 v3 = 4

u2 + v1 = 2 u2 = 1

u2 + v2 = 1 v2 = 0

u3 + v1 = 3 v1 = 1

u3 + v3 = 6 u3 = 2

v1 v2 v3
u1 -6 -3 0
u2 0 0 2
u3 0 -2 0

(-)1 -(+) Se alege min(1,3)=1 ⇛ - 1

(+)- 3(-) 1 2

B1 B2 B3 di
4
D1 −¿ ¿7
−¿ ¿3
2 2
D2 22 −¿1 ¿ 13 3
D3 23 14 26 5
bj 4 1 5

u1 + v3 =4 u1=0
u2 + v 1=2 u2=−1
u2 + v 3=3 u3=0

u3 + v 1=3 v1 =3

u3 + v 2=4 v 2=4

u3 + v 3=6 v3 =4

v1 v2 v3
u1 -4 1 0
u2 0 4 0
u3 0 0 -2

(-)2 (+)- se alege min (1,2,2)=1⇛ 1 1

(+)2 (-)1 3 - ⇛

B1 B2 B3 di
4
D1 −¿ ¿7
−¿ ¿3
2 2
D2 12 11 13 3
D3 33 −¿ 4 ¿ 26 5
bj 4 1 5

u1 + v3 =4 u1=0
u2 + v 1=2 u2=−1

u2 + v 2=1 u3=2

u2 + v 3=3 v1 =1

u3 + v 1=3 v 2=2
u3 + v 3=6 v3 =4

v1 v2 v3
u1 -6 -1 0
u2 -2 0 0
u3 0 0 0

△ ij ≤ 0 amajuns la soluţia optimă

Soluţia optimă:

x 13=2

x 21=1

x 22=1

x 23=1

x 31=3

x 33=2

minf ( x )=2∗4+1∗2+1∗1+1∗3+3∗3+2∗6=33 u . m

Problema 5

Sa se determine solutiile optime ale problemelor de transport, de cost minim din


tabelul urmator:

B1 B2 B3 di
8 6 10
D1 125
4 9 8
D2 150
7 6 5
D3 95
370
bj 110 85 175 370

Se aplica metoda costului minim

B1 B2 B3 di
8 6
D1 - 85 40 10 125
4 9
D2 110 - 40 8 150
7 6
D3 - - 95 5 95
370
bj 110 85 175 370

m+n–1=3+3–1=5

u1 = 0

u1 + v2 = 6 v2 = 6

u1 + v3 = 10 v3 = 10

u2 + v1 = 4 v1 = 6

u2 + v3 = 8 u2 = -2

u3 + v 3 = 3 u3 = -5

v1 v2 v3
u1 -2 0 0
u2 0 -5 -6
u3 -6 -5 0

∆ij ≤ 0 => solutie optima

x12 = 85

x13 = 40
x21 = 110

x23 = 40

x33 = 95

min f(x) = 510 + 400 + 440 + 320 + 475 = 2145 u.m.

Problema 1

Din cele 5 produse ce pot fi fabricate in cele 5 intreprinderi, sa se realizeze acea


repartitie care sa asigure cheltuieli totale minime de productie. Datele problemei,
respective indicii corespunzatori pretului de productie al fiecarui produs fabricat
la fiecare dintre cele 5 intreprinderi, sunt precizate in tabelul de mai jos:

O1 O2 O3 O4 O5
M1 17 15 9 5 12
M2 16 16 10 5 10
M3 12 15 14 11 5
M4 4 8 14 17 13
M5 13 9 8 12 17

Se alege elementul minim pe fiecare linie si se scade

O1 O2 O3 O4 O5
M1 12 10 4 0 7
M2 11 11 5 0 5
M3 7 10 9 6 0
M4 0 4 10 13 9
M5 5 1 0 4 9

Se alege elemental minim pe fiecare coloana si se scade

O1 O2 O3 O4 O5
M1 12 9 4 7 000

M2 11 10 5 0 5 *

M3 7 9 9 6 *

M4 3 10 13 9
M5 5 0 4 9

Alegem elemental minim din liniile netaiate si il scadem

O1 O2 O3 O4 O5
M1 8 5 0 -4 3
M2 7 6 1 -4 1
M3 7 9 9 6 0
M4 0 3 10 13 9
M5 5 0 0 4 9

Pastram elementul gasit mai sus si il adunam pe coloanele taiate


O1 O2 O3 O4 O5
M1 8 5 0 0 3
M2 7 6 1 0 1
M3 7 9 9 10 0
M4 0 3 10 17 9
M5 1 0 0 8 9

Se reia algoritmul pentru taierea si marcarea in table

O1 O2 O3 O4 O5
M1 8 5 0 0 3
M2 7 6 1 0
1
M3 7 9 9 17 0

M4 0 3 10 10 9
M5 1 0 0 8 9

Solutia optima este :

O1 O2 O3 O4 O5
M1 0 0 1 0 0
M2 0 0 0 1 0
M3 0 0 0 0 1
M4 1 0 0 0 0
M5 0 1 0 0 0

min f(x) = 9 + 5 + 5 + 4 + 9 = 32
Problema 2

M1 M2 M3 M4 M5
P1 7 3 5 7 10
P2 6 16 16 8 7
P3 6 5 1 5 15
P4 11 4 16 11 15
P5 16 4 5 2 10

Se alege pe fiecare linie elemental minim si se scade

M1 M2 M3 M4 M5
P1 4 0 2 4 7
P2 0 10 10 2 1
P3 5 4 0 4 14
P4 7 0 12 7 11
P5 14 2 3 0 8
Se alege pe fiecare coloana elementul minim si se scade 

M1 M2 M3 M4 M5 00

P1 4 2 4 6 
P2 10 10 2 0
P3 5 4 4 13
P4 7 0 12 7 10

P5 14 2 3 7

Scadem elementul minim pe liniile netaiate

M1 M2 M3 M4 M5
P1 2 -2 0 2 4
P2 0 10 10 2 0
P3 5 4 0 4 13
P4 5 -2 10 5 8
P5 14 2 3 0 7

Adunam elementul minim gasit mai sus pe coloanele taiate si reluam algoritmul
pentru taiere si marcare
M1 M2 M3 M4 M5
P1 2 0 2 4
P2 12 10 2 0 
P3 5 6 4 13

P4 5 0 10 5 8

P5 14 4 3 7

 

Se alege minimul pe liniile netaiate si se scade

M1 M2 M3 M4 M6
P1 2 0 0 2 4
P2 -2 10 8 0 -2
P3 3 4 -2 2 11
P4 3 -2 8 3 6
P5 14 4 3 0 7
Pastram elementul minim gasit mai sus si se aduna pe coloanele taiate si se reia
algoritmul pentru taiat si marcat

M1 M2 M3 M4 M6
P1 2
P2 14 12 2
P3 3 6 2 11
P4 3 10 3 6
P5 14 6 5 7
Solutia optima este:

M1 M2 M3 M4 M6
P1 1 0 0 0 0
P2 0 0 0 0 1
P3 0 0 1 0 0
P4 0 1 0 0 0
P5 0 0 0 1 0

min f(x) = 7 + 7 + 1 + 4 + 2 = 21

P1 = M 1

P2 = M5

P3 = M 2

P5 = M 4
Problema 3

Sa se repartizeze lucrarile L1, L2, L3 si L4 la muncitorii M1, M2, M3 si M4 astfel


incat timpul total de executie sa fie minim. Duratele de executie ale fiecarei
lucrari de catre fiecare muncitor sunt trecute in tabelul urmator:

M1 M2 M3 M4
L1 13 37 52 10
L2 37 61 67 34
L3 52 79 85 37
L4 43 82 88 31

Alegem elementul minim de pe fiecare linie si il scadem.

M1 M2 M3 M4
L1 3 27 42 0
L2 3 27 33 0
L3 15 42 48 0
L4 12 51 57 0
Alegem elementul minim de pe fiecare coloana si il scadem
M1 M2 M3 M4
L1 9
L2
L3 12 15 15 
L4 9 24 24

Se alege minimul pe liniile netaiate si se scade

M1 M2 M3 M4
L1 0 0 9 0
L2 0 0 0 0
L3 3 6 6 -9
L4 0 15 15 -9
Pastram elementul minim gasit mai sus si se aduna pe
coloanele taiate si se reia algoritmul pentru taiat si marcat

M1 M2 M3 M4
L1 9 9
L2 9
L3 3 6 6
L4 15 15

Solutia optima este:


M1 M2 M3 M4
L1 0 1 0 0
L2 0 0 1 0
L3 0 0 0 1
L4 1 0 0 0

min f(x) = 37 + 67 + 37 + 43 = 184

Problema 4

Cinci muncitori pot executa oricare dintre cele patru lucrari ce trebuie realizate.
Sa se realizeze repartitia optima astfel incat timpul total de prelucrare sa fie
minim.

L1 L2 L3 L4 L5
M1 10 6 10 14 0
M2 16 13 10 4 0
M3 1 10 7 10 0
M4 14 15 6 10 0
M5 13 8 13 8 0

Se alege minimul de pe fiecare linie si se scade

L1 L2 L3 L4 L5
M1 10 6 10 14 0
M2 16 13 10 4 0
M3 1 10 7 10 0
M4 14 15 6 10 0
M5 13 8 13 8 0
Se alege minimul de pe fiecare coloana si se scade

L1 L2 L3 L4 L5
M1 9 4 10
M2 15 7 4
M3 4 1 6
M4 13 9 6
M5 12 2 7 4

Solutia optima este

L1 L2 L3 L4 L5
M1 0 1 0 0 0
M2 0 0 0 1 0
M3 1 0 0 0 0
M4 0 0 1 0 0
M5 0 0 0 0 1

min f(x) = 6 + 4 + 1 + 6 + 0 = 17

M1 = L2

M2 = L4
Problema 5

Din cele 6 produse ce pot fi fabricate in cele 6 intreprinderi, sa se realizeze acea


repartitie care sa asigure cheltuieli totale minime de productie. Datele problemei
se gasesc in urmatorul tabel

I1 I2 I3 I4 I5 I6
P1 9 4 10 12 11 8
P2 7 4 5 2 8 9
P3 3 4 4 3 5 2
P4 3 9 7 2 7 6
P5 9 8 7 8 4 5
P6 1 8 7 4 2 3
Alegem minimul de pe fiecare linie si il scadem.

I1 I2 I3 I4 I5 I6
P1 5 0 6 8 7 4
P2 5 2 3 0 6 7
P3 1 2 2 1 3 0
P4 1 7 5 0 5 4
P5 5 4 3 4 0 1
P6 0 7 6 3 1 2
Alegem minimul de pe fiecare coloana si il scadem.

I1 I2 I3 I4 I5 I6
P1 5 4 8 7 4
P2 5 2 1 6 7
P3 1 2 1 3
P4 1 7 3 5 4
P5 5 4 1 4 1
P6 7 4 2 1 2

Se alege minimul pe liniile netaiate si se scade

I1 I2 I3 I4 I5 I6
P1 5 0 4 8 7 4
P2 4 1 0 -1 5 6
P3 1 2 0 1 3 0
P4 0 6 2 -1 4 3
P5 5 4 1 4 0 1
P6 0 7 4 2 1 2
Se alege minimul pe liniile netaiate si se aduna la coloana taiat

I1 I2 I3 I4 I5 I6
P1 5 4 9 7 4
P2 4 1 5 6
P3 1 2 2 3
P4 6 2 4 3
P5 5 4 1 5 1
P6 7 4 3 1 2
Solutia optima este:

I1 I2 I3 I4 I5 I6
P1 0 1 0 0 0 0
P2 0 0 1 0 0 0
P3 0 0 0 0 0 1
P4 0 0 0 1 0 0
P5 0 0 0 0 1 0
P6 1 0 0 0 0 0

min f(x) = 4 + 5 + 2 + 2 + 4 + 1 = 18
P1 = I 2

P2 = I 3

P3 = I 6

P4 = I 4

P5 = I 5

P6 = I 1

Problema 1

Din cele 5 produse ce pot fi fabricate in cele 5 intreprinderi, sa se realizeze acea


repartitie care sa asigure cheltuieli totale minime de productie. Datele problemei,
respective indicii corespunzatori pretului de productie al fiecarui produs fabricat
la fiecare dintre cele 5 intreprinderi, sunt precizate in tabelul de mai jos:

O1 O2 O3 O4 O5
M1 17 15 9 5 12
M2 16 16 10 5 10
M3 12 15 14 11 5
M4 4 8 14 17 13
M5 13 9 8 12 17

Se alege elementul minim pe fiecare linie si se scade

O1 O2 O3 O4 O5
M1 12 10 4 0 7
M2 11 11 5 0 5
M3 7 10 9 6 0
M4 0 4 10 13 9
M5 5 1 0 4 9

Se alege elemental minim pe fiecare coloana si se scade

O1 O2 O3 O4 O5
M1 12 9 4 7 000

M2 11 10 5 0 5 *

M3 7 9 9 6 *

M4 3 10 13 9
M5 5 0 4 9

Alegem elemental minim din liniile netaiate si il scadem

O1 O2 O3 O4 O5
M1 8 5 0 -4 3
M2 7 6 1 -4 1
M3 7 9 9 6 0
M4 0 3 10 13 9
M5 5 0 0 4 9
Pastram elementul gasit mai sus si il adunam pe coloanele taiate

O1 O2 O3 O4 O5
M1 8 5 0 0 3
M2 7 6 1 0 1
M3 7 9 9 10 0
M4 0 3 10 17 9
M5 1 0 0 8 9

Se reia algoritmul pentru taierea si marcarea in table

O1 O2 O3 O4 O5
M1 8 5 0 0 3
M2 7 6 1 0
1
M3 7 9 9 17 0

M4 0 3 10 10 9
M5 1 0 0 8 9

Solutia optima este :

O1 O2 O3 O4 O5
M1 0 0 1 0 0
M2 0 0 0 1 0
M3 0 0 0 0 1
M4 1 0 0 0 0
M5 0 1 0 0 0
min f(x) = 9 + 5 + 5 + 4 + 9 = 32

Problema 2

M1 M2 M3 M4 M5
P1 7 3 5 7 10
P2 6 16 16 8 7
P3 6 5 1 5 15
P4 11 4 16 11 15
P5 16 4 5 2 10

Se alege pe fiecare linie elemental minim si se scade

M1 M2 M3 M4 M5
P1 4 0 2 4 7
P2 0 10 10 2 1
P3 5 4 0 4 14
P4 7 0 12 7 11
P5 14 2 3 0 8
Se alege pe fiecare coloana elementul minim si se scade 

M1 M2 M3 M4 M5 00

P1 4 2 4 6 
P2 10 10 2 0
P3 5 4 4 13
P4 7 0 12 7 10

P5 14 2 3 7

Scadem elementul minim pe liniile netaiate

M1 M2 M3 M4 M5
P1 2 -2 0 2 4
P2 0 10 10 2 0
P3 5 4 0 4 13
P4 5 -2 10 5 8
P5 14 2 3 0 7
Adunam elementul minim gasit mai sus pe coloanele taiate si reluam algoritmul
pentru taiere si marcare

M1 M2 M3 M4 M5
P1 2 0 2 4
P2 12 10 2 0 
P3 5 6 4 13

P4 5 0 10 5 8

P5 14 4 3 7

 

Se alege minimul pe liniile netaiate si se scade

M1 M2 M3 M4 M6
P1 2 0 0 2 4
P2 -2 10 8 0 -2
P3 3 4 -2 2 11
P4 3 -2 8 3 6
P5 14 4 3 0 7
Pastram elementul minim gasit mai sus si se aduna pe coloanele taiate si se reia
algoritmul pentru taiat si marcat

M1 M2 M3 M4 M6
P1 2
P2 14 12 2
P3 3 6 2 11
P4 3 10 3 6
P5 14 6 5 7
Solutia optima este:

M1 M2 M3 M4 M6
P1 1 0 0 0 0
P2 0 0 0 0 1
P3 0 0 1 0 0
P4 0 1 0 0 0
P5 0 0 0 1 0

min f(x) = 7 + 7 + 1 + 4 + 2 = 21

P1 = M 1

P2 = M5

P3 = M 2

P5 = M 4
Problema 3

Sa se repartizeze lucrarile L1, L2, L3 si L4 la muncitorii M1, M2, M3 si M4 astfel


incat timpul total de executie sa fie minim. Duratele de executie ale fiecarei
lucrari de catre fiecare muncitor sunt trecute in tabelul urmator:

M1 M2 M3 M4
L1 13 37 52 10
L2 37 61 67 34
L3 52 79 85 37
L4 43 82 88 31

Alegem elementul minim de pe fiecare linie si il scadem.

M1 M2 M3 M4
L1 3 27 42 0
L2 3 27 33 0
L3 15 42 48 0
L4 12 51 57 0
Alegem elementul minim de pe fiecare coloana si il scadem

M1 M2 M3 M4
L1 9
L2
L3 12 15 15 
L4 9 24 24

Se alege minimul pe liniile netaiate si se scade

M1 M2 M3 M4
L1 0 0 9 0
L2 0 0 0 0
L3 3 6 6 -9
L4 0 15 15 -9
Pastram elementul minim gasit mai sus si se aduna pe
coloanele taiate si se reia algoritmul pentru taiat si marcat

M1 M2 M3 M4
L1 9 9
L2 9
L3 3 6 6
L4 15 15
Solutia optima este:

M1 M2 M3 M4
L1 0 1 0 0
L2 0 0 1 0
L3 0 0 0 1
L4 1 0 0 0

min f(x) = 37 + 67 + 37 + 43 = 184

Problema 4

Cinci muncitori pot executa oricare dintre cele patru lucrari ce trebuie realizate.
Sa se realizeze repartitia optima astfel incat timpul total de prelucrare sa fie
minim.

L1 L2 L3 L4 L5
M1 10 6 10 14 0
M2 16 13 10 4 0
M3 1 10 7 10 0
M4 14 15 6 10 0
M5 13 8 13 8 0

Se alege minimul de pe fiecare linie si se scade

L1 L2 L3 L4 L5
M1 10 6 10 14 0
M2 16 13 10 4 0
M3 1 10 7 10 0
M4 14 15 6 10 0
M5 13 8 13 8 0
Se alege minimul de pe fiecare coloana si se scade

L1 L2 L3 L4 L5
M1 9 4 10
M2 15 7 4
M3 4 1 6
M4 13 9 6
M5 12 2 7 4

Solutia optima este

L1 L2 L3 L4 L5
M1 0 1 0 0 0
M2 0 0 0 1 0
M3 1 0 0 0 0
M4 0 0 1 0 0
M5 0 0 0 0 1

min f(x) = 6 + 4 + 1 + 6 + 0 = 17

M1 = L2

M2 = L4
Problema 5

Din cele 6 produse ce pot fi fabricate in cele 6 intreprinderi, sa se realizeze acea


repartitie care sa asigure cheltuieli totale minime de productie. Datele problemei
se gasesc in urmatorul tabel

I1 I2 I3 I4 I5 I6
P1 9 4 10 12 11 8
P2 7 4 5 2 8 9
P3 3 4 4 3 5 2
P4 3 9 7 2 7 6
P5 9 8 7 8 4 5
P6 1 8 7 4 2 3
Alegem minimul de pe fiecare linie si il scadem.

I1 I2 I3 I4 I5 I6
P1 5 0 6 8 7 4
P2 5 2 3 0 6 7
P3 1 2 2 1 3 0
P4 1 7 5 0 5 4
P5 5 4 3 4 0 1
P6 0 7 6 3 1 2
Alegem minimul de pe fiecare coloana si il scadem.

I1 I2 I3 I4 I5 I6
P1 5 4 8 7 4
P2 5 2 1 6 7
P3 1 2 1 3
P4 1 7 3 5 4
P5 5 4 1 4 1
P6 7 4 2 1 2

Se alege minimul pe liniile netaiate si se scade

I1 I2 I3 I4 I5 I6
P1 5 0 4 8 7 4
P2 4 1 0 -1 5 6
P3 1 2 0 1 3 0
P4 0 6 2 -1 4 3
P5 5 4 1 4 0 1
P6 0 7 4 2 1 2

Se alege minimul pe liniile netaiate si se aduna la coloana taiat

I1 I2 I3 I4 I5 I6
P1 5 4 9 7 4
P2 4 1 5 6
P3 1 2 2 3
P4 6 2 4 3
P5 5 4 1 5 1
P6 7 4 3 1 2
Solutia optima este:

I1 I2 I3 I4 I5 I6
P1 0 1 0 0 0 0
P2 0 0 1 0 0 0
P3 0 0 0 0 0 1
P4 0 0 0 1 0 0
P5 0 0 0 0 1 0
P6 1 0 0 0 0 0
min f(x) = 4 + 5 + 2 + 2 + 4 + 1 = 18

P1 = I 2

P2 = I 3

P3 = I 6

P4 = I 4

P5 = I 5

P6 = I 1

Probleme grafuri cu si fara circuit

Problema 1

x2
x5

x1 x3
x7

x4
x6
Se scrie matricea A (matricea de adiacenţă a grafurilor):
x1 x2 x3 x4 x5 x6 x7
x1 0 1 11 0 00
A= x 2 0 0 00 1 00
x3 0 0 00 1 10
x4 0 0 0 0 0 10
x5 0 0 0 0 0 01
x6 0 0 0 0 0 01
x7 0 0 00 00 0

Scriem matricea drumurilor D:


x1 x2 x3 x4 x5 x6 x7 P( x i ¿
x1 0 1 11 1 1 1 6
D= x 2 0 0 00 1 01 2
x3 0 0 00 1 1 1 3
x4 0 0 0 0 0 11 2
x5 0 0 0 0 0 01 1
x6 0 0 0 0 0 01
1
x7 0 0 00 00 0 0
∑ p ( xi )=¿ ¿15
Graful este un graf fără circuit deoarece toate elementele de pe diagonala
principală sunt nule.
Se verifică releşia lui Chen:
n(n−1) 7−6
Σ p( x i ¿= = 2 =21
2

Relaţia lui Chen nu se verifică ⇛ graful iniţial nu are drum hamiltonian.

Se stabilesc arcele care lipsesc.

Se scrie matricea D(ordonăm liniile matricei D în ordine descrescătoare a


puterilor de atingere):

x1 x2 x3 x4 x5 x6 x7
x1 0 1 11 1 1 1
D= x 3 0 0 00 1 11
x2 0 0 00 1 0 1
x4 0 0 0 0 0 11
x5 0 0 0 0 0 01
x6 0 0 0 0 0 01
x7
0 0 00 00 0

Scriem matricea triunghiurilor superioară(ordonăm coloanele matricei D în


ordinea descrescătoare a puterii lor de atingere):
x 1 x 3 x 2 x 4 x 5 x6 x 7

DT = x 1 0 1 1 1 1 1 1
x3 0 0 0 0 1 1 1
x2 0 0 0 0 1 0 1
x4 0 0 0 0 0 1 1
x5 0 0 0 0 0 0 1
x6 0 0 0 0 0 0 1
X7 0 0 0 0 0 0 0

Arcele care lipsesc corespund elemetelor nule din matricea DT ,situate imediat
deasupra diagonalei principale:
( x 3 , x 2 ¿ , ( x 2 , x 4 ) , ( x 4 , x 5 ) ,( x 5 , x 6)

x2
x5

x1 x3
x7

x4
x6

Refacem matricea de adiacenţă:

x 1 x 2 x 3 x 4 x 5 x6 x 7

A= x1 0 1 1 1 0 0 0
x2 0 0 0 1 1 0 0
x3 0 1 0 0 1 1 0
x4 0 0 0 0 1 1 0
x5 0 0 0 0 0 1 1
x6 0 0 0 0 0 0 1
x7 0 0 0 0 0 0 0
Matricea drumurilor:
x 1 x 2 x 3 x 4 x 5 x6 x 7 p( x i ¿

x1 0 1 1 1 1 1 1 6
x2 0 0 0 1 1 1 1 4
D= x 3 0 1 0 1 1 1 1 5
x4 0 0 0 0 1 1 1 3
x5 0 0 0 0 0 1 1 2
x6 0 0 0 0 0 0 1 1
x7 0 0 0 0 0 0 0 0
Σ p( x i ¿=21
Se verifică relaţia lui Chen:
n(n−1) 7∗6
= =21=¿ Σ p( x i ¿ =21⇛graful are un drum hamiltonian
2 2

d H =x 1 , x 3 , x 2 , x 4 , x5 , x 6 , x 7

Problema 2

Să se determine dacă există un drum hamiltonian:

x2
x5

x1

x
x4

Scriem matricea de adiacenţă A:


x1 x2 x3 x4 x5

A= x1 0 1 1 0 0
x2 0 0 0 0 0
x3 0 1 0 1 1
x4 0 0 0 0 1
x5 0 1 0 0 0
Scriem matricea drumurilor:
x 1 x 2 x 3 x 4 x 5p( x i ¿

D= x1 0 1 1 1 1 4
x2 0 0 0 0 0 0
x3 0 1 0 1 1 3
x4 0 1 0 0 1 2
x5 0 1 0 0 0 1
Σ p( x i ¿=10

Relaţia lui Chen:


n(n−1) 5∗4
= =10=Σ p ( x i ) =10⇛ graful are un drumhamiltonian
2 2

d H =x 1 , x 3 , x 4 , x5 , x 2
Problema 3
Să se determine acele legături conexe în grafurile cu circuite din figură.

x5
x2

x1 x4

x3

Matricea de incidenţă a grafului condensat:


x 1 x 2 x 3 x 4 x 5 Γ −1( x 1 ) Γ −1(x 3 ) Γ −1(x 4)

A= x1 0 1 0 0 1 0 * *
x2 1 0 1 1 0 1 * *
x3 0 0 0 1 0 - 0 *
x4 0 0 0 0 1 - - 0
x5 0 0 0 1 0 - - 1
Γ( x 1 ¿ 0 1 2 2 1
Γ( x 3 ¿ * * 0 1 2
Γ( x 4 ¿ * * * 0 1

C( x 1 ¿=¿ Γ( x 1 ¿ ∩ Γ −1( x 1 )= [ x 1 , x 2 ¿
C( x 3 ¿=¿ Γ( x 3 ¿ ∩ Γ −1(x 3 )= [ x 3]
C( x 4 ¿=¿ Γ( x 5 ¿ ∩ Γ −1(x 5 )= [ x 4 , x5]

Construim matricea A(adunăm bulean pe coloană):


C (x¿ ¿1)C ( x 3 ) C ( x 4 )¿

A= x1 1 0 1
x2 1 1 1
x3 0 0 1
x4 0 0 1
x5 0 0 1

Construim matricea A(adunăm bulean pe linie):

C (x¿ ¿1)C ( x 3 ) C ( x 5)¿

A= C( x 1 ¿ 1 1 1
C( x 3 ¿ 0 0 1
C (x5 ) 0 0 1
Scriem matricea de adiacenţă a grafului:
C (x¿ ¿1)C ( x 3 ) C ( x 5)¿

A¿= C( x 1 ¿ 0 1 1
C( x 3 ¿ 0 0 1
C (x5 ) 0 0 0

Se determină matricea D¿ :
C (x¿ ¿1)C ( x 3 ) C ( x 5)¿ p( x i ¿

D¿= C( x 1 ¿ 0 1 1 2
C( x 3 ¿ 0 0 1 1
C (x5 ) 0 0 0 0
Σ p( x i ¿=3

Relaţia lui Chen:


n(n−1) 3∗2
= =3=Σ p ( xi ) =3 ⇛ graful are drumuri hamiltoniene
2 2

C (x1 ) C( x 3 ¿ C( x 4 ¿

x5
x3
x2
x1 x4
x1 , x2 x3 x 4 , x5

x2 , x1 x5 , x4

d H =x 1 , x 2 , x 3 , x 4 , x5

Problema 4

Pentru graful reprezentat în figură, să se arate că nu există un drum


hamiltonian; să se găsească un număr minim de arce ce vor trebui adăugate,
astfel încât să se formeze în graful dat un drum hamiltonian.

x6
x2
x5
x1
x3

x7 x4

x 1 x 2 x 3 x 4 x 5 x6 x 7

A= x1 0 0 0 0 0 0 0
x2 1 0 1 0 1 1 1
x3 1 0 0 0 0 0 0
x4 0 0 1 0 1 0 0
x5 0 0 1 0 0 0 0
x6 1 0 1 0 1 0 0
x7 1 0 0 0 0 0 0

Se scrie matricea drumurilor:


x 1 x 2 x 3 x 4 x 5 x6 x 7 p( x i ¿
D= x1 0 0 0 0 0 0 0 0
x2 1 0 1 0 1 1 1 5
x3 1 0 0 0 0 0 0 1
x4 1 0 1 0 1 0 0 3
x5 1 0 1 0 0 0 0 2
x6 1 0 1 0 1 0 0 3
x7 1 0 0 0 0 0 0 1
Σ p ( xi )=15

Relaţia lui Chen:


n(n−1) 7∗6
= =21 ≠ Σ p( x i)=15
2 2
Relaţia lui Chen nu se verifică ⇛ graful iniţial nu are drum hamiltonian.

Se stabilesc arcele care lipsesc.

Se scrie matricea D ondulat (ordonăm liniile matricei D în ordine


descrescătoare a puterilor de atingere):

x 1 x 2 x 3 x 4 x 5 x6 x 7

D= x2 1 0 1 0 1 1 1
x6 1 0 1 0 1 0 0
x4 1 0 1 0 1 0 0
x5 1 0 1 0 0 0 0
x3 1 0 0 0 0 0 0
x7 1 0 0 0 0 0 0

Scriem matricea triunghiurilor superioară(ordonăm coloanele matricei D în


ordinea descrescătoare a puterii lor de atingere):
x 2 x 6 x 4 x 5 x3 x 7 x 1

DT = x 2 0 1 0 1 1 1 1
x6 0 0 0 1 1 0 1
x4 0 0 0 1 1 0 1
x5 0 0 0 0 1 0 1
x3 0 0 0 0 0 0 1
x7 0 0 0 0 0 0 1
x1 0 0 0 0 0 0 0
Arcele care lipsesc:
( x 6, x 4 ¿ ,( x 3 , x 7 )

x6
x2
x5
x1
x3

x7 x4

Se reface matricea adiancenţă:


x 1 x 2 x 3 x 4 x 5 x6 x 7

A= x1 0 0 0 0 0 0 0
x2 1 0 1 0 1 1 1
x3 1 0 0 0 0 0 1
x4 0 0 1 0 1 0 0
x5 0 0 1 0 0 0 0
x6 1 0 1 1 1 0 0
x7 1 0 0 0 0 0 0

Matricea drumurilor:
x 1 x 2 x 3 x 4 x 5 x6 x 7 p( x i ¿

D= x1 0 0 0 0 0 0 0 0
x2 1 0 1 1 1 1 1 6
x3 1 0 0 0 0 0 1 2
x4 1 0 1 0 1 0 1 4
x5 1 0 1 0 0 0 1 3
x6 1 0 1 1 1 0 1 5
x7 1 0 0 0 0 0 0 1
Relaţia lui Chen:
n(n−1) 7∗6
= =21=Σ p ( x i )=21 ⇛ graful are drum hamiltonian
2 2

d H= x 2 , x 6 , x 4 , x 5 , x 3 , x 7 , x1

Problema 5

Să se determine acele legături conexe în grafurile cu circuite din figură.

x1 x2

x5 x3

x4

Matricea de incidenţă a grafului condensat:


x 1 x 2 x 3 x 4 x 5 Γ −1( x 1 ) Γ −1(x 3 ) Γ −1(x 5 )

A= x1 0 1 0 1 0 0 * *
x2 1 0 1 0 0 1 * *
x3 0 0 0 0 0 - 0 *
x4 0 1 1 0 0 2 * *
x5 1 0 0 1 0 1 - 0
Γ( x 1 ¿ 0 1 2 1 -
Γ( x 3 ¿ * * 0 * -
Γ( x 5 ¿ * * * * 0

C( x 1 ¿=¿ Γ( x 1 ¿ ∩ Γ −1( x 1 )= x 1 , x 2 , x 4
C( x 3 ¿=¿ Γ( x 3 ¿ ∩ Γ −1(x 3 )= x 3
C( x 5 ¿=¿ Γ( x 5 ¿ ∩ Γ −1(x 5 )= x 5
Construim matricea A(adunăm bulean pe coloană):
C (x¿ ¿1)C ( x 3 ) C ( x 5)¿

A= x1 1 0 0
x2 1 0 0
x3 0 0 0
x4 1 1 0
x5 1 0 0

Construim matricea A(adunăm bulean pe linie):

C (x¿ ¿1)C ( x 3 ) C ( x 5)¿

A= C( x 1 ¿ 1 1 0
C( x 3 ¿ 0 0 0
C (x5 ) 1 0 0
Scriem matricea de adiacenţă a grafului:
C (x¿ ¿1)C ( x 3 ) C ( x 5)¿

A¿= C( x 1 ¿ 0 1 0
C( x 3 ¿ 0 0 0
C (x5 ) 1 0 0
Se determină matricea D¿ :
C (x¿ ¿1)C ( x 3 ) C ( x 5)¿ p( x i ¿

D¿= C( x 1 ¿ 0 1 0 1
C( x 3 ¿ 0 0 0 0
C (x5 ) 1 1 0 2
Σ p( x i ¿=3

Relaţia lui Chen:


n(n−1) 3∗2
= =3=Σ p ( xi ) =3 ⇛ graful are drumuri hamiltoniene
2 2

C (x5 ) C( x 1 ¿ C( x 3 ¿
x 1 , x 4 , x2
x5 x2 , x2 , x4 x3
x 4 , x2 , x1

d H =x 5 , x 1 , x 4 , x2 , x3

Probleme drumuri optime in grafuri

Problema 1

Să se determine varianta tehnologică ce permite obţinerea unui timp minim


de prelucrare prin care se poate ajunge de la materia prima x0 la produsul finit
x6. 4 x 5

x2
11

15
x0
6 19
5
10
x4
10
14
12 x6
x3 18

Tabel 1

(xi , x j ¿ vij λ j−λ i(1) λ j−λ i(2) λ j−λ i(3)

( x ¿ ¿ 3 , x 6 )¿ 18 0 ∞* 11

* ( x ¿ ¿ 4 , x 6 )¿ 10 0 ∞ * 10
( x ¿ ¿ 5 , x 6 )¿ ∞
19 0 * 16
( x ¿ ¿ 0 , x5 )¿ 10 ∞ * 10 9
* ( x ¿ ¿ 2 , x 5 )¿ 4 0 5 * 4

* ( x ¿ ¿ 0 , x 4) ¿ 15 ∞ * 15 15
( x ¿ ¿ 2 , x 4 )¿ 11 0 10 10
( x ¿¿ 3 , x4 ) ¿ 1
12 0 1
* ( x ¿¿ 5 , x4 ) ¿ 6 0 5 6
* ( x ¿ ¿ 0 , x3 )¿ 14 ∞ * 14 14

* ( x ¿ ¿ 0 , x2 )¿ 5 ∞ * 5 5
Tabel 2

Nr λ0 λ2 λ3 λ4 λ5 λ6
crt
1 0 ∞ ∞ ∞ ∞ ∞

2 0 5 14 15 10 ∞

3 0 5 14 15 9 25
.

x2 4 x5

5
10
x0 15 x4
10
14
x6
x3

d min =x 0 , x 4 , x 6

Problema 2

x2 x6 1
5

4 x7
1 2 1` 3
x1
x5 x9
6
2
5 4
2 5
x3 4 x8

x4 3
Tabel 1

(xi , x j ¿ vij λ j−λ i(1) λ j−λ i(2) λ j−λ i(3) λ j−λ i(4 ) λ j−λ i(5) λ j−λ i(6) λ j−λ i(7)

* ( x ¿ ¿ 7 , x 9 ) ¿3 0 * 1 * 1 * 1 * 0 * 2 * 3
( x ¿ ¿ 8 , x9 )¿5 0 * 2 * 1 * 4 * 6 9 10

* ( x ¿ ¿ 4 , x 8 )¿3 0 * -1 * 2 * 3 3 3 3
( x ¿ ¿ 4 , x 7 )¿2 0 * 0 * 2 6 9 10 10
( x ¿ ¿ 5 , x 7 )¿
1 0 * -1 * 1 5 8 9 9
* ( x ¿ ¿ 6 , x7 )¿1 1 * -1 * -2 * -2 * 0 * 1 1
( x ¿ ¿ 8 , x7 ) ¿
4 0 * 1 * 0 * 3 * 6 7 7

* ( x ¿ ¿ 3 , x 6 )¿5 0 * 1 * 1 * 4 * 5 5 5
( x ¿ ¿ 5 , x 6 )¿2 0 * 0 * 3 7 8 8 8

* ( x ¿ ¿ 2 , x 5 )¿5 0 * 4 * 5 5 5 5 5
( x ¿ ¿ 2 , x 4 )¿4 0 * 3 * 4 4 4 4 4
( x ¿ ¿ 1 , x 3) ¿
2 0 * 4 * 8 9 9 4 9
* ( x ¿ ¿ 4 , x 3 )¿
4 0 * 0 * 3 * 4 4 4

* ( x ¿ ¿ 1 , x 2) ¿1 0 * 1 1 1 1 1 1

Tabel 2

Nr λ1 λ2 λ3 λ4 λ5 λ6 λ7 λ8 λ9
crt
1 0 0 0 0 0 0 0 0 0
2 0 1 4 4 5 5 4 3 5
3 0 1 8 5 6 9 7 7 8
4 0 1 9 5 6 13 11 8 12
5 0 1 9 5 6 14 14 8 14
6 0 1 9 5 6 14 15 8 17
7 0 1 9 5 6 14 15 8 18

x2 x6 1
5

4 x7
1 3
x1
x5 x9
6

x3 4 x8
x4 3

d max =x 1, x 2 , x 4 , x3 , x 6 , x 7 , x 9=18

n(n−1) 7∗6
= =21=Σ p ( x i )=21 ⇛ graful are drum hamiltonian
2 2

d H= x 2 , x 6 , x 4 , x 5 , x 3 , x 7 , x1

Problema 3

Se cere min x 0−x 6:


2
x1 x5
4
2
1
1
x0 x6
4 x2 3 x4 3

5 4
2

x3
În primul tabel se trec arcele grafului,valorile acestora şi se calculează
diferenţa λ j−λ i.Se marchează toate diferenţele mai mici decât vij.Se
recalculează λj(dacă avem 3 sau mai multe valori recalculate pentru aceeaşi
variabilă o considerăm pe cea mai mare.Se continuă iteraţia până cand nu mai
este posibilă marirea variabilei λ.

Tabel 1

(xi , x j ¿ vij λ j−λ i(1) λ j−λ i(2) λ j−λ i(3) λ j−λ i(4 )

( x ¿ ¿ 3 , x 6 )¿ 2 0 0 ∞∗¿ -1

* ( x ¿ ¿ 4 , x 6 )¿ 3 0 0 ∞ * 3
( x ¿ ¿ 5 , x 6 )¿ ∞
4 0 0 * 3
*
( x ¿ ¿ 1 , x 5) ¿ 2 0 ∞ * 2 2
* ( x ¿¿ 1 , x4 ) ¿ 2 0 ∞* 2 2
( x ¿ ¿ 2 , x 4 )¿ 3 0 ∞ * -1 -1
( x ¿¿ 5 , x4 ) ¿
1 0 0 0 0
( x ¿ ¿ 2 , x 3 )¿ 5 0 ∞ * 5 3
* ( x ¿ ¿ 4 , x 3 )¿ 4 0 0 6 * 4
( x ¿ ¿ 6 , x3 ) ¿
2 0 0 -∞ 1

* ( x ¿ ¿ 0 , x2 )¿ 4 ∞ * 4 4 4
* ( x ¿ ¿ 0 , x1 )¿ 1 ∞ * 1 1 1

Tabel 2

Nr crt λ0 λ1 λ2 λ3 λ4 λ5 λ6
1 0 ∞ ∞ ∞ ∞ ∞ ∞

2 0 1 4 ∞ ∞ ∞ ∞

3 0 1 4 9 3 3 ∞

4 0 1 4 7 3 3 6

Pentru a găsi drumul se aleg arcele care au la ultima iteraţie diferenţa strict
egală cu vij.
2
x1 x5
2

1
x0 x6
4 x2 x4 3

d min =x 0, x 1 , x 4 , x6 =6 x3

Problema 4
Să se determine ruta care stabileşte timpul optim de transmitere a
informaţiilor între nodurile x 0 şi x 8.

11
x1 x6
7
5 4
3 4 2

x0
7 x2 5 x5 6 x7 3 x8

4
5 4 4 14
1
x3 4 x4

Tabel 1

(xi , x j ¿ vij λ j−λ i(1) λ j−λ i(2) λ j−λ i(3) λ j−λ i(4 )

( x ¿ ¿ 4 , x 8 )¿ 14 0 0 ∞∗¿ 10

* ( x ¿ ¿ 6 , x8 )¿ 4 0 0 ∞ * 4
( x ¿¿ 7 , x8 ) ¿
3 0 0 0 2
( x ¿ ¿ 4 , x 7 )¿ 4 0 0 ∞∗¿ 8
* ( x ¿ ¿ 5 , x 7 )¿ 0 ∞∗¿
6 0 6
∞∗¿
* ( x ¿ ¿ 6 , x7 )¿ 2 0 0 2
* ( x ¿ ¿ 1 , x 6 )¿ 11 0 ∞* 11 11

* ( x ¿ ¿ 5 , x 6 )¿ 4 0 0 4 4
* ( x ¿ ¿ 1 , x 5) ¿ 7 0 ∞ * 7 7
( x ¿ ¿ 2 , x 5 )¿ 5 0 ∞ * 3 3
( x ¿ ¿ 4 , x 5 )¿ 4 0 0 2 2

* ( x ¿ ¿ 2 , x 4 )¿ 1 0 ∞ * 1 1
( x ¿¿ 3 , x4 ) ¿ 4 0 ∞ * 4 4
* ( x ¿ ¿ 0 , x3 )¿ 4 ∞ * 4 4 4

* ( x ¿ ¿ 0 , x2 )¿ 7 ∞ * 7 7 7

* ( x ¿ ¿ 1 , x 2) ¿ 5 0 4 4 4
( x ¿ ¿ 3 , x 2 )¿
5 0 3 3 3
*
( x ¿ ¿ 0 , x1 )¿ 3 ∞ * 3 3 3

Tabel 2

Nr λ0 λ1 λ2 λ3 λ4 λ5 λ6 λ7 λ8
crt
1 0 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞

2 0 3 7 4 ∞ ∞ ∞ ∞ ∞

3 0 3 7 4 8 10 14 ∞ ∞

4 0 3 7 4 8 10 14 16 18

11
x1 x6
7
5 4
3 4 2

x0
7 x2 x5 6 x7 x8

1
x3 x4
d min =x 0, x 1 , x 6 , x 8=18

Problema 5

Să se determine varianta tehnologică ce permite obţinerea unui timp minim


de prelucrare prin care se poate ajunge de la materia prima x0 la produsul finit
x6. 4 x 5

x2
11
6 19
5 15
10
x0 x4
10
14
12 x6
x3 18

Tabel 1

(xi , x j ¿ vij λ j−λ i(1) λ j−λ i(2) λ j−λ i(3) λ j−λ i(4 )

( x ¿ ¿ 3 , x 6 )¿ 18 0 ∞* 15 11

* ( x ¿ ¿ 4 , x 6 )¿ 10 0 0 14 * 10
( x ¿ ¿ 5 , x 6 )¿ ∞
19 0 * 20 * 16
( x ¿ ¿ 0 , x5 )¿ 10 ∞ * 10 9 9
* ( x ¿ ¿ 2 , x 5 )¿ 4 0 5 * 4 4

* ( x ¿ ¿ 0 , x 4) ¿ 15 ∞ * ∞ * 15 15
( x ¿ ¿ 2 , x 4 )¿ 11 0 ∞ * 10 10
( x ¿¿ 3 , x4) ¿ ∞
12 0 * 1 1
* ( x ¿ ¿ 0 , x3 )¿ 14 ∞ * 14 14 14

* ( x ¿ ¿ 0 , x2 )¿ 5 ∞ * 5 5 5

Tabel 2

Nr λ0 λ1 λ2 λ3 λ4 λ5
crt
1 0 ∞ ∞ ∞ ∞ ∞

2 0 5 14 ∞ 10 ∞

3 0 5 14 15 9 29
4 0 5 14 15 9 25
.

x2 4 x5

5
10
x0 15 x4
10
14
x6
x3

d min =x 0 , x 4 , x 6

Probleme flux maxim in retea de transport

Problema 1

Pentru a fi incalzita, apa de la un agent termic este trecuta, de la punctual de


colectare x 0 la punctual de iesire x 7, printr-un sistem de conducte care trec prin
mai multe cazane x 1 , x 2 , … , x 6, supuse sursei calorice.cunoscandu-se debitele
maxime suportate de conducte sa se organizeze transportul astfel incat sa se
obtina debitul maxim posibil in puctul x 7 pentru distributia la beneficiari.

5=5∙ X4 9=5+1+
8=5+3∙
X1

3=3∙

(+) X0 5=1+4∙ X7

1=1∙ 4=2+
3=2+1∙
X2 X5
15=3+4+1+
6=4+

2=2∙
X3 X6

4=1+
Pasul 1: seasociaza grafului fluxul nul φ u=0
Pasul 2: se cauta drumurile d care saa lege nodul sursa x 0 de nodul
destinatie x 7 format numai din noduri nesaturate. Pentru drumul gasit se
calculeaza Ɵ care se adauga la fluxul fiecarui arc din drumul d.
d :Ɵ=min ⁡(c ij ,φ ( x i , x j ))

d 1=x 0 , x1 , x 4 , x 7 ; Ɵ1=min ( 8,5,9 )=5


d 2=x 0 , x1 , x6 , x 7 ; Ɵ 2=min (3,3,15 )=3
d 3=x 0 , x2 , x 4 , x 7 ; Ɵ3 =min (5,1,4 )=1
d 4 =x 0 , x 2 , x 6 , x 7 ; Ɵ 4=min ( 4,6,12 ) =4
d 5=x 0 , x3 , x 5 , x 7 ; Ɵ5 =min ( 3,2,4 )=2
d 6 =x0 , x 3 , x 6 , x 7 ; Ɵ6 =min ( 1,4,8 )=1

Calculam fluxul total:


φ u=∑ Ɵi=Ɵ1+Ɵ 2+Ɵ 3+Ɵ 4+Ɵ 5 +Ɵ 6+Ɵ 7 = 5+3+1+4+2+1=16

Pasul 3: se marcheaza nodurile grafului in felul urmator:


 x 0 se noteaza cu “+”
 x i apatinand multimii de arce incidente spre exteriorul lui x 0 (x 0 , x i). x i se
noteaza “+ x 0 daca arcul ( x 0 , x i ) este nesaturat
 x k apartinand multimii de arce incidente spre interiorul lui x i. x k se
noteaza “- x i daca pe arcul ¿ ¿) fluxul este nenul.
Nodul destinatie x 7 nu a putut fi marcat, in aceasta situatie fluxul total din
retea este maxim.
Taietura in retea : se despart nodurile marcate de nodurile nemarcate. Se
formeaza o multime T in care se scriu arcele care au nodul initial marcat sic el
final nemarcat.
T ={( x 0 , x1 ) , ( x 0 , x 2 ) , ( x 0 , x 3 ) }
Capacitatea unei taieturi este suma capacitatii arcelor ce o compun.
CT =∑ c ij =8+5+3=16=φ0=φmax

Problema 2

(+X3
(-
4=4∙ )
7=4+3∙ X4)
X4 7=4+3∙
X1

X0 6=3+3∙
X6 (+X5
)
5=3+
(+)
3=3∙

8=5+
13=3+3+5+
4=3+

2=

5=5∙

Pasul 1: seasociaza grafului fluxul nul φ u=0

Pasul 2: se cauta drumurile d care saa lege nodul sursa x 0 de nodul


destinatie x 6 format numai din noduri nesaturate. Pentru drumul gasit se
calculeaza Ɵ care se adauga la fluxul fiecarui arc din drumul d.
d :Ɵ=min ⁡(c ij ,φ ( x i , x j ))
d 1=x 0 , x1 , x 4 , x 6 ; Ɵ1=min (7,4,7 )=4
d 2=x 0 , x1 , x5 , x 6 ; Ɵ 2=min (3,5,13 )=3
d 3=x 0 , x2 , x 4 , x 6 ; Ɵ3 =min ( 6,3,3 )=3
d 4 =x 0 , x 2 , x 5 , x 6 ; Ɵ 4=min ( 3,4,10 )=3
d 5=x 0 , x3 , x 5 , x 6 ; Ɵ5 =min ( 8,5,7 )=5

Calculam fluxul total:


φ 0=∑ Ɵi =Ɵ1+Ɵ2+Ɵ 3+Ɵ 4+Ɵ5 =¿4+3+3+3+5=18
Pasul 3: se marcheaza nodurile grafului in felul urmator:
 x 0 se noteaza cu “+”
 x i apatinand multimii de arce incidente spre exteriorul lui x 0 (x 0 , x i). x i se
noteaza “+ x 0 daca arcul ( x 0 , x i ) este nesaturat
 x k apartinand multimii de arce incidente spre interiorul lui x i. x k se
noteaza “- x i daca pe arcul ¿ ¿) fluxul este nenul.
Nodul destinatie x 6 este marcat, in aceasta situatie fluxul total din retea nu
este maxim.
Pasul 4: se constuieste lantul de la x 0 la x6 care contine numai arce marcate
astfel incat fiecare nod al lantului cu exceptia lui x 0 sa aiba in marcaj numele
nodului precedent in lantul respective.
l=( x 0 , x 3 , x 4 , x 1 , x 5 , x 6)
Pentru lantul ales calculam δ
δ =min (δ1 , δ 2 ), unde
δ 1=min ⁡(c ij −φij );
δ 2=min ⁡(φij ).

δ 1=min ( 3,2,2,2 )=2 ( in acelasi sens cu lantul)


δ 2=min ( φ ij ) =4 ( in sens contrar lantului)
δ =min (δ 1 , δ 2 )=min ( 2,4 )=2
φ 0 =φ0 +δ=¿18+2=20
'

Se aduna δ la fluxul arcelor de pe lantul construit, arce de acelasi sens cu


lantul si se scade δ la celelalte arce din fluxul arcelor ce au sens contrar lantului.

Pasul 5: se sterge marcajul si se reia de la pasul 3

(+X3
(- 4=4-2- )
7=4+3∙ X4)
X4 7=4+3∙
X1

5=3+2∙
X0 6=3+3∙
(+) X6 (+X5
3=3∙ )

X2 13=3+3+5+2∙
8=5+2+ (-
X4)
4=3+

2=2∙
X3 X5

(+X0 5=5∙ (+X1


) )

Taietura in retea : se despart nodurile marcate de nodurile nemarcate. Se


formeaza o multime T in care se scriu arcele care au nodul initial marcat sic el
final nemarcat.
T ={( x 0 , x1 ) , ( x 0 , x 2 ) , ( x3 , x 4 ) , ( x 3 , x 5 ) }
Capacitatea unei taieturi este suma capacitatii arcelor ce o compun.
CT =∑ c ij =7+6+ 2+5=20=φ0 =φ max
'

Problema 3

In figura de mai jos este prezentata o harta a unui oras. Arcele sunt strazi, iar
nodurile intersectii. Valoarea fiecarui arc reprezinta numarul maxim de masini
ce pot traversa strada respective, intr-o ora. Sa se determine numarul maxim de
masini care pot ajunge, intr-o ora, din nodul x 0 in nodul x 5 .

(-
60=40+20∙ X4)
40=40∙ X3
X1 60=40+10+
30=20+

(+ X0 X5
60
)

10=10∙
75=10+20+
(+X0
40=20+20∙
)
X4
X2
60=20+

Pasul 1: seasociaza grafului fluxul nul φ u=0


Pasul 2: se cauta drumurile d care saa lege nodul sursa x 0 de nodul
destinatie x 5 format numai din noduri nesaturate. Pentru drumul gasit se
calculeaza Ɵ care se adauga la fluxul fiecarui arc din drumul d.
d :Ɵ=min ⁡(c ij ,φ ( x i , x j ))

d 1=x 0 , x1 , x3 , x5 ; Ɵ1=min (60,40,40 )=40


d 2=x 0 , x1 , x 4 , x 5 ; Ɵ 2=min (20,30,40 )=20
d 3=x 0 , x2 , x3 , x 5 ; Ɵ3 =min (75,10,20 )=10
d 4 =x 0 , x 2 , x 4 , x 5 ; Ɵ 4=min ( 65,60,20 )=20

Calculam fluxul total:


φ u=∑ Ɵi=Ɵ1+Ɵ 2+Ɵ 3+Ɵ 4= 40+20+10+20=90

Pasul 3: se marcheaza nodurile grafului in felul urmator:


 x 0 se noteaza cu “+”
 x i apatinand multimii de arce incidente spre exteriorul lui x 0 (x 0 , x i). x i se
noteaza “+ x 0 daca arcul ( x 0 , x i ) este nesaturat
 x k apartinand multimii de arce incidente spre interiorul lui x i. x k se
noteaza “- x i daca pe arcul ¿ ¿) fluxul este nenul.
Nodul destinatie x 5 nu a putut fi marcat, in aceasta situatie fluxul total din
retea este maxim.
Taietura in retea : se despart nodurile marcate de nodurile nemarcate. Se
formeaza o multime T in care se scriu arcele care au nodul initial marcat sic el
final nemarcat.
T ={( x 1 , x3 ) , ( x 2 , x 3 ) , ( x 4 , x 5 ) }
Capacitatea unei taieturi este suma capacitatii arcelor ce o compun.
CT =∑ c ij =40+10+ 40=90=φ0=φmax

Problema 4

(-
5=5∙
X2) X4 15=5+
10=5+5∙
X1

(+ X0 6=3+3∙
) X0 5=5∙
(+X2 X7
) 8=5+3∙
10=2+4+
X2 12=3+2+4+
15=5+3+ X5
(+X0
) 4=2+
5=3+

X3 2=2∙ X6

(+X0
)
7=3+4∙

Pasul 1: seasociaza grafului fluxul nul φ u=0


Pasul 2: se cauta drumurile d care saa lege nodul sursa x 0 de nodul
destinatie x 7 format numai din noduri nesaturate. Pentru drumul gasit se
calculeaza Ɵ care se adauga la fluxul fiecarui arc din drumul d.
d :Ɵ=min ⁡(c ij ,φ ( x i , x j ))

d 1=x 0 , x1 , x 4 , x 7 ; Ɵ1=min (10,5,15 )=5


d 2=x 0 , x1 , x2 , x5 , x 7; Ɵ 2=min (5,5,15,8 )=5
d 3=x 0 , x2 , x5 , x 7 ; Ɵ3 =min ( 6,10,3 )=3
d 4 =x 0 , x 2 , x 3 , x 6 , x7 ; Ɵ 4=min ( 3,5,7,12 )=3
d 5=x 0 , x3 , x 5 , x 6 , x 7 ; Ɵ5 =min (10,2,4,9 )=2
d 6 =x0 , x 3 , x 6 , x 7 ; Ɵ 6 =min ( 8,4,7 )=4

Calculam fluxul total:


φ u=∑ Ɵi=Ɵ1+Ɵ 2+Ɵ 3+Ɵ 4+Ɵ 5 +Ɵ 6= 5+5+3+3+2+4 =22
Pasul 3: se marcheaza nodurile grafului in felul urmator:
 x 0 se noteaza cu “+”
 x i apatinand multimii de arce incidente spre exteriorul lui x 0 (x 0 , x i). x i se
noteaza “+ x 0 daca arcul ( x 0 , x i ) este nesaturat
 x k apartinand multimii de arce incidente spre interiorul lui x i. x k se
noteaza “- x i daca pe arcul ¿ ¿) fluxul este nenul.
Nodul destinatie x 7 nu a putut fi marcat, in aceasta situatie fluxul total din
retea este maxim.
Pasul 4: se constuieste lantul de la x 0 la x7 care contine numai arce marcate
astfel incat fiecare nod al lantului cu exceptia lui x 0 sa aiba in marcaj numele
nodului precedent in lantul respective.
l=( x 0 , x 3 , x 2 , x 5 , x 6 , x7 )
Pentru lantul ales calculam δ
δ =min (δ1 , δ 2 ), unde
δ 1=min ⁡(c ij −φij );
δ 2=min ⁡(φij ).

δ 1=min ( 4,7,2,3 )=2 ( in acelasi sens cu lantul)


δ 2=min ( φ ij ) =3 ( in sens contrar lantului)
δ =min (δ 1 , δ 2 )=min ( 2,3 ) =2
φ 0 =φ0 +δ=¿22+2=24
'
Se aduna δ la fluxul arcelor de pe lantul construit, arce de acelasi sens cu
lantul si se scade δ la celelalte arce din fluxul arcelor ce au sens contrar lantului.
Pasul 5: se sterge marcajul si se reia de la pasul 3

(-
5=5∙
X2) X4 15=5+
10=5+5∙
X1

(+ X0 6=3+3∙
) X0 5=5∙
(+X2 X7
) 8=5+3∙
X5
10=2+4+2+
X2 12=3+2+4+2+
15=5+3+2+
(+X0
) 4=2+2∙
5=3-2

X3 2=2∙ X6

(+X0 7=3+4∙
)
Taietura in retea : se despart nodurile marcate de nodurile nemarcate. Se
formeaza o multime T in care se scriu arcele care au nodul initial marcat sic el
final nemarcat.
T ={( x 1 , x 4 ) , ( x 5 , x6 ) , ( x 3 , x 6 ) , ( x 5 , x 7 ) }
Capacitatea unei taieturi este suma capacitatii arcelor ce o compun.
CT =∑ c ij =5+4 +7+8=24=φ 0=φ max

Problema 5

(-
4=4∙
10=4+6∙ X5)
X4 10=4+6∙
X2

(+ 8=6+
X1 X6
) 2 6=6∙
10=6+3 10=6+3

X3 X5

(+X3
9=6+3∙

Pasul 1: seasociaza grafului fluxul nul φ u=0


Pasul 2: se cauta drumurile d care saa lege nodul sursa x 0 de nodul
destinatie x 6 format numai din noduri nesaturate. Pentru drumul gasit se
calculeaza Ɵ care se adauga la fluxul fiecarui arc din drumul d.
d :Ɵ=min ⁡(c ij ,φ ( x i , x j ))

d 1=x 1 , x 2 , x 4 , x 6 ; Ɵ1=min (10,4,10 )=4


d 2=x 1 , x 2 , x 5 , x6 ; Ɵ 2=min ( 6,8,10 )=6
d 3=x 1 , x 3 , x5 , x 4 , x 6 ; Ɵ3 =min (10,9,6,6 )=6
d 4 =x 1 , x 3 , x 5 , x 6 ; Ɵ 4=min ( 4,3,4 )=3

Calculam fluxul total:


φ u=∑ Ɵi=Ɵ1+Ɵ 2+Ɵ 3=4+6+6+3=19
Pasul 3: se marcheaza nodurile grafului in felul urmator:
 x 0 se noteaza cu “+”
 x i apatinand multimii de arce incidente spre exteriorul lui x 0 (x 0 , x i). x i se
noteaza “+ x 0 daca arcul ( x 0 , x i ) este nesaturat
 x k apartinand multimii de arce incidente spre interiorul lui x i. x k se
noteaza “- x i daca pe arcul ¿ ¿) fluxul este nenul.
Nodul destinatie x 6 nu a putut fi marcat, in aceasta situatie fluxul total din
retea este maxim.
Taietura in retea : se despart nodurile marcate de nodurile nemarcate. Se
formeaza o multime T in care se scriu arcele care au nodul initial marcat sic el
final nemarcat.
T ={( x 1 , x2 ) , ( x 3 , x 5 ) }
Capacitatea unei taieturi este suma capacitatii arcelor ce o compun.
CT =∑ c ij =10+9=19=φ0=φ max

S-ar putea să vă placă și