title: How to find all triplets of nodes (connected components of size 3) from a tsv file?
body: <p>From the matrix given below, i have to make a network and find all connected components of size 3.
  The dataset i use is:</p>
  
  <pre><code>0   1   1   0   0   0   0   0   0   0   0
  1   0   0   0   0   0   0   0   0   0   0
  1   0   0   1   0   0   0   0   0   0   0
  0   0   1   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0   0   1
  0   0   0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0   0   0
  0   0   0   0   0   0   0   0   0   0   0
  0   0   0   0   1   0   0   0   0   0   0
  </code></pre>
  
  <p>Can anybody help?
  And the expected connected connected triplets will be:-</p>
  
  <pre><code>1   2   3
  1   3   4
  2   1   3
  3   1   4
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>import networkx as nx
  from itertools import chain
  import csv
  import numpy as np
  import pandas as pd
  
  adj = []
  infile="2_mutual_info_adjacency.tsv"
  df=pd.read_csv(infile,delimiter="\t",header=None)
  arr=np.array(df.iloc[0:10,:])
  arr1=np.array(df.iloc[:,0:10])
  
  for i in range(arr):
    for j in range(arr1):
      if (i,j)==1:
        for k in range(j+1,arr1):
          if (i,k)==1:
            adj.append(i,j,k)
        for l in range(i+1,arr):
          if(l,j)==1:
            adj.append(i,j,l)
  </code></pre>
  
  <p>A little bit of help will be appreciated. Thank You in advance.</p>