Ticket #6813: worldmap.patch

File worldmap.patch, 2.5 KB (added by ncohen, 13 years ago)
• sage/graphs/graph_generators.py

```# HG changeset patch
# User Nathann Cohen <nathann.cohen@gmail.com>
# Date 1251016915 -7200
# Node ID e35526b63ba257dce464870102dcb962057829d2
# Parent  684eea91ff224e5bc6259ca19f1576c4c082b9d3
Function WorldMap

diff -r 684eea91ff22 -r e35526b63ba2 sage/graphs/graph_generators.py```
 a - DegreeSequenceConfigurationModel - DegreeSequenceTree - DegreeSequenceExpected Oddities : - WorldMap AUTHORS: graphs with a given degree sequence, random directed graphs - Robert Miller (2007-10-24): Isomorph free exhaustive generation - Nathann Cohen (2009-08-12): WorldMap """ ################################################################################ - DegreeSequenceConfigurationModel - DegreeSequenceTree - DegreeSequenceExpected Oddities : - WorldMap ORDERLY GENERATION: graphs(vertices, property=lambda x: True, augment='edges', size=None) import networkx return graph.Graph(networkx.random_shell_graph(constructor, seed)) def WorldMap(self): """ Returns the Graph of all the countries, in which two countries are adjacent in the graph if they have a common boundary. This graph has been built from the data available in The CIA World Factbook [CIAWorldFactbook09]_ (2009-08-21). The returned graph ``G`` has a member ``G.gps_coordinates`` equal to a dictionary containing the GPS coordinates of each country's capital city. EXAMPLE:: sage: g=graphs.WorldMap() sage: g.has_edge("France","Italy") True REFERENCE: .. [CIAWorldFactbook09]_ CIA Factbook 09 https://www.cia.gov/library/publications/the-world-factbook/ """ from sage.structure.sage_object import load from sage.misc.misc import SAGE_DATA return load(SAGE_DATA+"graphs/graph_world.sobj") ################################################################################ #   Graphs with a given degree sequence ################################################################################