Download præsentationen
Præsentation er lastning. Vent venligst
Offentliggjort afAndrea Møller Redigeret for ca. et år siden
1
Hex Oplæg til eksamen 28/1-2005
2
Dagsorden Introduktion Præsentation af spillet Vores graf MinimaxDFS/BFS Disjoint sets
3
Grafen OpbygningPladsforbrug Begrundelse for valg
4
Minimax TeorienEvalueringsfunktionSøgetræetOptimering –Begrænset søge dybde –Tidsfrist –AlphaBeta-beskæring
5
AlphaBeta
6
DFS/BFS Valg af DFS Vores implementering af DFS Running time DFS BFS egenskaber Disjoint sets
7
DFS pseudokode Check(G) (Svarer til DFS(G)) 1. for each heksagon u in V[G] 2. do algoColor[u] WHITE 3. π[u] NIL 4. for each heksagon u in V[T] 5. do if color[u] = RED 6.then DFSvisitRed(u) DFSvisitRed(u) 1. algoColor[u] GRAY 2. for each v in Adj[u] 3. do if color[v] = RED && algoColor[v] = WHITE 4. then π[v] u 5.do if v in V[B] 6.Break (der er fundet en vinder). 7.do if v not in V[B] 8.DFSvisitRed(v)
8
Disjoint sets Initialisering: 1. for each heksagon u E V[G] 2. do MAKE-SET(u) Ved tryk på felt: 1. do if color[v] = WHITE 2. color[v] RED/BLUE 3.for each u E Adj[v] 4.do if color[v] = color[u] 5.do if FIND-SET(u) ≠ FIND-SET(v) 6.then UNION(u, v) 7.vinderCheck(color[v]) vinderCheck(color) 1. do if color = RED 2. if FIND-SET(a) = FIND-SET(b) 3.then return TRUE 4.else return FALSE 5. else 6.if FIND-SET(c) = FIND-SET(d) 7.then return TRUE 8.else return FALSE
Lignende præsentationer
© 2024 SlidePlayer.dk Inc.
All rights reserved.