SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
Dr. Ammar LADJAILIA Université de Souk Ahras
Complexité algorithmique
UNIVERSITÉ DE SOUK AHRAS
FACULTÉ DES SCIENCES ET DE LA TECHNOLOGIE
DÉPARTEMENT DE MATHÉMATIQUES ET INFORMATIQUE
Dr. Ammar Ladjailia Université de Souk Ahras
Plan
➔ Notion de algorithme, programme, …
➔ Complexité
➔Typologies
➔Complexité des problèmes
2
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
L’analyse de la complexité d’un algorithme
consiste à l’étude formelle de la quantité des
ressources (temps + espace mémoire) nécessaire
pour exécuter de cet algorithme.
Dr. Ammar Ladjailia Université de Souk Ahras
Notion d’un algorithme
Un algorithme décrit une suite finie, organisée et
non ambiguë des opérations élémentaires
(instructions) pour résoudre un problème posé.
Dr. Ammar Ladjailia Université de Souk Ahras
Quels sont les critères attendus d’un algorithme correct ?
Critères
Terminaison Fiabilité
Temps Espace
Dr. Ammar Ladjailia Université de Souk Ahras
Notion d’un programme
C’est la réalisation (l’implémentation) d’un
algorithme au moyen d’un langage donné
(C/C++, Java, Php,...) sur une machine (PC,
mobile, Mac, … )
Dr. Ammar Ladjailia Université de Souk Ahras
Problématique de l’Algorithmique
Problématique
Trouver des solutions (méthodes) exactes ou
approchées d’un problème.
Trouver des solutions efficaces (étude de la
complexité algorithmique)
Dr. Ammar Ladjailia Université de Souk Ahras
Problématique de l’Algorithmique
Problématique
Trouver des solutions (méthodes) exactes ou
approchées d’un problème.
Solution exacte Solution approchée
Solution exacte selon ∆
Pas de méthode générale
de résolution
(Théorie de Galois)
Dr. Ammar Ladjailia Université de Souk Ahras
Quels sont les critères attendus d’un algorithme correct ?
Critères
Terminaison Fiabilité
Temps Espace
Dr. Ammar Ladjailia Université de Souk Ahras
Terminaison d’un algorithme
✓ Étant donné un algorithme et des valeurs, la question de
sa terminaison est de savoir s’il s’arrêtera s’il prend en
entrée ces valeurs.
✓ La terminaison est une propriété fondamentale des
algorithmes.
✓ Cela signifier que le programme ne doit pas avoir la
boucle infinie.
Dr. Ammar Ladjailia Université de Souk Ahras
Terminaison d’un algorithme
Dr. Ammar Ladjailia Université de Souk Ahras
Terminaison d’un algorithme
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
C’est l’étude de l’efficacité d’un algorithme de point de vue
le temps et l’espace
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité des entrées (Variables)
La complexité ou la taille d’une entrée est le nombre
d’octets nécessaires à sa représentation.
Complexité d’une variable booléenne
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité des entrées (Variables)
La complexité ou la taille d’une entrée est le nombre
d’octets nécessaires à sa représentation.
Complexité d’un entier
Taille fixe
Taille dynamique
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité de traitements (Instructions)
Un programme est un objet qui à partir de toutes entrées
permet d’exécuter des instructions en consommant deux
ressources :
• Le temps : Le nombre des instructions élémentaires à
exécuter.
• L’espace : C’est l’espace nécessaire pour l’exécution d’un
programme.
Dr. Ammar Ladjailia Université de Souk Ahras
Instruction élémentaire
Une instruction est dite élémentaire si elle peut être
exécutée en un temps fixe.
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
Séquence d’instructions
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
Instructions conditionnelles
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
Instruction d’itération finie bornée
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
Instruction d’itération finie non bornée
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un algorithme
Dr. Ammar Ladjailia Université de Souk Ahras
Typologies de la complexité
Dr. Ammar Ladjailia Université de Souk Ahras
Typologies de la complexité
Complexité en meilleur des
cas : O(1)
Complexité en moyen des
cas : O(log2(n))
Complexité en pire des cas :
O(n)
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité d’un problème
Il n’existe pas une méthode générale pour
calculer la complexité d’un programme,
mais on cherche la classe à laquelle elle
appartient.
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité : Notion de Laundo
Dr. Ammar Ladjailia Université de Souk Ahras
Classes algorithmique
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité : Tri à bulle
Un tri est une opération de classement d’éléments d’une
liste selon un ordre total défini.
Le tri à bulles ou tri par propagation est un algorithme de
tri. Il consiste à comparer répétitivement les éléments
consécutifs d’un tableau, et à les permuter lorsqu’ils sont
mal triés.
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité : Tri à bulle
Le tri à bulles ou tri par propagation est un algorithme de
tri. Il consiste à comparer répétitivement les éléments
consécutifs d’un tableau, et à les permuter lorsqu’ils sont
mal triés.
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité : Tri à bulle
Dr. Ammar Ladjailia Université de Souk Ahras
Complexité : Tri à bulle
Dr. Ammar Ladjailia Université de Souk Ahras

Contenu connexe

En vedette

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

complexite algorithmique

  • 1. Dr. Ammar LADJAILIA Université de Souk Ahras Complexité algorithmique UNIVERSITÉ DE SOUK AHRAS FACULTÉ DES SCIENCES ET DE LA TECHNOLOGIE DÉPARTEMENT DE MATHÉMATIQUES ET INFORMATIQUE
  • 2. Dr. Ammar Ladjailia Université de Souk Ahras Plan ➔ Notion de algorithme, programme, … ➔ Complexité ➔Typologies ➔Complexité des problèmes 2
  • 3. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme L’analyse de la complexité d’un algorithme consiste à l’étude formelle de la quantité des ressources (temps + espace mémoire) nécessaire pour exécuter de cet algorithme.
  • 4. Dr. Ammar Ladjailia Université de Souk Ahras Notion d’un algorithme Un algorithme décrit une suite finie, organisée et non ambiguë des opérations élémentaires (instructions) pour résoudre un problème posé.
  • 5. Dr. Ammar Ladjailia Université de Souk Ahras Quels sont les critères attendus d’un algorithme correct ? Critères Terminaison Fiabilité Temps Espace
  • 6. Dr. Ammar Ladjailia Université de Souk Ahras Notion d’un programme C’est la réalisation (l’implémentation) d’un algorithme au moyen d’un langage donné (C/C++, Java, Php,...) sur une machine (PC, mobile, Mac, … )
  • 7. Dr. Ammar Ladjailia Université de Souk Ahras Problématique de l’Algorithmique Problématique Trouver des solutions (méthodes) exactes ou approchées d’un problème. Trouver des solutions efficaces (étude de la complexité algorithmique)
  • 8. Dr. Ammar Ladjailia Université de Souk Ahras Problématique de l’Algorithmique Problématique Trouver des solutions (méthodes) exactes ou approchées d’un problème. Solution exacte Solution approchée Solution exacte selon ∆ Pas de méthode générale de résolution (Théorie de Galois)
  • 9. Dr. Ammar Ladjailia Université de Souk Ahras Quels sont les critères attendus d’un algorithme correct ? Critères Terminaison Fiabilité Temps Espace
  • 10. Dr. Ammar Ladjailia Université de Souk Ahras Terminaison d’un algorithme ✓ Étant donné un algorithme et des valeurs, la question de sa terminaison est de savoir s’il s’arrêtera s’il prend en entrée ces valeurs. ✓ La terminaison est une propriété fondamentale des algorithmes. ✓ Cela signifier que le programme ne doit pas avoir la boucle infinie.
  • 11. Dr. Ammar Ladjailia Université de Souk Ahras Terminaison d’un algorithme
  • 12. Dr. Ammar Ladjailia Université de Souk Ahras Terminaison d’un algorithme
  • 13. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme C’est l’étude de l’efficacité d’un algorithme de point de vue le temps et l’espace
  • 14. Dr. Ammar Ladjailia Université de Souk Ahras Complexité des entrées (Variables) La complexité ou la taille d’une entrée est le nombre d’octets nécessaires à sa représentation. Complexité d’une variable booléenne
  • 15. Dr. Ammar Ladjailia Université de Souk Ahras Complexité des entrées (Variables) La complexité ou la taille d’une entrée est le nombre d’octets nécessaires à sa représentation. Complexité d’un entier Taille fixe Taille dynamique
  • 16. Dr. Ammar Ladjailia Université de Souk Ahras Complexité de traitements (Instructions) Un programme est un objet qui à partir de toutes entrées permet d’exécuter des instructions en consommant deux ressources : • Le temps : Le nombre des instructions élémentaires à exécuter. • L’espace : C’est l’espace nécessaire pour l’exécution d’un programme.
  • 17. Dr. Ammar Ladjailia Université de Souk Ahras Instruction élémentaire Une instruction est dite élémentaire si elle peut être exécutée en un temps fixe.
  • 18. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme Séquence d’instructions
  • 19. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme Instructions conditionnelles
  • 20. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme Instruction d’itération finie bornée
  • 21. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme Instruction d’itération finie non bornée
  • 22. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme
  • 23. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un algorithme
  • 24. Dr. Ammar Ladjailia Université de Souk Ahras Typologies de la complexité
  • 25. Dr. Ammar Ladjailia Université de Souk Ahras Typologies de la complexité Complexité en meilleur des cas : O(1) Complexité en moyen des cas : O(log2(n)) Complexité en pire des cas : O(n)
  • 26. Dr. Ammar Ladjailia Université de Souk Ahras Complexité d’un problème Il n’existe pas une méthode générale pour calculer la complexité d’un programme, mais on cherche la classe à laquelle elle appartient.
  • 27. Dr. Ammar Ladjailia Université de Souk Ahras Complexité : Notion de Laundo
  • 28. Dr. Ammar Ladjailia Université de Souk Ahras Classes algorithmique
  • 29. Dr. Ammar Ladjailia Université de Souk Ahras Complexité : Tri à bulle Un tri est une opération de classement d’éléments d’une liste selon un ordre total défini. Le tri à bulles ou tri par propagation est un algorithme de tri. Il consiste à comparer répétitivement les éléments consécutifs d’un tableau, et à les permuter lorsqu’ils sont mal triés.
  • 30. Dr. Ammar Ladjailia Université de Souk Ahras Complexité : Tri à bulle Le tri à bulles ou tri par propagation est un algorithme de tri. Il consiste à comparer répétitivement les éléments consécutifs d’un tableau, et à les permuter lorsqu’ils sont mal triés.
  • 31. Dr. Ammar Ladjailia Université de Souk Ahras Complexité : Tri à bulle
  • 32. Dr. Ammar Ladjailia Université de Souk Ahras Complexité : Tri à bulle
  • 33. Dr. Ammar Ladjailia Université de Souk Ahras