# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1251016915 7200
# Node ID e84009a8522621af07009435934aa4435428e03e
# Parent 5398e0ca857cda43508e4c1d2f6ff92724b35c32
Trac # 6813 :Function WorldMap
diff r 5398e0ca857c r e84009a85226 sage/graphs/graph_generators.py
a

b


109  109   DegreeSequenceConfigurationModel 
110  110   DegreeSequenceTree 
111  111   DegreeSequenceExpected 
 112  Oddities : 
 113   WorldMap 
112  114  
113  115  
114  116  AUTHORS: 
… 
… 

133  135  
134  136   Robert Miller (20071024): Isomorph free exhaustive generation 
135  137  
 138   Nathann Cohen (20090812): WorldMap 
 139  
136  140   Michael Yurko (2009901): added hyperstar, (n,k)star, nstar, and 
137  141  bubblesort graphs 
138  142  """ 
… 
… 

227  231   DegreeSequenceConfigurationModel 
228  232   DegreeSequenceTree 
229  233   DegreeSequenceExpected 
230   
 234  Oddities : 
 235   WorldMap 
231  236  
232  237  ORDERLY GENERATION: graphs(vertices, property=lambda x: True, 
233  238  augment='edges', size=None) 
… 
… 

3167  3172  import networkx 
3168  3173  return graph.Graph(networkx.random_shell_graph(constructor, seed)) 
3169  3174  
 3175  def WorldMap(self): 
 3176  """ 
 3177  Returns the Graph of all the countries, in which two countries are adjacent 
 3178  in the graph if they have a common boundary. 
 3179  
 3180  This graph has been built from the data available 
 3181  in The CIA World Factbook [1] (20090821). 
 3182  
 3183  The returned graph ``G`` has a member ``G.gps_coordinates`` 
 3184  equal to a dictionary containing the GPS coordinates 
 3185  of each country's capital city. 
 3186  
 3187  EXAMPLE:: 
 3188  
 3189  sage: g=graphs.WorldMap() 
 3190  sage: g.has_edge("France","Italy") 
 3191  True 
 3192  
 3193  REFERENCE: 
 3194  
 3195  .. [1] CIA Factbook 09 https://www.cia.gov/library/publications/theworldfactbook/ 
 3196  """ 
 3197  
 3198  from sage.structure.sage_object import load 
 3199  from sage.misc.misc import SAGE_DATA 
 3200  return load(SAGE_DATA+"graphs/graph_world.sobj") 
 3201  
3170  3202  ################################################################################ 
3171  3203  # Graphs with a given degree sequence 
3172  3204  ################################################################################ 