class_docstr: Generates random internet AS graphs.
class_docstr_tok: ["Generates","random","internet","AS","graphs","."]
docstr: Initializes variables. Immediate numbers are taken from [1].
  
  Parameters
  ----------
  n: integer
      Number of graph nodes
  seed: random state
      Indicator of random number generation state.
      See :ref:`Randomness<randomness>`.
  
  Returns
  -------
  GG: AS_graph_generator object
  
  References
  ----------
  [1] A. Elmokashfi, A. Kvalbein and C. Dovrolis, "On the Scalability of
  BGP: The Role of Topology Growth," in IEEE Journal on Selected Areas
  in Communications, vol. 28, no. 8, pp. 1250-1261, October 2010.
docstr_tok: ["Initializes","variables",".","Immediate","numbers","are","taken","from","[","1","]",".","Parameters","--","--","--","--","--","n",":","integer","Number","of","graph","nodes","seed",":","random","state","Indicator","of","random","number","generation","state",".","See",":","ref",":","`","Randomness","<","randomness",">","`",".","Returns","--","--","--","-","GG",":","AS_graph_generator","object","References","--","--","--","--","--","[","1","]","A.","Elmokashfi",",","A.","Kvalbein","and","C.","Dovrolis",",","``","On","the","Scalability","of","BGP",":","The","Role","of","Topology","Growth",",","''","in","IEEE","Journal","on","Selected","Areas","in","Communications",",","vol",".","28",",","no",".","8",",","pp",".","1250-1261",",","October","2010","."]
code: def __init__(self, n, seed):
      """Initializes variables. Immediate numbers are taken from [1].
  
      Parameters
      ----------
      n: integer
          Number of graph nodes
      seed: random state
          Indicator of random number generation state.
          See :ref:`Randomness<randomness>`.
  
      Returns
      -------
      GG: AS_graph_generator object
  
      References
      ----------
      [1] A. Elmokashfi, A. Kvalbein and C. Dovrolis, "On the Scalability of
      BGP: The Role of Topology Growth," in IEEE Journal on Selected Areas
      in Communications, vol. 28, no. 8, pp. 1250-1261, October 2010.
      """
  
      self.seed = seed
      self.n_t = min(
          n, round(self.seed.random() * 2 + 4)
      )  # num of T nodes
      self.n_m = round(0.15 * n)  # number of M nodes
      self.n_cp = round(0.05 * n)  # number of CP nodes
      self.n_c = max(
          0, n - self.n_t - self.n_m - self.n_cp
      )  # number of C nodes
  
      self.d_m = (
          2 + (2.5 * n) / 10000
      )  # average multihoming degree for M nodes
      self.d_cp = (
          2 + (1.5 * n) / 10000
      )  # avg multihoming degree for CP nodes
      self.d_c = (
          1 + (5 * n) / 100000
      )  # average multihoming degree for C nodes
  
      self.p_m_m = (
          1 + (2 * n) / 10000
      )  # avg num of peer edges between M and M
      self.p_cp_m = (
          0.2 + (2 * n) / 10000
      )  # avg num of peer edges between CP, M
      self.p_cp_cp = (
          0.05 + (2 * n) / 100000
      )  # avg num of peer edges btwn CP, CP
  
      self.t_m = 0.375  # probability M's provider is T
      self.t_cp = 0.375  # probability CP's provider is T
      self.t_c = 0.125
  
file_path: networkx/networkx/generators/internet_as_graphs.py
imports: import networkx
  from networkx.utils import py_random_state
label_desc: Use image node_id 1 to create a new AS_graph_generator object  with example: obj = AS_graph_generator(n, seed)