class_docstr: Generates random internet AS graphs.
class_docstr_tok: ["Generates","random","internet","AS","graphs","."]
docstr: Generates a random AS network graph as described in [1].
  
  Returns
  -------
  G: Graph object
  
  Notes
  -----
  The process steps are the following: first we create the core network
  of tier one nodes, then we add the middle tier (M), the content
  provider (CP) and the customer (C) nodes along with their transit edges
  (link i,j means i is customer of j). Finally we add peering links
  between M nodes, between M and CP nodes and between CP node couples.
  For a detailed description of the algorithm, please refer to [1].
  
  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: ["Generates","a","random","AS","network","graph","as","described","in","[","1","]",".","Returns","--","--","--","-","G",":","Graph","object","Notes","--","--","-","The","process","steps","are","the","following",":","first","we","create","the","core","network","of","tier","one","nodes",",","then","we","add","the","middle","tier","(","M",")",",","the","content","provider","(","CP",")","and","the","customer","(","C",")","nodes","along","with","their","transit","edges","(","link","i",",","j","means","i","is","customer","of","j",")",".","Finally","we","add","peering","links","between","M","nodes",",","between","M","and","CP","nodes","and","between","CP","node","couples",".","For","a","detailed","description","of","the","algorithm",",","please","refer","to","[","1","]",".","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 generate(self):
      """Generates a random AS network graph as described in [1].
  
      Returns
      -------
      G: Graph object
  
      Notes
      -----
      The process steps are the following: first we create the core network
      of tier one nodes, then we add the middle tier (M), the content
      provider (CP) and the customer (C) nodes along with their transit edges
      (link i,j means i is customer of j). Finally we add peering links
      between M nodes, between M and CP nodes and between CP node couples.
      For a detailed description of the algorithm, please refer to [1].
  
      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.graph_regions(5)
      self.customers = {}
      self.providers = {}
      self.nodes = {"T": set(), "M": set(), "CP": set(), "C": set()}
  
      self.t_graph()
      self.nodes["T"] = set(self.G.nodes())
  
      i = len(self.nodes["T"])
      for _ in range(self.n_m):
          self.nodes["M"].add(
              self.add_node(i, "M", 0.2, self.d_m, self.t_m)
          )
          i += 1
      for _ in range(self.n_cp):
          self.nodes["CP"].add(
              self.add_node(i, "CP", 0.05, self.d_cp, self.t_cp)
          )
          i += 1
      for _ in range(self.n_c):
          self.nodes["C"].add(
              self.add_node(i, "C", 0, self.d_c, self.t_c)
          )
          i += 1
  
      self.add_peering_links("M", "M")
      self.add_peering_links("CP", "M")
      self.add_peering_links("CP", "CP")
  
      return self.G
  
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 12 for calling the AS_graph_generator obj's underlying member method code with example usage: obj.generate() and returns: self