docstr: Updates the global best using a neighborhood approach
  
  The Von Neumann topology inherits from the Ring topology and uses
  the same approach to calculate the global best. The number of
  neighbors is determined by the dimension and the range. This
  topology is always a :code:`static` topology.
  
  Parameters
  ----------
  swarm : pyswarms.backend.swarms.Swarm
      a Swarm instance
  r : int
      range of the Von Neumann topology
  p: int {1,2}
      the Minkowski p-norm to use. 1 is the
      sum-of-absolute values (or L1 distance) while 2 is
      the Euclidean (or L2) distance.
  
  Returns
  -------
  numpy.ndarray
      Best position of shape :code:`(n_dimensions, )`
  float
      Best cost
docstr_tok: ["Updates","the","global","best","using","a","neighborhood","approach","The","Von","Neumann","topology","inherits","from","the","Ring","topology","and","uses","the","same","approach","to","calculate","the","global","best",".","The","number","of","neighbors","is","determined","by","the","dimension","and","the","range",".","This","topology","is","always","a",":","code",":","`","static","`","topology",".","Parameters","--","--","--","--","--","swarm",":","pyswarms.backend.swarms.Swarm","a","Swarm","instance","r",":","int","range","of","the","Von","Neumann","topology","p",":","int","{","1,2","}","the","Minkowski","p-norm","to","use",".","1","is","the","sum-of-absolute","values","(","or","L1","distance",")","while","2","is","the","Euclidean","(","or","L2",")","distance",".","Returns","--","--","--","-","numpy.ndarray","Best","position","of","shape",":","code",":","`","(","n_dimensions",",",")","`","float","Best","cost"]
code: def compute_gbest(self, swarm, p, r, **kwargs):
      """Updates the global best using a neighborhood approach
  
      The Von Neumann topology inherits from the Ring topology and uses
      the same approach to calculate the global best. The number of
      neighbors is determined by the dimension and the range. This
      topology is always a :code:`static` topology.
  
      Parameters
      ----------
      swarm : pyswarms.backend.swarms.Swarm
          a Swarm instance
      r : int
          range of the Von Neumann topology
      p: int {1,2}
          the Minkowski p-norm to use. 1 is the
          sum-of-absolute values (or L1 distance) while 2 is
          the Euclidean (or L2) distance.
  
      Returns
      -------
      numpy.ndarray
          Best position of shape :code:`(n_dimensions, )`
      float
          Best cost
      """
      k = VonNeumann.delannoy(swarm.dimensions, r)
      return super(VonNeumann, self).compute_gbest(swarm, p, k)
  
file_path: pyswarms/pyswarms/backend/topology/von_neumann.py
imports: import logging
  from ...utils.reporter import Reporter
  from .ring import Ring
label_desc: Use image node_id 2 for calling the VonNeumann obj's underlying member method code with example usage: obj.compute_gbest(swarm, p, r) and returns: super