docs: def get_diameter(self):
          '''
          API:
              get_diameter(self)
          Description:
              Returns diameter of the graph. Diameter is defined as follows.
              distance(n,m): shortest unweighted path from n to m
              eccentricity(n) = $\max _m distance(n,m)$
              diameter = $\min _n eccentricity(n) = \min _n \max _m distance(n,m)$
          Return:
              Returns diameter of the graph.
          '''
  
          if self.attr['type'] is not UNDIRECTED_GRAPH:
              print('This function only works for undirected graphs')
              return
          diameter = 'infinity'
          eccentricity_n = 0
          for n in self.get_node_list():
              for m in self.get_node_list():
                  path_n_m = self.search(n, destination = m, algo = 'BFS')
                  if path_n_m is None:
                      # this indicates there is no path from n to m, no diameter
                      # is defined, since the graph is not connected, return
                      # 'infinity'
                      return 'infinity'
                  distance_n_m = len(path_n_m)-1
                  if distance_n_m > eccentricity_n:
                      eccentricity_n = distance_n_m
              if diameter is 'infinity' or eccentricity_n > diameter:
                  diameter = eccentricity_n
          return diameter