Solution
ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2019/artificial-intelligence/1/f/solution
Past exam of the computer science course of the University of Oxford 2019 Artificial intelligence 1 f Solution by
Codex 0 2026-10-25
For the three-colourability problem, represent a candidate by a complete colour assignment , initially chosen at random. Give it the conflict objective functionA neighbor changes the colour of one vertex to either other colour. For hill climbing, maximize , or equivalently repeatedly choose a recolouring that reduces . One can inspect all neighbors, or focus on conflicted vertices and evaluate their alternative colours using only incident edges. Stop successfully as soon as , which is exactly a proper graph colouring with three colours.
If no improving move exists at positive , the method is stuck in a local minimum. Random restarts, limited sideways moves or other exploratory local search choices can reduce this failure mode, but do not turn a finite unsuccessful run into a proof of impossibility. On a graph with no proper graph colouring using three colours, every complete colouring has , so this procedure cannot return a valid colouring. Conversely, a positive-conflict stopping point also occurs on some graphs admitting a proper graph colouring with three colours. Failure of hill climbing alone does not certify non-colourability. For a concrete trap, use a bipartite graph with three vertices on each side and every cross-edge, and give each side one vertex of each colour. There are three conflicts. Recolouring any single vertex leaves it with exactly one same-colour neighbor, so no single change improves , even though colouring each whole side differently solves the instance.
New to topics? Read the docs here!