code: def get_adjacent_matrix(self):
          
          edges = self.edges
          num_edges = len(edges) + 1
          adj = np.zeros([num_edges, num_edges])
  
          for k in range(num_edges - 1):
              adj[edges[k].L, edges[k].R] = 1
              adj[edges[k].R, edges[k].L] = 1
  
          return adj
docs: Get adjacency matrix.
  
          Returns:
              :param adj: adjacency matrix
              :type adj: np.ndarray