Vous êtes sur la page 1sur 8

Mme R.

BOUHOUCH Recherche opérationnelle

Chapitre 04

Arbre et Arborescence
1. Connexité
G est un graphe connexe si : ∀𝑖 ∈ 𝑋, ∀𝑗 ∈ 𝑋, ∃ 𝑢𝑛𝑒 𝑐ℎ𝑎𝑖𝑛𝑒 𝑟𝑒𝑙𝑖𝑎𝑛𝑡 𝑖 𝑒𝑡 𝑗.

K= nbr de connexité.

2. Algorithme de détermination des composantes connexes d’un


graphe :
1. Données : graphe G=(X,U)

Initialisation : K=1 et S=X.

2. Marquage :
 Marquer un sommet qcq de S.
 A partir de tout sommet marqué, marquer tous les sommets qui lui sont adjacents.
 Lorsque le marquage s’arrête, faire :

𝒞(𝐾) = {𝑠𝑜𝑚𝑚𝑒𝑡𝑠 𝑚𝑎𝑟𝑞𝑢è𝑠 𝑑𝑒 𝑆}

𝒞(𝐾) = 𝐾 é𝑚𝑚𝑒 𝑐𝑜𝑚𝑝𝑜𝑠𝑎𝑛𝑡𝑒 𝑑𝑒 𝐺

3. S= S- 𝒞(𝐾)

Si S=∅ → 𝑘 = 𝑛𝑏𝑟 𝑑𝑒 𝑐𝑜𝑛𝑛𝑒𝑥𝑖𝑡é 𝑑𝑒 𝐺 → 𝑓𝑖𝑛

Si non K=K+1 , retour en 2.

Remarque : Si k=1, G est connexe.

3. Arbre :
3.1. Définition :
Un arbre est un graphe connexe et sans cycle

1
Mme R. BOUHOUCH Recherche opérationnelle

Un arbre : il existe uniquement une chaine entre deux sommets quel conque.

3.2. Problème :
Etant donnée G=(X, U, l) avec G connexe, trouver un arbre dans G :

𝒜 = (𝑋, 𝑇)𝑎𝑣𝑒𝑐 𝑇 ⊂ 𝑈 𝑡𝑞 𝑙(𝒜) = ∑ 𝑙(𝑢)𝑠𝑜𝑖𝑡 𝑚𝑖𝑛𝑖𝑚𝑎𝑙 , 𝑙(𝒜): 𝑝𝑜𝑖𝑑 𝑑𝑒 𝑙′𝑎𝑟𝑏𝑟𝑒


𝑢∈𝑇

Remarque :

𝒜 = (𝑋, 𝑇) un arbre. Ajouter un arc à un arbre ⇒ 𝑐𝑟é𝑎𝑡𝑖𝑜𝑛 𝑑 ′ 𝑢𝑛𝑐𝑦𝑐𝑙𝑒 𝜇𝑢

Théorème :

𝒜 = (𝑋, 𝑇) arbre de poids minimal du graphe G=(X,U)⇔ ∀𝑢 ∈ 𝑈 − 𝑇, 𝑙(𝑢) = 𝑀𝑎𝑥𝑣∈𝜇𝑢 𝑙(𝑣)

3.3. Algorithme de Kruskal (désordonnée)


1/ Donner les arcs et leurs longueurs :

Initialisation : 𝑇 = ∅ k=1 et m=nbr d’arcs.

2/ T=T+{𝑢𝑘 }

Si T ne contient pas de cercle aller en 3/.

Si non T=T-{u} avec l(u)=𝑀𝑎𝑥𝑣∈𝜇 𝑙(𝑣)

3/ Si K≠m, K=K+1, retour en 2/

Si non 𝒜 = (𝑋, 𝑇) = 𝑎𝑟𝑏𝑟𝑒 𝑝𝑙𝑢𝑠 𝑚𝑖𝑛𝑖𝑚𝑎𝑙 → 𝑓𝑖𝑛

2
Mme R. BOUHOUCH Recherche opérationnelle

𝑢5
𝑢1230
120
𝑢2 20
10 110
𝑢11 𝑢3 𝑢1
40 100
60 50 𝑢7
𝑢10 𝑢6
𝑢9 40
30 130
𝑢4 𝑢8

3.4. Algorithme de Kruskal (ordonnée)


1/ Donner les arcs suivant les longueurs croissantes :

Initialisation : 𝑇 = ∅ k=1 et l=0.

2/ Si T+{𝑢𝑘 } forme un cycle aller en 3/

Si non T=T+{𝑢𝑘 } , l=l+1

3/ si 𝑙 =n-1 → 𝑓𝑖𝑛

Si non k=k+1, retour en 2/

𝑢4 40 𝑢1
10
𝑢3 30
50 20𝑢
𝑢7 𝑢5 2
70 90
60 120 𝑢8
𝑢6 𝑢10
𝑢9
100
180 300
𝑢11 𝑢12

3.5. Algorithme de Prim


1/ Initialisation : 𝜋(1) = 0

∀𝑖 , 𝜋(𝑖) = ∞

𝛼(1) = (0,0), 𝐴 = ∅, 𝑇=∅

2/ choisir 𝑖 ∈ 𝑋 − 𝐴 𝑡𝑞 ∶ 𝜋(𝑖) = 𝑀𝑖𝑛𝑗∈𝑋−𝐴 𝜋(𝑗)

Faire 𝐴 = 𝐴 + {𝑖}

3
Mme R. BOUHOUCH Recherche opérationnelle

Si 𝛼(1) ≠ (0,0), 𝑇 = 𝑇 + { 𝛼(𝑖)}

3/ Si A=X → 𝒜 = (𝐴, 𝑇) = 𝑎𝑟𝑏𝑟𝑒 𝑑𝑒 𝑝𝑜𝑖𝑑 𝑚𝑖𝑛𝑖𝑚𝑎𝑙 → 𝑓𝑖𝑛

Si non ∀𝑗 ∈ 𝑋 − 𝐴 tq j adjacent à i faire

𝜋(𝑗) = 𝑀𝑖𝑛 ( 𝜋(𝑗) + 𝑙𝑗𝑖 ), 𝑠𝑖 𝜋(𝑗) = 𝑙𝑗𝑖 𝑓𝑎𝑖𝑟𝑒 𝛼(𝑗) = (𝑗, 𝑖)𝑟𝑒𝑡𝑜𝑢𝑟 𝑒𝑛 2/

Exemple :

1
40 120

7 20 2
30 100
50 130
8
80 10

6 3
60 50
10 40
5 4
90
1 2 3 4 5 6 7 8

𝜋𝛼 +∞ +∞ +∞ 0 +∞ +∞ +∞ +∞
(0,0)
𝜋𝛼 +∞ +∞ 80 90 +∞ +∞ 50
(4,3) (4,5) (4,8)
𝜋𝛼 20 100 10 60 80 30
(8,1) (8,2) (8,3) (8,5) (8,6) (8,7)
𝜋𝛼 20 100 60 80 30
(8,1) (8,2) (8,5) (8,6) (8,7)

𝜋𝛼 100 60 80 30
(8,2) (8,5) (8,6) (8,7)

𝜋𝛼 100 60 50
(8,2) (8,5) (7,6)

𝜋𝛼 100 10
(8,2) (6,5)

𝜋𝛼 100
(8,2)

4
Mme R. BOUHOUCH Recherche opérationnelle

4. Problème d’arborescence de poids minimale :


4.1. Définition
 Un sommet 𝑟 ∈ 𝑋 est une racine s’il existe un chemin de r vers tout sommet i différent
de r.
 Arborescence : arbre possédant une racine r.

Connexité+ sans cycle+ r racine

∃! 𝑐ℎ𝑒𝑚𝑖𝑛 𝑑𝑒 𝑟 𝑣𝑒𝑟 𝑖, ∀𝑖 ≠ 𝑟

4.2. Problème
Etant donnée G un graphe G=(X,U,l), avec r racine, on cherche dans G une arborescence de
poids minimale.

Remarque : Condition nécessaire pour qu’un graphe soit une arborescence de racine r :

 d°int( r)= 0
 d°int( i)= 1

Donc pour chaque sommet i≠r retenir l’arc incident intérieurement à i de moindre coût.

→ Former un graphe partiel qui vérifie la condition nécessaire à moindre coût.

Exemple :

60 r 1
1 40

1 2 2

4
3
20 10

4 3
10

5
Mme R. BOUHOUCH Recherche opérationnelle

60 r
30 50 1
40

1 2 2
60

5
3
7 4
4 3
6

Ou bien on obtient une arborescence de poids minimale ou bien on obtient un circuit 𝜇.

4.3. Cas d’obtention d’un circuit :


Graphe contracté :

6
Mme R. BOUHOUCH Recherche opérationnelle

 Définition : Graphe contracté par rapport aux sommets du circuit 𝜇: 𝐺/𝜇

Dans 𝐺/𝜇:

- Les sommets de 𝜇 sont représentés par un seul sommet 𝜇


- Les arcs incidents intérieurs aux sommets de 𝜇 auront dans 𝐺/𝜇 des longueurs
représentant l’augmentation qu’ils vont occasionner lorsqu’ils remplacent un arc de 𝜇 :

7
Mme R. BOUHOUCH Recherche opérationnelle

𝑙 ′ (𝑢) = 𝑙(𝑢) − 𝑙(𝑣) 𝑎𝑣𝑒𝑐 𝑣 ∈ 𝜇 𝑒𝑡 𝑣 = (𝑘, 𝑗)

- Le reste du graphe G est inchangé

4.4. Algorithme de détermination d’une arborescence de poids


minimale dans G :
1/ G0=G, k=0

2/ Formes dans Gk un graphe partiel Ak vérifiant les conditions nécessaires au moindre coût.

3/ Si AK ne contient pas de circuit alors Ak= arborescence de poids minimale

Si non, il existe 𝜇 un circuit tq Gk+1=Gk /𝜇, k=k+1, retour en 2/

Vous aimerez peut-être aussi