Vous êtes sur la page 1sur 4

Stratford upon Avenue to Aberdeen

1. Using uniform cost search


(file name in the folder: AI_HW1_1)
Using IDA*
In the first iteration the f-cost limit is 550 (but since it was possible that the whole path to the
goal was covered using that 550 f-cost limit, there was only one iteration).
(file name in the folder: AI_HW1_2)

Heuristics table
Station h(n)

Stratford-upon-avon 551
Leamington Spa 541

Hatton 539

Coventry 528

Warwick parkway 540

Birmingham New Street 519

Birmingham Moor Street 519

Birmingham Snow Hill 518

Crewe 451

Wolverhampton 507

Carlisle 256

Preston 378

Glasgow Central 195

Edinburgh 149

Haymarket 150

Shandwick Place 149

Kirkcaldy 132

Dundee 92

Aberdeen 0

Time Complexity of UCS:


C* = optimal path cost = 580
E = min cost of all steps… = 29
O(b^[1+(​C​*/ ​e​)]) = O(3^[1+(580/ ​29​)]) = O(3^[21])

Space Complexity of UCS:


C* = optimal path cost = 580
E = min cost of all steps… = 29
O(b^[1+(​C​*/ ​e​)]) = O(3^[1+(580/ ​29​)]) = O(3^[21])

Time complexity of IDA*:


O(b^d) = O(3^4)

Space Complexity of IDA*:


O(d) = O(4)

Vous aimerez peut-être aussi