1 Licence d’informatique Algorithmique des graphes Exploration de la descendance d’un sommet : numérotation conforme, énumération de chemins élémentaires, composantes fortement connexes. Utilisation de ce document strictement réservée aux étudiants de l ’IFSIC dans le cadre de leur formation. Reproduction ou diffusion en dehors de l ’IFSIC strictement interdite sauf
44
Embed
1 Licence dinformatique Algorithmique des graphes Exploration de la descendance dun sommet : numérotation conforme, énumération de chemins élémentaires,
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
Licence d’informatiqueAlgorithmique des graphes
Exploration de la descendance d’un sommet : numérotation conforme,
énumération de chemins élémentaires, composantes fortement connexes.
Utilisation de ce document strictement réservée aux étudiants de l ’IFSIC dans le cadre de leur formation.Reproduction ou diffusion en dehors de l ’IFSIC strictement interdite sauf autorisation expresse de l’ auteur.
2
Toute configuration de la pile est un chemin
Propriétés d’une exploration en profondeurPropriétés d’une exploration en profondeur
Démonstration : par induction sur les configurations de la pile.
chemin. un doncest C' .],,,[est ionconfigurat nouvelle La ..
chemin undécrit ],,,,,[
ionconfigurat nouvellela donc ),( cas, ce Dans.)(.
:avoir peut on suivante, étapel' A
chemin. undécrit ],,,,[ : Hypothèse
étape. uned' finla à pilela de ionconfiguratla ],,,,[Soit
11
11
11
11
k
kk
k
kk
kk
yyxdépilerp
yyyyx
yyyempilerp
yyyx
yyyxp
Corollaire : Soit z un sommet dans la pile. Alors :
tout sommet empilé au-dessus de z est un descendant de z
3
Applications de l’exploration en profondeurApplications de l’exploration en profondeur
• Recherche de numérotation conforme (ou de circuit)
• énumération de tous les chemins élémentaires * formulation récursive
4
Applications de l’exploration en profondeurApplications de l’exploration en profondeur
• Recherche de numérotation conforme (ou de circuit)
Un graphe possède une numérotation conforme si et seulement si il est sans circuit.
)()(),( si est
: sommets des onnumérotati Une: Définition
ynumxnumyxconforme
Xnum
5
Recherche de numérotation conforme (ou de circuit)Recherche de numérotation conforme (ou de circuit)
Propriété de l’exploration en profondeur (issue de x) :
yavant
zyzy
dépilé sera il 2)
empilé; sera alors empiléest si )1),(
Preuve :empilé.est donc )( aon ,),( commeet )( empilé 1) ** zxzzyxyy
2) Si z est empilé après y alors il sera dépilé avant y (propriétés de la pile)
),(),(et circuit sans yzzyG
Si z a été empilé avant y :
Or, tous les sommets empilés au-dessus d’un sommet z sont des descendants de z.
Donc, y ne sera empilé qu’après que z soit sorti de la pile.
C’est-à-dire : z est dépilé avant y
Si G est sans circuit, alors
6
Recherche de numérotation conformeRecherche de numérotation conforme
a
j
g
m
n
i
f
e
od
lkc
hb
7
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
a fa f ea f e oa f e o ia f e o i ja f e o i j m
a
8
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
a fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a
9
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
a fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i
14
a
10
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i
14 a f e o
13
11
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i
14 a f e o
13
12
a f e
12
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
13
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
14
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
10
a f
15
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14
a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
16
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a a l a l b a l b c
17
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
18
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
19
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
a fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
6
a
a
20
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
6
a
5
21
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
6
a
5
gg n
22
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
6
a
5
g
g n
4
g
3
23
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
6
a
5
g
g n
4
g
3
h
2
24
a
j
g
m
n
i
f
e
od
lkc
hb
PILE
aa fa f ea f e oa f e o ia f e o i ja f e o i j ma f e o i j
15
a f e o i 14 a f e o
13
12
a f e a f e d
11
a f e
10
a f
9
a
8
a l a l b a l b c a l b
7
a l
6
a
5
g
g n
4
g
3
h
2
k
1
25
a b c d e f g h i j k l m n oa x x x xb x xc xd xe x xf x xg x x x xh x x xi xj xk x x xl x xmn x xo x
a
j
g
m
n
if
e
od
lkc
hb
15
14
13
12
11 10
9
8
7
6
54
3
1
2
26
1 2 3 4 5 6 7 8 9 10 11 12 13 14 151 x x x x2 x x3 x x x4 x x x5 x x x x6 x x7 x x8 x9 x x10 x x11 x12 x13 x14 x15
a
j
g
m
n
if
e
od
lkc
hb
15
14
13
12
11 10
9
8
7
6
54
3
1
2
27
Stratégies gloutonnes et non gloutonnesStratégies gloutonnes et non gloutonnes
Calcul de la descendance d’un sommet donné :
pas de remise en cause d’un sommet terminé. Un tel sommet ne peut plus apporter d’informations nouvelles
énumération des chemins issus d’un sommet x :
remise en cause possible d’un sommet y terminé.
Un tel sommet peut appartenir à plusieurs chemins.
Si on le re-visite à partir d’un autre prédécesseur,
un nouvel ensemble de chemins (vers ses descendants) est trouvé.
28
Stratégies gloutonnes et non gloutonnesStratégies gloutonnes et non gloutonnes
énumération des chemins issus d’un sommet x :
remise en cause possible d’un sommet y terminé.
Un tel sommet peut appartenir à plusieurs chemins.
Si on le re-visite à partir d’un autre prédécesseur,
un nouvel ensemble de chemins (vers ses descendants) est trouvé.
Descendance de y explorée : y terminé.
On re-visite y en suivant un autre chemin u’
yx
u
Il faut ré-empiler y car u’ engendre de nouveaux chemins avec la descendance de y
u’
29
Stratégies gloutonnes et non gloutonnesStratégies gloutonnes et non gloutonnes
calcul de la descendance d’un sommet donné :
pas de remise en cause d’un sommet terminé.
énumération des chemins issus d’un sommet x :
remise en cause possible d’un sommet y terminé.
STRATEGIE GLOUTONNE : on « avance » toujours
STRATEGIE NON GLOUTONNE :
on « recule » parfois
30
ENUMERATION DE TOUS LES CHEMINS ELEMENTAIRES issus du sommet 1ENUMERATION DE TOUS LES CHEMINS ELEMENTAIRES issus du sommet 1