docstr: Test if update_gbest_neighborhood gives the expected return values
code: def test_update_gbest_neighborhood(self, swarm, topology, p, r):
      """Test if update_gbest_neighborhood gives the expected return values"""
      topo = topology()
      pos, cost = topo.compute_gbest(swarm, p=p, r=r)
      expected_pos = np.array(
          [9.90438476e-01, 2.50379538e-03, 1.87405987e-05]
      )
      expected_pos_2 = np.array(
          [9.98033031e-01, 4.97392619e-03, 3.07726256e-03]
      )
      expected_cost = 1.0002528364353296
      assert cost == pytest.approx(expected_cost)
      assert (pos[np.argmin(cost)] == pytest.approx(expected_pos)) or (
          pos[np.argmin(cost)] == pytest.approx(expected_pos_2)
      )
  
file_path: pyswarms/tests/backend/topology/test_von_neumann.py
imports: import numpy
  import pytest
  from pyswarms.backend.topology import VonNeumann
  from .abc_test_topology import ABCTestTopology
label_desc: Use image node_id 3 for calling the TestVonNeumannTopology obj's underlying member method code with example usage: obj.test_update_gbest_neighborhood(swarm, topology, p, r) without return types