code: def sudoku_graph(n=3):
      """Returns the n-Sudoku graph. The default value of n is 3.
  
      The n-Sudoku graph is a graph with n^4 vertices, corresponding to the
      cells of an n^2 by n^2 grid. Two distinct vertices are adjacent if and
      only if they belong to the same row, column, or n-by-n box.
  
      Parameters
      ----------
      n: integer
         The order of the Sudoku graph, equal to the square root of the
         number of rows. The default is 3.
  
      Returns
      -------
      NetworkX graph
          The n-Sudoku graph Sud(n).
  
      Examples
      --------
      >>> G = nx.sudoku_graph()
      >>> G.number_of_nodes()
      81
      >>> G.number_of_edges()
      810
      >>> sorted(G.neighbors(42))
      [6, 15, 24, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 51, 52, 53, 60, 69, 78]
      >>> G = nx.sudoku_graph(2)
      >>> G.number_of_nodes()
      16
      >>> G.number_of_edges()
      56
  
      References
      ----------
      .. [1] Herzberg, A. M., & Murty, M. R. (2007). Sudoku squares and chromatic
         polynomials. Notices of the AMS, 54(6), 708-717.
      .. [2] Sander, Torsten (2009), "Sudoku graphs are integral",
         Electronic Journal of Combinatorics, 16 (1): Note 25, 7pp, MR 2529816
      .. [3] Wikipedia contributors. "Glossary of Sudoku." Wikipedia, The Free
         Encyclopedia, 3 Dec. 2019. Web. 22 Dec. 2019.
      """
  
      if n < 0:
          raise NetworkXError(
              "The order must be greater than or equal to zero."
          )
  
      n2 = n * n
      n3 = n2 * n
      n4 = n3 * n
  
      # Construct an empty graph with n^4 nodes
      G = nx.empty_graph(n4)
  
      # A Sudoku graph of order 0 or 1 has no edges
      if n < 2:
          return G
  
      # Add edges for cells in the same row
      for row_no in range(n2):
          row_start = row_no * n2
          for j in range(1, n2):
              for i in range(j):
                  G.add_edge(row_start + i, row_start + j)
  
      # Add edges for cells in the same column
      for col_no in range(n2):
          for j in range(col_no, n4, n2):
              for i in range(col_no, j, n2):
                  G.add_edge(i, j)
  
      # Add edges for cells in the same box
      for band_no in range(n):
          for stack_no in range(n):
              box_start = n3 * band_no + n * stack_no
              for j in range(1, n2):
                  for i in range(j):
                      u = box_start + (i % n) + n2 * (i // n)
                      v = box_start + (j % n) + n2 * (j // n)
                      G.add_edge(u, v)
  
      return G
  
label_desc: Use image node_id 1 for calling a global function with example usage: sudoku_graph(n) and returns: G, G