| Algorithm 2 Function EdgeSearching(visiting_node) | |
| Input | The current trace visited_trace |
| The current node visiting_node | |
| Total number of target nodes total_length | |
| The length of solution solution_length | |
| Output | The trace of solution solution_trace |
| 1 | ifsolution_length is total_length then |
| 2 | return |
| 3 | endif |
| 4 | if (length of visited_trace) is total_length then |
| 5 | Set solution_length to (length of visited_trace); |
| 6 | returnvisited_trace |
| 7 | endif |
| 8 | Set min_value to 10; |
| 9 | for node in neighbors of visiting_node do |
| 10 | ifnode not visited and node.available < min_value then |
| 11 | Set min_value to node.available; |
| 12 | endif |
| 13 | endfor |
| 14 | for node in neighbors of visiting_node do |
| 15 | ifnode not visited and node.available is min_value then |
| 16 | Visit node and add node to visited_trace; |
| 17 | for neighbor_node in neighbors of node do |
| 18 | neighbor_node.available--; |
| 19 | endfor |
| 20 | EdgeSearching(node); |
| 21 | for neighbor_node in neighbors of node do |
| 22 | neighbor_node.available++; |
| 23 | endfor |
| 24 | Unvisit node and delete node in visited_trace; |
| 25 | end if |
| 26 | end for |