AQA A Level Graphs traversal algorithms