- What is a graph in artificial intelligence?
- A graph records relationships between entities. It is made of vertices, also called nodes, and edges. A node can represent a place, a person or a destination, and an edge connects two nodes and can represent a possible path between them. Nodes and edges can be labelled or weighted, such as a distance on a map.
- How does Dijkstra's algorithm find the shortest path?
- Dijkstra's algorithm finds the shortest path from a start node to every other node on a weighted graph. Set the start node to 0 and every other node to infinity. Take the unvisited node with the smallest value, mark it visited, and update any neighbour if the new total is smaller. Repeat until every node is visited, and show the working.
- How is the A* algorithm different from Dijkstra's algorithm?
- Both algorithms find a path between two points on a graph. A* uses a heuristic function, f = g + h, to give priority to nodes that are supposed to be better, and it picks the node with the smallest total f. Dijkstra's algorithm explores all possible routes, so it always finds the shortest path, while A* may not if its heuristics are inaccurate.
- What is an artificial neural network and how is it trained?
- An artificial neural network simulates the functioning of a biological brain and is a key component of machine learning. It is built in layers: input, hidden and output, with weights assigned between nodes. Back propagation of errors compares the outputs with the expected outputs and adjusts the weightings to minimise the difference, repeating until the results are more accurate.
- What is the difference between supervised and unsupervised learning?
- Supervised learning uses labelled input data, with known inputs and their associated outputs, and can predict future outcomes from past data. Unsupervised learning needs only input data. It uses unlabelled data and finds unknown patterns, groupings or clusters without human intervention.
- Why do I lose marks when I give only the final path in Dijkstra's algorithm?
- Some candidates gave the final path without showing a fully complete set of working. Show the start node set to 0 and the rest set to infinity, the values updated and the visited nodes, then the distances.