Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Document preview thumbnail
Preview 1 out of 7 pages
Summary

Summary Computer Science OCR A Level Last Minute Cram Notes

Document preview thumbnail
Preview 1 out of 7 pages

Inspiration for your revision, plus detailed descriptions of key terms and concepts that come up in the A level

Content preview

A* 1. Set all distances to infinity, except the start node, which is set to 0
2. Add heuristic values to the table
3. Set start node as current node.
4. Add current node to the “open” list
5. Visit neighbours of this node, if distance from start is less than what is
currently in the table, update their distances from start, f distance and previous
node.
a. Note that f distance only includes the single heuristic distance of the single node
you are calculating for, but all the distances from start up to that node.
6. Add any neighbours not yet visited until now, into the open list – a priority
queue
7. Add current node to closed list, remove it from the open list
8. Set the node with the shortest f distance in the Open list as the current node
9. Repeat from step 4 until end node has been added to the closed list.

Node Distance from Heuristic F distance Previous node
start distance (g+h)
A 0 9
B ∞ 4
C ∞ 56 3 59 A
D ∞ 0
Dijkstra 1. Set all distances to infinity, except the start node, which is set to 0
2. Set start node as current node.
3. Add current node to the “open” list
4. Visit neighbours of this node, if distance from start is less than what is
currently in the table, update their distances from start and previous node.
5. Add any neighbours not yet visited until now, into Open – a priority queue
6. Add current node to closed list, remove it from the open list
7. Set the node with the shortest distance in the Open list as the current node
8. Repeat from step 3 until every node has been visited, and so the shortest path has
been found.

Node Distance from start Previous node
A 0
B ∞
C ∞ 56 A
D ∞

Document information

Study Level
Uploaded on
August 29, 2023
File latest updated on
August 29, 2023
Number of pages
7
Written in
2023/2024
Type
Summary
£6.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
3
Followers
1
Items
4
Last sold
6 months ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions