1 / 8

Hex

Hex. Oplæg til eksamen 28/1-2005. Dagsorden. Introduktion Præsentation af spillet Vores graf Minimax DFS/BFS Disjoint sets. Grafen. Opbygning Pladsforbrug Begrundelse for valg. Minimax. Teorien Evalueringsfunktion Søgetræet Optimering Begrænset søge dybde Tidsfrist

Download Presentation

Hex

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Hex Oplæg til eksamen 28/1-2005

  2. Dagsorden • Introduktion • Præsentation af spillet • Vores graf • Minimax • DFS/BFS • Disjoint sets

  3. Grafen • Opbygning • Pladsforbrug • Begrundelse for valg

  4. Minimax • Teorien • Evalueringsfunktion • Søgetræet • Optimering • 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. foreach 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. 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 Disjoint sets

More Related