Check if we can add an edge in the graph
if a in G and b not in G and a != b : NEW_LINE INDENT G [ a ] . append ( b ) NEW_LINE G [ b ] . append ( a ) NEW_LINE count += 1 NEW_LINE DEDENT elif b in G and a not in G and a != b : NEW_LINE INDENT G [ b ] . append ( a ) NEW_LINE G [ a ] . append ( b ) NEW_LINE count += 1 NEW_LINE DEDENT elif a not in G and b not in G and a != b : NEW_LINE INDENT G [ a ] . append ( b ) NEW_LINE G [ b ] . append ( a ) NEW_LINE count += 1 NEW_LINE DEDENT else : NEW_LINE INDENT if not Check_Path ( a , b , G ) and a != b : NEW_LINE INDENT G [ a ] . append ( b ) NEW_LINE G [ b ] . append ( a ) NEW_LINE count += 1 NEW_LINE DEDENT DEDENT