code: def initialize_graph_structures(graph, node_arc_data, spanning_tree):
      n_nodes = graph.n_nodes
      n_arcs = graph.n_arcs
  
      # unpack arrays
      cost = node_arc_data.cost
      supply = node_arc_data.supply
      flow = node_arc_data.flow
      pi = node_arc_data.pi
      source = node_arc_data.source
      target = node_arc_data.target
  
      parent = spanning_tree.parent
      pred = spanning_tree.pred
      thread = spanning_tree.thread
      rev_thread = spanning_tree.rev_thread
      succ_num = spanning_tree.succ_num
      last_succ = spanning_tree.last_succ
      forward = spanning_tree.forward
      state = spanning_tree.state
  
      if n_nodes == 0:
          return False
  
      # Check the sum of supply values
      net_supply = 0
      for i in range(n_nodes):
          net_supply += supply[i]
  
      if np.fabs(net_supply) > NET_SUPPLY_ERROR_TOLERANCE:
          return False
  
      # Fix using doubles
      # Initialize artifical cost
      artificial_cost = 0.0
      for i in range(n_arcs):
          if cost[i] > artificial_cost:
              artificial_cost = cost[i]
          # reset flow and state vectors
          if flow[i] != 0:
              flow[i] = 0
          state[i] = ArcState.STATE_LOWER
  
      artificial_cost = (artificial_cost + 1) * n_nodes
  
      # Set data for the artificial root node
      root = n_nodes
      parent[root] = -1
      pred[root] = -1
      thread[root] = 0
      rev_thread[0] = root
      succ_num[root] = n_nodes + 1
      last_succ[root] = root - 1
      supply[root] = -net_supply
      pi[root] = 0
  
      # Add artificial arcs and initialize the spanning tree data structure
      # EQ supply constraints
      e = n_arcs
      for u in range(n_nodes):
          parent[u] = root
          pred[u] = e
          thread[u] = u + 1
          rev_thread[u + 1] = u
          succ_num[u] = 1
          last_succ[u] = u
          state[e] = ArcState.STATE_TREE
          if supply[u] >= 0:
              forward[u] = True
              pi[u] = 0
              source[e] = u
              target[e] = root
              flow[e] = supply[u]
              cost[e] = 0
          else:
              forward[u] = False
              pi[u] = artificial_cost
              source[e] = root
              target[e] = u
              flow[e] = -supply[u]
              cost[e] = artificial_cost
          e += 1
  
      return True
  
imports: import numpy
  import numba
  from collections import namedtuple
  from enum import Enum, IntEnum
label_desc: Use image node_id 11 for calling a global function with example usage: initialize_graph_structures(graph, node_arc_data, spanning_tree) and returns: True, False, False