The journey is more complicated if some nodes have more than one way out (degree 3 or higher). A decision must be made in each where to exit the node. One decision: choose the exit to the left of where the bug entered. But how does the computer know in an unlabeled graph which exit is to the left so it can direct the bug to it?
In the chapter 4 the computer will use numbers assigned to all the links to be used for the choice of exits from nodes. In this discussion the numerical labels assigned to each node will be used. In the full adjacency list after each (node) is a list of all of its adjacenct neighbors. When the bug is in a node, the computer selects the neighbor with the lowest number and directs the bug to exit along the link that leads to that neighbor.
Three common problems arise and additional parts will be added to this method to solve them:
(a) while trying to visit all nodes the bug may visit some nodes more than once;
(b) by choosing every time a neighbor with the smallest label number the bug may traverse an endless loop;
(c) after moving along a path through nodes, the bug may enter a node with no other way out.
The computer can prevent the bug from entering any node more than once, by remembering what nodes have been visited. It puts a mark by the label number if the node has been visited. In Fig Z2 the nodes already visited are colored yellow. The computer bug moves along through nodes 2 and 3 and enters node 4. Nodes 5 and 7 have been visited. The neighbor with the lowest number label is 8. The bug exits node 4 and goes to 8. Then node 8 will become yellow. The computer will actually put a mark by label 8. This provides a decision in nodes with more than one exit. It is one part of a method for construction of the path. This solves (a) and (b).