On the invetiblity of adjacency matrix with self loop $A\in \mathbb{R}^{n\times n}$ is an adjacency matrix. For $i=1,\dots,n$, $A(i,i)=1$. For $i,j=1,\dots,n$ and $i\neq j$, $A(i,j)=A(j,i) \in \{0,1\}$. Each row vector of $A$ is different, is $A$ invertible? The problem is from research.
 A: There is no guarantee that $A$ will be invertible. As a counterexample, consider the adjacency matrix for the path path of length 5, namely
$$
A = \pmatrix{1 & 1 & 0 & 0 & 0\\1 & 1 & 1 & 0 & 0\\0 & 1 & 1 & 1 & 0\\0 & 0 & 1 & 1 & 1\\0 & 0 & 0 & 1 & 1}.
$$
There are no counterexamples of size $n \times n$ for $n<5$.

Here's the script that I used to find a counterexample (before cleaning it up using permutation similarity)
from itertools import chain, combinations
import numpy as np
from numpy.linalg import det
import time

def powerset(iterable, smallest=0, largest=None):
    "powerset([1,2,3]) --> () (1,) (2,) (3,) (1,2) (1,3) (2,3) (1,2,3)"
    s = list(iterable)
    if largest is None:
        largest = len(s)
    else:
        largest = min(len(s),largest)
    return chain.from_iterable(combinations(s, r) for r in range(smallest,largest+1))

for n in range(2,6):
    start = time.time()
    print(f"n = {n}:")
    idx = [(i,j) for i in range(n) for j in range(i)]
    for x in powerset(idx, smallest = n):
        row,col = zip(*x) if x else ([],[])
        A = np.ones((n,n),dtype = int)
        A[row,col] = 0
        A[col,row] = 0
        if len(set(map(tuple,A.tolist()))) == n and round(det(A),10) == 0:
            print("\tcounterexample:")
            for r in A:
                print('\t',*r)
            break
    else:
        print("\tno counterexamples")
    print(f"\t~~Execution time: {time.time()-start:.2e} seconds~~")

The resulting output on my device:
n = 2:
    no counterexamples
    ~~Execution time: 1.15e-03 seconds~~
n = 3:
    no counterexamples
    ~~Execution time: 2.81e-03 seconds~~
n = 4:
    no counterexamples
    ~~Execution time: 9.43e-04 seconds~~
n = 5:
    counterexample:
     1 0 0 0 1
     0 1 0 1 0
     0 0 1 1 1
     0 1 1 1 0
     1 0 1 0 1
    ~~Execution time: 6.42e-03 seconds~~

The example found in this way corresponds to the path $0\to4\to2\to3\to1$.
