Traverse to all the nodes connected to current vertex and push new path to queue
for i in range ( len ( g [ last ] ) ) : NEW_LINE INDENT if ( isNotVisited ( g [ last ] [ i ] , path ) ) : NEW_LINE INDENT newpath = path . copy ( ) NEW_LINE newpath . append ( g [ last ] [ i ] ) NEW_LINE q . append ( newpath ) NEW_LINE DEDENT DEDENT