class_docstr: Unit tests for the :func:`~networkx.node_boundary` function.
class_docstr_tok: ["Unit","tests","for","the",":","func",":","`","~networkx.node_boundary","`","function","."]
docstr: Check boundaries in the petersen graph
  
  cheeger(G,k)=min(|bdy(S)|/|S| for |S|=k, 0<k<=|V(G)|/2)
docstr_tok: ["Check","boundaries","in","the","petersen","graph","cheeger","(","G",",","k",")","=min","(","|bdy","(","S",")","|\/|S|","for","|S|=k",",","0","<","k","<","=|V","(","G",")","|\/2",")"]
code: def test_petersen(self):
      """Check boundaries in the petersen graph
  
      cheeger(G,k)=min(|bdy(S)|/|S| for |S|=k, 0<k<=|V(G)|/2)
  
      """
  
      def cheeger(G, k):
          return min(
              len(nx.node_boundary(G, nn)) / k
              for nn in combinations(G, k)
          )
  
      P = nx.petersen_graph()
      assert cheeger(P, 1) == pytest.approx(3.00, abs=1e-2)
      assert cheeger(P, 2) == pytest.approx(2.00, abs=1e-2)
      assert cheeger(P, 3) == pytest.approx(1.67, abs=1e-2)
      assert cheeger(P, 4) == pytest.approx(1.00, abs=1e-2)
      assert cheeger(P, 5) == pytest.approx(0.80, abs=1e-2)
  
imports: from itertools import combinations
  import pytest
  import networkx
  from networkx import convert_node_labels_to_integers
  from networkx.utils import edges_equal
label_desc: Use image node_id 4 for calling the TestNodeBoundary obj's underlying member method code with example usage: obj.test_petersen() and returns: min