docstr: Betweenness centrality: K4
docstr_tok: ["Betweenness","centrality",":","K4"]
code: def test_K4(self):
      """Betweenness centrality: K4"""
      G = nx.complete_graph(4)
      b = edge_current_flow_subset(
          G, list(G), list(G), normalized=False
      )
      b_answer = edge_current_flow(G, normalized=False)
      for (s, t), v1 in b_answer.items():
          v2 = b.get((s, t), b.get((t, s)))
          assert v1 == pytest.approx(v2, abs=1e-7)
      # test weighted network
      G.add_edge(0, 1, weight=0.5, other=0.3)
      b = edge_current_flow_subset(
          G, list(G), list(G), normalized=False, weight=None
      )
      # weight is None => same as unweighted network
      for (s, t), v1 in b_answer.items():
          v2 = b.get((s, t), b.get((t, s)))
          assert v1 == pytest.approx(v2, abs=1e-7)
  
      b = edge_current_flow_subset(
          G, list(G), list(G), normalized=False
      )
      b_answer = edge_current_flow(G, normalized=False)
      for (s, t), v1 in b_answer.items():
          v2 = b.get((s, t), b.get((t, s)))
          assert v1 == pytest.approx(v2, abs=1e-7)
  
      b = edge_current_flow_subset(
          G, list(G), list(G), normalized=False, weight="other"
      )
      b_answer = edge_current_flow(G, normalized=False, weight="other")
      for (s, t), v1 in b_answer.items():
          v2 = b.get((s, t), b.get((t, s)))
          assert v1 == pytest.approx(v2, abs=1e-7)
  
file_path: networkx/networkx/algorithms/centrality/tests/test_current_flow_betweenness_centrality_subset.py
imports: import pytest
  import networkx
  from networkx import edge_current_flow_betweenness_centrality
  from networkx import edge_current_flow_betweenness_centrality_subset
label_desc: Use image node_id 2 for calling the TestEdgeFlowBetweennessCentrality obj's underlying member method code with example usage: obj.test_K4() without return types