Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cours
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
algorithmique
cours
Commits
2acaac60
Commit
2acaac60
authored
1 month ago
by
paul.albuquer
Browse files
Options
Downloads
Patches
Plain Diff
Edit cours_25.md
parent
e9acc33b
No related branches found
No related tags found
No related merge requests found
Pipeline
#40703
passed
1 month ago
Stage: test
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
slides/cours_25.md
+11
-11
11 additions, 11 deletions
slides/cours_25.md
with
11 additions
and
11 deletions
slides/cours_25.md
+
11
−
11
View file @
2acaac60
...
...
@@ -42,7 +42,7 @@ date: "2025-06-06"
# Formalisation: Les arbres couvrants
*
Qu'est-ce qu'un arbre couvrant? Des idées? De quel objet
on
part? Où va-t-on?
*
Qu'est-ce qu'un arbre couvrant? Des idées? De quel objet part
-on
? Où va-t-on?
. . .
...
...
@@ -55,7 +55,7 @@ date: "2025-06-06"
# Arbres couvrants
*
Quels algorithmes que nous avons déjà vus permettent de construire des arbres couvrants?
*
Quels algorithmes que nous avons déjà vus
,
permettent de construire des arbres couvrants?
. . .
...
...
@@ -63,11 +63,11 @@ date: "2025-06-06"
. . .


# Arbres couvrants minimaux
*
Un
*arbre couvrant minimal*
est un sous-graphe d'un graphe non-orienté pondéré $G(V,E)$
,
tel quel:
*
Un
*arbre couvrant minimal*
est un sous-graphe d'un graphe non-orienté pondéré $G(V,E)$ tel quel:
*
C'est un arbre (graphe acyclique);
*
Il couvre tous les sommets de $G$ et contient $|V|-1$ arêtes;
*
Le coût total associé aux arêtes de l'arbre est minimum parmi tous les arbres couvrants possibles.
...
...
@@ -84,7 +84,7 @@ date: "2025-06-06"
*
Comment générer un arbre couvrant minimal?


# Algorithme de Prim
...
...
@@ -491,13 +491,13 @@ sommets, parent prim(file_priorité, distance, parent)
tant que !est_vide(fp)
s_courant, fp = défiler(fp)
sommets = insérer(sommets, s_courant)
pour s_voi
n
sin dans voisinage(s_courant) et pas dans sommets
pour s_voisin dans voisinage(s_courant) et pas dans sommets
// ou dans fp
si poids(s_courant, s_voi
n
sin) < distance[s_voi
n
sin]
parent[s_voi
n
sin] = s_courant
distance[s_voi
n
sin] = poids(s_courant, s_voi
n
sin)
si poids(s_courant, s_voisin) < distance[s_voisin]
parent[s_voisin] = s_courant
distance[s_voisin] = poids(s_courant, s_voisin)
fp = changer_priorité(fp,
s_voi
n
sin, poids(s_courant, s_voi
n
sin))
s_voisin, poids(s_courant, s_voisin))
retourne sommets, parent
```
...
...
@@ -531,7 +531,7 @@ O(|V|) u, fp = défiler(file_priorité)
sommets = insérer(sommets, u)
pour v dans voisinage de u et pas dans sommets
O(|E|) si w(u, v) < distance[v]
// màj dista + parent
// màj dista
nce
+ parent
O(|V|) fp = changer_priorité(fp, w, w(u, v))
retourne sommets, parent
```
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment