if any element other than i in the column i is 0 , it means that there is no edge from that vertex to the vertex we are testing and hence it cannot be a sink
if self . adjacency_matrix [ j ] [ i ] == 0 and j != i : NEW_LINE INDENT return False NEW_LINE DEDENT