1 / 9

Algoritmer og Datastrukturer 1 ”Rush Hour ”

Algoritmer og Datastrukturer 1 ”Rush Hour ”. Gerth Stølting Brodal. 14 tilstande. Løsning af RushHour. procedure RushHour(Startopstilling c ) S = { c } Q = { c } while | Q |>0 c = delete( Q ) for alle mulige træk c → c ’ if c ’ ikke er i S then

azriel
Télécharger la présentation

Algoritmer og Datastrukturer 1 ”Rush Hour ”

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. Algoritmer og Datastrukturer 1 ”Rush Hour” Gerth Stølting Brodal

  2. 14 tilstande

  3. Løsning af RushHour procedure RushHour(Startopstilling c) S = { c } Q = { c } while |Q|>0 c = delete(Q) for alle mulige træk c→c’ ifc’ ikke er i Sthen if c’ → rød exit then rapporter fundet en løsning insert(S,c’) insert(Q,c’) Hvilken rækkefølge ?

  4. Datastrukturer S = (balanceret) søgetræ Q = stak eller kø Bemærk: Hvis Q = kø så findes tilstandene efter stigende afstand fra starttilstanden

  5. Eksempler på løsninger

  6. 25 20 15 10 5 0 10000 20000 30000 40000 50000 60000 70000 80000 90000 100000 110000 120000 130000 140000 150000 Kort 33: 100 x Random Walk Stilængde

More Related