1 / 9

# Algoritmer og Datastrukturer 1 ”Rush Hour ” - PowerPoint PPT Presentation

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

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

## PowerPoint Slideshow about ' Algoritmer og Datastrukturer 1 ”Rush Hour ”' - azriel

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

”Rush Hour”

Gerth Stølting Brodal

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 ?

S = (balanceret) søgetræ

Q = stak eller kø

Bemærk: Hvis Q = kø så findes tilstandene efter stigende afstand fra starttilstanden

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