Fundamentals of algorithms (dijkstra's) Flashcards
(3 cards)
1
Q
What do optimisation algorithms do?
A
- Find the best possible solution to a problem
2
Q
Dijkstra’s algorithm: what does it do, examples
A
Dijkstra’s algorithm finds the shortest path from a starting node to every other node
- keeps track of visited nodes with a priortity queue
| - Used in satellite navigation systems to find the shortest route between locations
- Used in routers to send packets via the fastest route through a network
3
Q
Dijkstra’s algorithm: How does it work?
A
- Select start and end nodes
- Make note of distances of nodes from the start position. (Only the nodes connected to start will have a value, all others have a value of infinity)
- Note the start node as fully explored. Choose the node cloest to start node, update the table to reflect shortest distance from A to each node. Mark that node as fully explored
- Repeat step 3, continue until each node has been fully explored (and hence each edge)