As the graph is undirected so there will be an edge between ( i , j ) and ( j , i )
for i in range ( len ( v ) ) : NEW_LINE INDENT adj [ v [ i ] [ 0 ] ] [ v [ i ] [ 1 ] ] = 1 ; NEW_LINE adj [ v [ i ] [ 1 ] ] [ v [ i ] [ 0 ] ] = 1 ; NEW_LINE DEDENT