Drag the dots to the desired position. When you press space, it will try to find the shortest path that touches all the dots. However, it is not a perfect algorithm, it simply goes to the closest dot that has not been reached already.