class_docstr: This is the basic field structure,
       which contains the weighted graph structure
       plus an array of data (the 'field')
  field is an array of size(n, p)
        where n is the number of vertices of the graph
        and p is the field dimension
class_docstr_tok: ["This","is","the","basic","field","structure",",","which","contains","the","weighted","graph","structure","plus","an","array","of","data","(","the","'field","'",")","field","is","an","array","of","size","(","n",",","p",")","where","n","is","the","number","of","vertices","of","the","graph","and","p","is","the","field","dimension"]
docstr: Computes the neighbor with highest field value along refdim
  
  Parameters
  ----------
  refdim: int, optional,
          the dimension of the field under consideration
  
  Returns
  -------
  hneighb: array of shape(self.V),
           index of the neighbor with highest value
docstr_tok: ["Computes","the","neighbor","with","highest","field","value","along","refdim","Parameters","--","--","--","--","--","refdim",":","int",",","optional",",","the","dimension","of","the","field","under","consideration","Returns","--","--","--","-","hneighb",":","array","of","shape","(","self.V",")",",","index","of","the","neighbor","with","highest","value"]
code: def highest_neighbor(self, refdim=0):
      """Computes the neighbor with highest field value along refdim
  
      Parameters
      ----------
      refdim: int, optional,
              the dimension of the field under consideration
  
      Returns
      -------
      hneighb: array of shape(self.V),
               index of the neighbor with highest value
      """
      from scipy.sparse import dia_matrix
  
      refdim = int(refdim)
      # add self-edges to avoid singularities, when taking the maximum
      adj = self.to_coo_matrix() + dia_matrix(
          (np.ones(self.V), 0), (self.V, self.V)
      )
      rows = adj.tolil().rows
      hneighb = np.array(
          [row[self.field[row].argmax()] for row in rows]
      )
      return hneighb
  
imports: from warnings import warn
  import numpy
  from .graph import Graph, WeightedGraph
label_desc: Use image node_id 7 for calling the Field obj's underlying member method code with example usage: obj.highest_neighbor(refdim) and returns: hneighb