Algorithme minimax

L'algorithme minimax (aussi appelé algorithme MinMax) est un algorithme qui s'applique à la théorie des jeux[1] pour les jeux à deux joueurs à somme nulle (et à information complète) consistant à minimiser la perte maximum (c'est-à-dire dans le pire des cas). Pour une vaste famille de jeux, le théorème du minimax de von Neumann assure l'existence d'un tel algorithme[2], même si dans la pratique il n'est souvent guère aisé de le trouver. Le jeu de hex est un exemple où l'existence d'un tel algorithme est établie et montre que le premier joueur peut toujours gagner, sans pour autant que cette stratégie soit connue.

Il amène l'ordinateur à passer en revue toutes les possibilités pour un nombre limité de coups et à leur assigner une valeur qui prend en compte les bénéfices pour le joueur et pour son adversaire. Le meilleur choix est alors celui qui minimise les pertes du joueur tout en supposant que l'adversaire cherche au contraire à les maximiser (le jeu est à somme nulle).

Il existe différents algorithmes basés sur MinMax permettant d'optimiser la recherche du meilleur coup en limitant le nombre de nœuds visités dans l'arbre de jeu, le plus connu est l'élagage alpha-bêta. En pratique, l'arbre est souvent trop vaste pour pouvoir être intégralement exploré (comme pour le jeu d'échecs ou de go). Seule une fraction de l'arbre est alors explorée.

Dans le cas d'arbres très vastes, une IA (système expert, évaluation par apprentissage à partir d'exemple, etc.) peut servir à élaguer certaines branches sur la base d'une estimation de leur utilité. C'est ce qui est employé, par exemple, dans le cadre du go.

Principe

L'algorithme minimax visite l'arbre de jeu pour faire remonter à la racine une valeur (appelée « valeur du jeu ») qui est calculée récursivement de la façon suivante :

  • minimax(p) = f(p) si p est une feuille de l’arbre où f est une fonction d’évaluation de la position du jeu ;
  • minimax(p) = max(minimax(O1), …, minimax(On)) si p est un nœud Joueur avec fils O1, …, On ;
  • minimax(p) = min(minimax(O1), …, minimax(On)) si p est un nœud Opposant avec fils O1, …, On.

Exemple

Dans le schéma ci-dessus, les nœuds gris représentent les nœuds joueurs et les bleus les nœuds opposants. Pour déterminer la valeur du nœud A, on choisit la valeur maximum de l’ensemble des nœuds B (A est un nœud joueur). Il faut donc déterminer les valeurs des nœuds B qui reçoivent chacun la valeur minimum stockée dans leurs fils (les nœuds B sont opposants). Les nœuds C sont des feuilles, leur valeur peut donc être calculée par la fonction d’évaluation.

Le nœud A prend donc la valeur 5. Le joueur doit donc jouer le coup l’amenant en B2. En observant l’arbre, on comprend bien que l’algorithme considère que l’opposant va jouer de manière optimale : il prend le minimum. Sans ce prédicat, on choisirait le nœud C1 qui propose le plus grand gain et le prochain coup sélectionné amènerait en B1. Mais alors on prend le risque que l’opposant joue C3 qui propose seulement un gain de 3.

En pratique, la valeur théorique de la position P ne pourra généralement pas être calculée. En conséquence, la fonction d’évaluation sera appliquée sur des positions non terminales. On considérera que plus la fonction d’évaluation est appliquée loin de la racine, meilleur est le résultat du calcul. C'est-à-dire qu’en examinant plus de coups successifs, nous supposons obtenir une meilleure approximation de la valeur théorique donc un meilleur choix de mouvement.

Simplification negamax

Si l’ensemble des valeurs prises par f(p) est symétrique par rapport à 0[1] une fonction g(p) peut être définie telle que :

  • g(p) = f(p) si nous sommes sur un nœud joueur
  • g(p) = –f(p) si nous sommes sur un nœud opposant

Ainsi on définit negamax à partir de cette nouvelle fonction :

  • negamax(p) = g(p) si P est terminale
  • negamax(p) = max(–NegaMax(pi)) sinon

À partir du même exemple que pour l’algorithme Minmax, voici l'arbre résultant :

Pseudocode

Le pseudocode de l'algorithme minimax de profondeur limitée est présenté ci-dessous :

function minimax(node, depth, maximizingPlayer) is
    if depth = 0 or node is a terminal node then
        return the heuristic value of node
    if maximizingPlayer then
        value := −∞
        for each child of node do
            value := max(value, minimax(child, depth − 1, FALSE))
    else (* minimizing player *)
        value := +∞
        for each child of node do
            value := min(value, minimax(child, depth − 1, TRUE))
    return value


(* Initial call *)
minimax(origin, depth, TRUE)

Applications

Minimax et théorie statistique de choix

Dans la théorie statistique de choix, nous avons un estimateur δ qui vise à trouver un paramètre θ ∈ Θ. Dans ce cadre, θ 'minimax' si :


Élagage alpha-bêta

Cet algorithme peut être optimisé grâce à l'implémentation de la technique dite de l'élagage alpha-bêta[1]. L'algorithme alpha bêta accélère la routine de recherche minimax en éliminant les cas qui ne seront pas utilisés. Cette méthode utilise le fait que tous les autres niveaux de l’arbre seront maximisés et que tous les autres niveaux seront minimisés.

Annexes

Notes

  1. a b et c Jean-Marc Alliot et Thomas Schiex, « La programmation des jeux », dans Intelligence artificielle et Informatique théorique, Cepadues, (ISBN 2-85428-324-4)
  2. Mais si les joueurs ne connaissent pas les coups joués par leur adversaire, comme dans le jeu pierre-feuille-ciseaux, cet algorithme ne conduit qu'à des stratégies demandant l'utilisation du hasard; voir l'article sur le théorème pour plus de détails

Bibliographie

Articles connexes

Liens externes

Read other articles:

«Ніка» Повна назва Жіночий футбольний клубНіка (Миколаїв) Засновано 2014 Населений пункт Миколаїв,  Україна Стадіон Парк Перемоги Вміщує 5 000 Ліга Вища ліга України 2020/21 Домашня Виїзна У Вікіпедії є статті про інші значення цього терміна: Ніка (значення). Жіночий футбольн�...

كأس العالم لكرة السلة 1998 المعطيات المنطقة العالم المستضيف  اليونان العام 1998 التواريخ 29 يوليو – 9 أغسطس الاتحادات ? الفرق 16 المدن 1 الملاعب 2 البطل يوغوسلافيا (للمرة الـ 4 ) موقع ويب 1998 FIBA World Championship 1994 2002 تعديل مصدري - تعديل   بطولة كأس العالم لكرة السلة 1998 أقيمت في اليونان.&...

Long-running Welsh language variety show Noson LawenTitle card (2018–present)GenreComedyVariety showPresented byVariousCountry of originWalesOriginal languageWelshProductionExecutive producerDylan HuwsProducerOlwen MeredyddProduction locationVariousRunning time60 minutes (inc. adverts)Production companyCwmni Da (1997–)Original releaseNetwork S4C Release11 November 1982 (1982-11-11) –presentRelatedRoyal Variety Performance Noson Lawen is a long-running Welsh language televi...

У Вікіпедії є статті про інші значення цього терміна: Бокове. село Бокове Автобусна зупинка сіл Бокове та Чайківка на трасі Кропивницький - Кишинів Країна  Україна Область Одеська область Район  Подільський район Громада Любашівська селищна громада Код КАТОТТГ UA51120...

Die Etschtaler Vulkanit-Gruppe, früher auch Bozener Quarzporphyr genannt, ist eine vulkanisch-sedimentäre lithostratigraphische Gruppe in den Südalpen im Raum Bozen. Die im unteren Perm nach Datierungen an Zirkonen vor etwa 285 bis 275 Millionen Jahren entstandenen Gesteine haben eine Mächtigkeit von bis zu 4000 Metern und eine Ausdehnung von über 2000 Quadratkilometern[1]. Die Vulkanit-Gruppe liegt diskordant dem südalpinen Kristallin auf, örtlich auch dem Waidbrucker Konglome...

Certification mark This article is about the Enhanced CD certification mark. For the Enhanced Music CD format (also known as CD+Extra/CD+Plus), see Blue Book (CD standard). Official Enhanced Compact Disc logo/trademark Enhanced Music Compact Disc logo/trademark Compact Disc Interactive logo/trademark Enhanced CD is a certification mark of the Recording Industry Association of America for various technologies that combine audio and computer data for use in both compact disc and CD-ROM players....

French singer You can help expand this article with text translated from the corresponding article in French. (January 2015) Click [show] for important translation instructions. View a machine-translated version of the French article. Machine translation, like DeepL or Google Translate, is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-translated text into the ...

Argentine footballer and manager This article does not cite any sources. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Manuel Giúdice – news · newspapers · books · scholar · JSTOR (February 2021) (Learn how and when to remove this template message) Manuel Giúdice Giúdice on the cover of El Gráfico 2383 in 1965Personal informationFull name Manuel Ernesto Giúd...

Historic house in Sheringham, EnglandBarningham HallViewed from the north westGeneral informationTypeHistoric houseLocationBarningham WinterAddressBarningham Hall, Matlask, Norfolk, NR11 7HYTown or citySheringhamCountryEnglandCoordinates52°52′24″N 1°11′21″E / 52.873257°N 1.189029°E / 52.873257; 1.189029Completed1612Renovated1805ClientSir Edward PastonDesign and constructionArchitect(s)John Adey Repton (hall),Humphrey Repton (1805 renovations)Website Listed ...

دوري الدرجة الأولى الليتواني 2009 تفاصيل الموسم دوري الدرجة الأولى الليتواني  النسخة 20  البلد ليتوانيا  التاريخ بداية:4 أبريل 2009  نهاية:31 أكتوبر 2009  المنظم اتحاد ليتوانيا لكرة القدم  البطل نادي إكراناس  مباريات ملعوبة 112   عدد المشاركين 8   دوري الدرجة ال...

Portioned snus of the Swedish label General Smoking in Sweden is at a very low prevalence; only 6% of the Swedish population (age 16-84) smoked daily in 2021. The prevalence among women has been higher for many years, but is now the same as for men. Around 5% smoke occasionally.[1] Smoking has been banned in all bars and restaurants since May 2005.[2] A majority of Swedes supported the introduction of the ban.[2] In 2019 the ban was extended to also include outdoor sea...

The Bone Key Cover of first editionAuthorSarah MonetteCountryUnited StatesLanguageEnglishSeriesKyle Murchison BoothGenreHorror fictionPublisherPrime BooksPublication date2007Media typeprint (paperback)Pages255ISBN978-0-8095-5777-6 The Bone Key: The Necromantic Mysteries of Kyle Murchison Booth is a collection of mystery horror short stories by American writer Sarah Monette featuring her puzzle-solving archivist character Kyle Murchison Booth. It was first published in trade paperback by ...

Expendable launch system used by the US Air Force Titan IVA Titan IV-B rocket carrying the Cassini-Huygens space research mission before takeoff from Launch Complex 40 on Cape Canaveral, 12 October 1997 (NASA)FunctionHeavy-lift launch vehicleManufacturerLockheed MartinCountry of originUnited StatesCost per launch$432 million (USD)SizeHeight50-62 m (164-207 ft)Diameter3.05 m (10 ft)Mass943,050 kg (2,079,060 lb)Stages3-5Capacity Payload to LEOMass21,680 kg(47,790 lb)Payload to Polar LEOMass17,6...

Chú bé rồngLegend of the Dragon's Son龍狼伝(Ryūrōden)Thể loạilịch sử, siêu nhiên, phiêu lưu, shōnen MangaRyūrōdenTác giảYoshito YamaharaNhà xuất bảnKodanshaĐối tượngShōnenTạp chíMonthly Shōnen MagazineĐăng tải1993 – 2007Số tập37 MangaRyūrōden: Chugen RyōranhenTác giảYoshito YamaharaNhà xuất bảnKodanshaĐối tượngShōnenTạp chíMonthly Shōnen MagazineĐăng tải2007 – naySố tập12  Cổng thông tin ...

English painter Harry FennPortrait of Harry Fenn, by L.C. Earle, date unknownBorn(1837-09-14)September 14, 1837Richmond, near LondonDiedApril 21, 1911(1911-04-21) (aged 73)NationalityEnglish-AmericanEducationApprenticeship with Dalziel, LondonKnown forEngraver, etcher, painter, watercolourist and illustratorMovementOrientalist Harry Fenn (September 14, 1837 – April 22, 1911) was an English-born American illustrator, landscape painter, etcher, and wood engraver. From 1870 to around...

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: Late Show Top Ten List – news · newspapers · books · scholar · JSTOR (November 2011) (Learn how and when to remove this template message) The Top Ten List was a regular segment of the television programs Late Night with David Letterman and the Late Show with Da...

13th season of the Premier League Football league seasonFA Premier LeagueSeason2004–05Dates14 August 2004 – 15 May 2005ChampionsChelsea1st Premier League title2nd English titleRelegatedNorwich CityCrystal PalaceSouthamptonChampions LeagueChelsea ArsenalManchester United Everton LiverpoolUEFA CupBolton WanderersMiddlesbroughIntertoto CupNewcastle UnitedMatches played380Goals scored975 (2.57 per match)Top goalscorerThierry Henry (25 goals)Biggest home winArsenal 7–0 Everton(11 May 20...

This article may rely excessively on sources too closely associated with the subject, potentially preventing the article from being verifiable and neutral. Please help improve it by replacing them with more appropriate citations to reliable, independent, third-party sources. (May 2018) (Learn how and when to remove this template message) Basketball teamManchester MagicLeagueNBL D2 NorthEstablished1997; 26 years ago (1997)HistoryManchester Giants B 1997-1998 City of Mancheste...

For other uses, see Quilmes (disambiguation). City in Buenos Aires Province, ArgentinaQuilmesCityQuilmesLocation in Greater Buenos AiresCoordinates: 34°43′00″S 58°16′00″W / 34.71667°S 58.26667°W / -34.71667; -58.26667Country ArgentinaProvinceBuenos Aires ProvincePartidoQuilmesFounded1666Declared city1916Government • MayorMayra Mendoza(Frente de Todos)Elevation[1]17 m (56 ft)Time zoneUTC−3 (ART)CPA BaseB 1878, B 1879A...

Теодорих Рождение XI векРим, Священная Римская империя Смерть 1102Кава-де-Тиррени, Священная Римская империя Теодорих (умер в 1102) — антипапа в 1100 — 1101 годах, противник Пасхалия II. Биография После смерти антипапы Климента III (8 сентября 1100 года) его сторонники тайно встре...