passagemath-graphs 10.6.1rc1__cp310-cp310-musllinux_1_2_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- passagemath_graphs-10.6.1rc1.dist-info/METADATA +292 -0
- passagemath_graphs-10.6.1rc1.dist-info/RECORD +260 -0
- passagemath_graphs-10.6.1rc1.dist-info/WHEEL +5 -0
- passagemath_graphs-10.6.1rc1.dist-info/top_level.txt +2 -0
- passagemath_graphs.libs/libgcc_s-69c45f16.so.1 +0 -0
- passagemath_graphs.libs/libgmp-8e78bd9b.so.10.5.0 +0 -0
- passagemath_graphs.libs/libstdc++-1f1a71be.so.6.0.33 +0 -0
- sage/all__sagemath_graphs.py +39 -0
- sage/combinat/abstract_tree.py +2723 -0
- sage/combinat/all__sagemath_graphs.py +34 -0
- sage/combinat/binary_tree.py +5306 -0
- sage/combinat/cluster_algebra_quiver/all.py +22 -0
- sage/combinat/cluster_algebra_quiver/cluster_seed.py +5208 -0
- sage/combinat/cluster_algebra_quiver/interact.py +124 -0
- sage/combinat/cluster_algebra_quiver/mutation_class.py +625 -0
- sage/combinat/cluster_algebra_quiver/mutation_type.py +1555 -0
- sage/combinat/cluster_algebra_quiver/quiver.py +2290 -0
- sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py +2468 -0
- sage/combinat/designs/MOLS_handbook_data.py +570 -0
- sage/combinat/designs/all.py +58 -0
- sage/combinat/designs/bibd.py +1655 -0
- sage/combinat/designs/block_design.py +1071 -0
- sage/combinat/designs/covering_array.py +269 -0
- sage/combinat/designs/covering_design.py +530 -0
- sage/combinat/designs/database.py +5615 -0
- sage/combinat/designs/design_catalog.py +122 -0
- sage/combinat/designs/designs_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/designs_pyx.pxd +21 -0
- sage/combinat/designs/designs_pyx.pyx +993 -0
- sage/combinat/designs/difference_family.py +3951 -0
- sage/combinat/designs/difference_matrices.py +279 -0
- sage/combinat/designs/evenly_distributed_sets.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/evenly_distributed_sets.pyx +661 -0
- sage/combinat/designs/ext_rep.py +1064 -0
- sage/combinat/designs/gen_quadrangles_with_spread.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/gen_quadrangles_with_spread.pyx +339 -0
- sage/combinat/designs/group_divisible_designs.py +361 -0
- sage/combinat/designs/incidence_structures.py +2357 -0
- sage/combinat/designs/latin_squares.py +581 -0
- sage/combinat/designs/orthogonal_arrays.py +2244 -0
- sage/combinat/designs/orthogonal_arrays_build_recursive.py +1780 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/orthogonal_arrays_find_recursive.pyx +967 -0
- sage/combinat/designs/resolvable_bibd.py +815 -0
- sage/combinat/designs/steiner_quadruple_systems.py +1306 -0
- sage/combinat/designs/subhypergraph_search.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/designs/subhypergraph_search.pyx +530 -0
- sage/combinat/designs/twographs.py +306 -0
- sage/combinat/finite_state_machine.py +14874 -0
- sage/combinat/finite_state_machine_generators.py +2006 -0
- sage/combinat/graph_path.py +448 -0
- sage/combinat/interval_posets.py +3908 -0
- sage/combinat/nu_tamari_lattice.py +269 -0
- sage/combinat/ordered_tree.py +1446 -0
- sage/combinat/posets/all.py +46 -0
- sage/combinat/posets/bubble_shuffle.py +247 -0
- sage/combinat/posets/cartesian_product.py +493 -0
- sage/combinat/posets/d_complete.py +182 -0
- sage/combinat/posets/elements.py +273 -0
- sage/combinat/posets/forest.py +30 -0
- sage/combinat/posets/hasse_cython.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/posets/hasse_cython.pyx +174 -0
- sage/combinat/posets/hasse_diagram.py +3672 -0
- sage/combinat/posets/hochschild_lattice.py +158 -0
- sage/combinat/posets/incidence_algebras.py +794 -0
- sage/combinat/posets/lattices.py +5117 -0
- sage/combinat/posets/linear_extension_iterator.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/combinat/posets/linear_extension_iterator.pyx +292 -0
- sage/combinat/posets/linear_extensions.py +1037 -0
- sage/combinat/posets/mobile.py +275 -0
- sage/combinat/posets/moebius_algebra.py +776 -0
- sage/combinat/posets/poset_examples.py +2178 -0
- sage/combinat/posets/posets.py +9360 -0
- sage/combinat/rooted_tree.py +1070 -0
- sage/combinat/shard_order.py +239 -0
- sage/combinat/tamari_lattices.py +384 -0
- sage/combinat/yang_baxter_graph.py +923 -0
- sage/databases/all__sagemath_graphs.py +1 -0
- sage/databases/knotinfo_db.py +1231 -0
- sage/ext_data/all__sagemath_graphs.py +1 -0
- sage/ext_data/graphs/graph_plot_js.html +330 -0
- sage/ext_data/kenzo/CP2.txt +45 -0
- sage/ext_data/kenzo/CP3.txt +349 -0
- sage/ext_data/kenzo/CP4.txt +4774 -0
- sage/ext_data/kenzo/README.txt +49 -0
- sage/ext_data/kenzo/S4.txt +20 -0
- sage/graphs/all.py +42 -0
- sage/graphs/asteroidal_triples.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/asteroidal_triples.pyx +320 -0
- sage/graphs/base/all.py +1 -0
- sage/graphs/base/boost_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/boost_graph.pxd +106 -0
- sage/graphs/base/boost_graph.pyx +3045 -0
- sage/graphs/base/c_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/c_graph.pxd +106 -0
- sage/graphs/base/c_graph.pyx +5096 -0
- sage/graphs/base/dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/dense_graph.pxd +28 -0
- sage/graphs/base/dense_graph.pyx +801 -0
- sage/graphs/base/graph_backends.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/graph_backends.pxd +5 -0
- sage/graphs/base/graph_backends.pyx +797 -0
- sage/graphs/base/overview.py +85 -0
- sage/graphs/base/sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/sparse_graph.pxd +90 -0
- sage/graphs/base/sparse_graph.pyx +1653 -0
- sage/graphs/base/static_dense_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_dense_graph.pxd +5 -0
- sage/graphs/base/static_dense_graph.pyx +1032 -0
- sage/graphs/base/static_sparse_backend.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_sparse_backend.pxd +27 -0
- sage/graphs/base/static_sparse_backend.pyx +1583 -0
- sage/graphs/base/static_sparse_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/base/static_sparse_graph.pxd +37 -0
- sage/graphs/base/static_sparse_graph.pyx +1375 -0
- sage/graphs/bipartite_graph.py +2732 -0
- sage/graphs/centrality.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/centrality.pyx +1038 -0
- sage/graphs/cographs.py +519 -0
- sage/graphs/comparability.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/comparability.pyx +851 -0
- sage/graphs/connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/connectivity.pxd +157 -0
- sage/graphs/connectivity.pyx +4813 -0
- sage/graphs/convexity_properties.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/convexity_properties.pxd +16 -0
- sage/graphs/convexity_properties.pyx +870 -0
- sage/graphs/digraph.py +4754 -0
- sage/graphs/digraph_generators.py +1993 -0
- sage/graphs/distances_all_pairs.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/distances_all_pairs.pxd +12 -0
- sage/graphs/distances_all_pairs.pyx +2938 -0
- sage/graphs/domination.py +1363 -0
- sage/graphs/dot2tex_utils.py +100 -0
- sage/graphs/edge_connectivity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/edge_connectivity.pyx +1215 -0
- sage/graphs/generators/all.py +1 -0
- sage/graphs/generators/basic.py +1769 -0
- sage/graphs/generators/chessboard.py +538 -0
- sage/graphs/generators/classical_geometries.py +1611 -0
- sage/graphs/generators/degree_sequence.py +235 -0
- sage/graphs/generators/distance_regular.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/generators/distance_regular.pyx +2846 -0
- sage/graphs/generators/families.py +4759 -0
- sage/graphs/generators/intersection.py +565 -0
- sage/graphs/generators/platonic_solids.py +262 -0
- sage/graphs/generators/random.py +2623 -0
- sage/graphs/generators/smallgraphs.py +5741 -0
- sage/graphs/generators/world_map.py +724 -0
- sage/graphs/generic_graph.py +26867 -0
- sage/graphs/generic_graph_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/generic_graph_pyx.pxd +34 -0
- sage/graphs/generic_graph_pyx.pyx +1673 -0
- sage/graphs/genus.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/genus.pyx +622 -0
- sage/graphs/graph.py +9645 -0
- sage/graphs/graph_coloring.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_coloring.pyx +2284 -0
- sage/graphs/graph_database.py +1177 -0
- sage/graphs/graph_decompositions/all.py +1 -0
- sage/graphs/graph_decompositions/bandwidth.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/bandwidth.pyx +428 -0
- sage/graphs/graph_decompositions/clique_separators.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/clique_separators.pyx +616 -0
- sage/graphs/graph_decompositions/cutwidth.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/cutwidth.pyx +753 -0
- sage/graphs/graph_decompositions/fast_digraph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/fast_digraph.pxd +13 -0
- sage/graphs/graph_decompositions/fast_digraph.pyx +212 -0
- sage/graphs/graph_decompositions/graph_products.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/graph_products.pyx +508 -0
- sage/graphs/graph_decompositions/modular_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/modular_decomposition.pxd +27 -0
- sage/graphs/graph_decompositions/modular_decomposition.pyx +1536 -0
- sage/graphs/graph_decompositions/slice_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/slice_decomposition.pxd +18 -0
- sage/graphs/graph_decompositions/slice_decomposition.pyx +1106 -0
- sage/graphs/graph_decompositions/tree_decomposition.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/tree_decomposition.pxd +17 -0
- sage/graphs/graph_decompositions/tree_decomposition.pyx +1996 -0
- sage/graphs/graph_decompositions/vertex_separation.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_decompositions/vertex_separation.pxd +5 -0
- sage/graphs/graph_decompositions/vertex_separation.pyx +1963 -0
- sage/graphs/graph_editor.py +82 -0
- sage/graphs/graph_generators.py +3314 -0
- sage/graphs/graph_generators_pyx.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/graph_generators_pyx.pyx +95 -0
- sage/graphs/graph_input.py +812 -0
- sage/graphs/graph_latex.py +2064 -0
- sage/graphs/graph_list.py +410 -0
- sage/graphs/graph_plot.py +1756 -0
- sage/graphs/graph_plot_js.py +338 -0
- sage/graphs/hyperbolicity.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/hyperbolicity.pyx +1704 -0
- sage/graphs/hypergraph_generators.py +364 -0
- sage/graphs/independent_sets.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/independent_sets.pxd +13 -0
- sage/graphs/independent_sets.pyx +402 -0
- sage/graphs/isgci.py +1033 -0
- sage/graphs/isoperimetric_inequalities.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/isoperimetric_inequalities.pyx +489 -0
- sage/graphs/line_graph.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/line_graph.pyx +743 -0
- sage/graphs/lovasz_theta.py +77 -0
- sage/graphs/matching.py +1633 -0
- sage/graphs/matching_covered_graph.py +3590 -0
- sage/graphs/orientations.py +1489 -0
- sage/graphs/partial_cube.py +459 -0
- sage/graphs/path_enumeration.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/path_enumeration.pyx +2040 -0
- sage/graphs/pq_trees.py +1129 -0
- sage/graphs/print_graphs.py +201 -0
- sage/graphs/schnyder.py +865 -0
- sage/graphs/spanning_tree.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/spanning_tree.pyx +1457 -0
- sage/graphs/strongly_regular_db.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/strongly_regular_db.pyx +3340 -0
- sage/graphs/traversals.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/traversals.pxd +9 -0
- sage/graphs/traversals.pyx +1872 -0
- sage/graphs/trees.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/trees.pxd +15 -0
- sage/graphs/trees.pyx +310 -0
- sage/graphs/tutte_polynomial.py +713 -0
- sage/graphs/views.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/views.pyx +794 -0
- sage/graphs/weakly_chordal.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/graphs/weakly_chordal.pyx +604 -0
- sage/groups/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/partn_ref/all__sagemath_graphs.py +1 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.cpython-310-aarch64-linux-gnu.so +0 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.pxd +38 -0
- sage/groups/perm_gps/partn_ref/refinement_graphs.pyx +1666 -0
- sage/knots/all.py +6 -0
- sage/knots/free_knotinfo_monoid.py +507 -0
- sage/knots/gauss_code.py +291 -0
- sage/knots/knot.py +682 -0
- sage/knots/knot_table.py +284 -0
- sage/knots/knotinfo.py +2900 -0
- sage/knots/link.py +4715 -0
- sage/sandpiles/all.py +13 -0
- sage/sandpiles/examples.py +225 -0
- sage/sandpiles/sandpile.py +6365 -0
- sage/topology/all.py +22 -0
- sage/topology/cell_complex.py +1214 -0
- sage/topology/cubical_complex.py +1976 -0
- sage/topology/delta_complex.py +1806 -0
- sage/topology/filtered_simplicial_complex.py +744 -0
- sage/topology/moment_angle_complex.py +823 -0
- sage/topology/simplicial_complex.py +5160 -0
- sage/topology/simplicial_complex_catalog.py +92 -0
- sage/topology/simplicial_complex_examples.py +1680 -0
- sage/topology/simplicial_complex_homset.py +205 -0
- sage/topology/simplicial_complex_morphism.py +836 -0
- sage/topology/simplicial_set.py +4102 -0
- sage/topology/simplicial_set_catalog.py +55 -0
- sage/topology/simplicial_set_constructions.py +2954 -0
- sage/topology/simplicial_set_examples.py +865 -0
- sage/topology/simplicial_set_morphism.py +1464 -0
@@ -0,0 +1,724 @@
|
|
1
|
+
# sage_setup: distribution = sagemath-graphs
|
2
|
+
r"""
|
3
|
+
Graphs from the World Map
|
4
|
+
|
5
|
+
The methods defined here appear in :mod:`sage.graphs.graph_generators`.
|
6
|
+
"""
|
7
|
+
|
8
|
+
# ****************************************************************************
|
9
|
+
# Copyright (C) 2006 Robert L. Miller <rlmillster@gmail.com>
|
10
|
+
# and Emily A. Kirkman
|
11
|
+
# Copyright (C) 2009 Michael C. Yurko <myurko@gmail.com>
|
12
|
+
#
|
13
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
14
|
+
# http://www.gnu.org/licenses/
|
15
|
+
# ****************************************************************************
|
16
|
+
|
17
|
+
# import from Sage library
|
18
|
+
from sage.graphs.graph import Graph
|
19
|
+
|
20
|
+
|
21
|
+
def AfricaMap(continental=False, year=2018):
|
22
|
+
"""
|
23
|
+
Return African states as a graph of common border.
|
24
|
+
|
25
|
+
"African state" here is defined as an independent state having the capital
|
26
|
+
city in Africa. The graph has an edge between those countries that have
|
27
|
+
common *land* border.
|
28
|
+
|
29
|
+
INPUT:
|
30
|
+
|
31
|
+
- ``continental`` -- boolean (default: ``False``); whether to only return
|
32
|
+
states in the continental Africa or all African states
|
33
|
+
|
34
|
+
- ``year`` -- integer (default: 2018); reserved for future use
|
35
|
+
|
36
|
+
EXAMPLES::
|
37
|
+
|
38
|
+
sage: Africa = graphs.AfricaMap(); Africa
|
39
|
+
Africa Map: Graph on 54 vertices
|
40
|
+
sage: sorted(Africa.neighbors('Libya'))
|
41
|
+
['Algeria', 'Chad', 'Egypt', 'Niger', 'Sudan', 'Tunisia']
|
42
|
+
|
43
|
+
sage: cont_Africa = graphs.AfricaMap(continental=True)
|
44
|
+
sage: cont_Africa.order()
|
45
|
+
48
|
46
|
+
sage: 'Madagaskar' in cont_Africa
|
47
|
+
False
|
48
|
+
|
49
|
+
TESTS::
|
50
|
+
|
51
|
+
sage: Africa.plot() # long time # needs sage.plot
|
52
|
+
Graphics object consisting of 159 graphics primitives
|
53
|
+
"""
|
54
|
+
if year != 2018:
|
55
|
+
raise ValueError("currently only year 2018 is implemented")
|
56
|
+
|
57
|
+
common_border = {
|
58
|
+
'Algeria': ['Libya', 'Mali', 'Mauritania', 'Morocco', 'Niger', 'Tunisia'],
|
59
|
+
'Angola': ['Namibia', 'Zambia'],
|
60
|
+
'Benin': ['Burkina Faso', 'Niger', 'Nigeria', 'Togo'],
|
61
|
+
'Botswana': ['Namibia', 'South Africa', 'Zimbabwe'],
|
62
|
+
'Burkina Faso': ['Ghana', 'Ivory Coast', 'Mali', 'Niger', 'Togo'],
|
63
|
+
'Cameroon': ['Central Africa', 'Chad', 'Equatorial Guinea', 'Gabon',
|
64
|
+
'Nigeria'],
|
65
|
+
'Central Africa': ['Chad', 'South Sudan', 'Sudan'],
|
66
|
+
'Chad': ['Libya', 'Niger', 'Nigeria', 'Sudan'],
|
67
|
+
'Republic of the Congo': ['Gabon', 'Cameroon', 'Central Africa', 'Angola',
|
68
|
+
'Democratic Republic of the Congo'],
|
69
|
+
'Democratic Republic of the Congo': ['Zambia', 'South Sudan', 'Tanzania',
|
70
|
+
'Burundi', 'Rwanda', 'Uganda',
|
71
|
+
'Central Africa', 'Angola'],
|
72
|
+
'Djibouti': ['Eritrea', 'Ethiopia', 'Somalia'],
|
73
|
+
'Ethiopia': ['Eritrea', 'Kenya', 'Somalia', 'South Sudan', 'Sudan'],
|
74
|
+
'Gabon': ['Equatorial Guinea'],
|
75
|
+
'Ghana': ['Ivory Coast', 'Togo'],
|
76
|
+
'Guinea': ['Guinea-Bissau', 'Ivory Coast', 'Liberia', 'Sierra Leone'],
|
77
|
+
'Kenya': ['Somalia', 'South Sudan', 'Tanzania', 'Uganda'],
|
78
|
+
'Liberia': ['Ivory Coast', 'Sierra Leone'],
|
79
|
+
'Libya': ['Egypt', 'Niger', 'Sudan', 'Tunisia'],
|
80
|
+
'Mali': ['Guinea', 'Ivory Coast', 'Mauritania', 'Niger', 'Senegal'],
|
81
|
+
'Mozambique': ['Malawi', 'South Africa', 'Swaziland', 'Zimbabwe'],
|
82
|
+
'Niger': ['Nigeria'],
|
83
|
+
'Rwanda': ['Burundi', 'Tanzania', 'Uganda'],
|
84
|
+
'Senegal': ['Guinea', 'Guinea-Bissau', 'Mauritania', 'Gambia'],
|
85
|
+
'South Africa': ['Lesotho', 'Namibia', 'Swaziland', 'Zimbabwe'],
|
86
|
+
'South Sudan': ['Uganda', 'Sudan', 'Democratic Republic of the Congo'],
|
87
|
+
'Sudan': ['Egypt', 'Eritrea'],
|
88
|
+
'Tanzania': ['Burundi', 'Malawi', 'Mozambique', 'Uganda', 'Zambia'],
|
89
|
+
'Zambia': ['Malawi', 'Mozambique', 'Namibia', 'Zimbabwe']
|
90
|
+
}
|
91
|
+
|
92
|
+
no_land_border = ['Cape Verde', 'Seychelles', 'Mauritius',
|
93
|
+
'São Tomé and Príncipe', 'Madagascar', 'Comoros']
|
94
|
+
|
95
|
+
G = Graph(common_border, format='dict_of_lists')
|
96
|
+
|
97
|
+
if continental:
|
98
|
+
G = G.subgraph(G.connected_component_containing_vertex('Central Africa', sort=False))
|
99
|
+
G.name(new="Continental Africa Map")
|
100
|
+
else:
|
101
|
+
G.add_vertices(no_land_border)
|
102
|
+
G.name(new="Africa Map")
|
103
|
+
|
104
|
+
return G
|
105
|
+
|
106
|
+
|
107
|
+
def EuropeMap(continental=False, year=2018):
|
108
|
+
"""
|
109
|
+
Return European states as a graph of common border.
|
110
|
+
|
111
|
+
"European state" here is defined as an independent state having the capital
|
112
|
+
city in Europe. The graph has an edge between those countries that have
|
113
|
+
common *land* border.
|
114
|
+
|
115
|
+
INPUT:
|
116
|
+
|
117
|
+
- ``continental`` -- boolean (default: ``False``); whether to only return
|
118
|
+
states in the continental Europe or all European states
|
119
|
+
|
120
|
+
- ``year`` -- integer (default: 2018); reserved for future use
|
121
|
+
|
122
|
+
EXAMPLES::
|
123
|
+
|
124
|
+
sage: Europe = graphs.EuropeMap(); Europe
|
125
|
+
Europe Map: Graph on 44 vertices
|
126
|
+
sage: Europe.neighbors('Ireland')
|
127
|
+
['United Kingdom']
|
128
|
+
|
129
|
+
sage: cont_Europe = graphs.EuropeMap(continental=True)
|
130
|
+
sage: cont_Europe.order()
|
131
|
+
40
|
132
|
+
sage: 'Iceland' in cont_Europe
|
133
|
+
False
|
134
|
+
"""
|
135
|
+
if year != 2018:
|
136
|
+
raise ValueError("currently only year 2018 is implemented")
|
137
|
+
|
138
|
+
common_border = {
|
139
|
+
'Austria': ['Czech Republic', 'Germany', 'Liechtenstein', 'Slovenia',
|
140
|
+
'Switzerland'],
|
141
|
+
'Belarus': ['Latvia', 'Lithuania', 'Poland', 'Russia', 'Ukraine'],
|
142
|
+
'Belgium': ['France', 'Germany', 'Luxembourg', 'Netherlands'],
|
143
|
+
'Croatia': ['Bosnia and Herzegovina', 'Hungary', 'Montenegro', 'Serbia',
|
144
|
+
'Slovenia'],
|
145
|
+
'France': ['Andorra', 'Germany', 'Italy', 'Luxembourg', 'Monaco',
|
146
|
+
'Switzerland'],
|
147
|
+
'Germany': ['Czech Republic', 'Denmark', 'Luxembourg', 'Netherlands',
|
148
|
+
'Switzerland'],
|
149
|
+
'Greece': ['Albania', 'Bulgaria', 'Macedonia'],
|
150
|
+
'Hungary': ['Austria', 'Romania', 'Serbia', 'Slovakia', 'Slovenia',
|
151
|
+
'Ukraine'],
|
152
|
+
'Ireland': ['United Kingdom'],
|
153
|
+
'Italy': ['Austria', 'San Marino', 'Slovenia', 'Switzerland',
|
154
|
+
'Vatican City'],
|
155
|
+
'Latvia': ['Estonia', 'Lithuania', 'Russia'],
|
156
|
+
'Macedonia': ['Albania', 'Bulgaria', 'Serbia'],
|
157
|
+
'Montenegro': ['Albania', 'Bosnia and Herzegovina', 'Serbia'],
|
158
|
+
'Norway': ['Finland', 'Russia', 'Sweden'],
|
159
|
+
'Poland': ['Czech Republic', 'Germany', 'Lithuania', 'Russia', 'Slovakia',
|
160
|
+
'Ukraine'],
|
161
|
+
'Romania': ['Bulgaria', 'Moldova', 'Serbia', 'Ukraine'],
|
162
|
+
'Russia': ['Estonia', 'Finland', 'Lithuania', 'Ukraine'],
|
163
|
+
'Serbia': ['Bosnia and Herzegovina', 'Bulgaria'],
|
164
|
+
'Slovakia': ['Austria', 'Czech Republic', 'Ukraine'],
|
165
|
+
'Spain': ['Andorra', 'France', 'Portugal'],
|
166
|
+
'Sweden': ['Finland'],
|
167
|
+
'Switzerland': ['Liechtenstein'],
|
168
|
+
'Ukraine': ['Moldova']
|
169
|
+
}
|
170
|
+
no_land_border = ['Iceland', 'Malta']
|
171
|
+
|
172
|
+
G = Graph(common_border, format='dict_of_lists')
|
173
|
+
|
174
|
+
if continental:
|
175
|
+
G = G.subgraph(G.connected_component_containing_vertex('Austria', sort=False))
|
176
|
+
G.name(new="Continental Europe Map")
|
177
|
+
else:
|
178
|
+
G.add_vertices(no_land_border)
|
179
|
+
G.name(new="Europe Map")
|
180
|
+
|
181
|
+
return G
|
182
|
+
|
183
|
+
|
184
|
+
def USAMap(continental=False):
|
185
|
+
"""
|
186
|
+
Return states of USA as a graph of common border.
|
187
|
+
|
188
|
+
The graph has an edge between those states that have common *land* border
|
189
|
+
line or point. Hence for example Colorado and Arizona are marked as
|
190
|
+
neighbors, but Michigan and Minnesota are not.
|
191
|
+
|
192
|
+
INPUT:
|
193
|
+
|
194
|
+
- ``continental`` -- boolean (default: ``False``); whether to exclude Alaska
|
195
|
+
and Hawaii
|
196
|
+
|
197
|
+
EXAMPLES:
|
198
|
+
|
199
|
+
How many states are neighbor's neighbor for Pennsylvania::
|
200
|
+
|
201
|
+
sage: USA = graphs.USAMap()
|
202
|
+
sage: distance = USA.shortest_path_lengths('Pennsylvania')
|
203
|
+
sage: len([n2 for n2, d in distance.items() if d == 2])
|
204
|
+
7
|
205
|
+
|
206
|
+
Diameter for continental USA::
|
207
|
+
|
208
|
+
sage: USAcont = graphs.USAMap(continental=True)
|
209
|
+
sage: USAcont.diameter()
|
210
|
+
11
|
211
|
+
"""
|
212
|
+
states = {
|
213
|
+
"Alabama": ["Florida", "Georgia", "Mississippi", "Tennessee"],
|
214
|
+
"Arizona": ["California", "Colorado", "Nevada", "New Mexico", "Utah"],
|
215
|
+
"Arkansas": ["Louisiana", "Mississippi", "Missouri", "Oklahoma",
|
216
|
+
"Tennessee", "Texas"],
|
217
|
+
"California": ["Arizona", "Nevada", "Oregon"],
|
218
|
+
"Colorado": ["Arizona", "Kansas", "Nebraska", "New Mexico", "Oklahoma",
|
219
|
+
"Utah", "Wyoming"],
|
220
|
+
"Connecticut": ["Massachusetts", "New York", "Rhode Island"],
|
221
|
+
"Delaware": ["Maryland", "New Jersey", "Pennsylvania"],
|
222
|
+
"Florida": ["Alabama", "Georgia"],
|
223
|
+
"Georgia": ["Alabama", "Florida", "North Carolina", "South Carolina",
|
224
|
+
"Tennessee"],
|
225
|
+
"Idaho": ["Montana", "Nevada", "Oregon", "Utah", "Washington",
|
226
|
+
"Wyoming"],
|
227
|
+
"Illinois": ["Indiana", "Iowa", "Michigan", "Kentucky", "Missouri",
|
228
|
+
"Wisconsin"],
|
229
|
+
"Indiana": ["Illinois", "Kentucky", "Michigan", "Ohio"],
|
230
|
+
"Iowa": ["Illinois", "Minnesota", "Missouri", "Nebraska",
|
231
|
+
"South Dakota", "Wisconsin"],
|
232
|
+
"Kansas": ["Colorado", "Missouri", "Nebraska", "Oklahoma"],
|
233
|
+
"Kentucky": ["Illinois", "Indiana", "Missouri", "Ohio", "Tennessee",
|
234
|
+
"Virginia", "West Virginia"],
|
235
|
+
"Louisiana": ["Arkansas", "Mississippi", "Texas"],
|
236
|
+
"Maine": ["New Hampshire"],
|
237
|
+
"Maryland": ["Delaware", "Pennsylvania", "Virginia", "West Virginia"],
|
238
|
+
"Massachusetts": ["Connecticut", "New Hampshire", "New York",
|
239
|
+
"Rhode Island", "Vermont"],
|
240
|
+
"Michigan": ["Illinois", "Indiana", "Ohio", "Wisconsin"],
|
241
|
+
"Minnesota": ["Iowa", "North Dakota", "South Dakota", "Wisconsin"],
|
242
|
+
"Mississippi": ["Alabama", "Arkansas", "Louisiana", "Tennessee"],
|
243
|
+
"Missouri": ["Arkansas", "Illinois", "Iowa", "Kansas", "Kentucky",
|
244
|
+
"Nebraska", "Oklahoma", "Tennessee"],
|
245
|
+
"Montana": ["Idaho", "North Dakota", "South Dakota", "Wyoming"],
|
246
|
+
"Nebraska": ["Colorado", "Iowa", "Kansas", "Missouri", "South Dakota",
|
247
|
+
"Wyoming"],
|
248
|
+
"Nevada": ["Arizona", "California", "Idaho", "Oregon", "Utah"],
|
249
|
+
"New Hampshire": ["Maine", "Massachusetts", "Vermont"],
|
250
|
+
"New Jersey": ["Delaware", "New York", "Pennsylvania"],
|
251
|
+
"New Mexico": ["Arizona", "Colorado", "Oklahoma", "Texas", "Utah"],
|
252
|
+
"New York": ["Connecticut", "Massachusetts", "New Jersey",
|
253
|
+
"Pennsylvania", "Vermont"],
|
254
|
+
"North Carolina": ["Georgia", "South Carolina", "Tennessee",
|
255
|
+
"Virginia"],
|
256
|
+
"North Dakota": ["Minnesota", "Montana", "South Dakota"],
|
257
|
+
"Ohio": ["Indiana", "Kentucky", "Michigan", "Pennsylvania",
|
258
|
+
"West Virginia"],
|
259
|
+
"Oklahoma": ["Arkansas", "Colorado", "Kansas", "Missouri",
|
260
|
+
"New Mexico", "Texas"],
|
261
|
+
"Oregon": ["California", "Idaho", "Nevada", "Washington"],
|
262
|
+
"Pennsylvania": ["Delaware", "Maryland", "New Jersey", "New York",
|
263
|
+
"Ohio", "West Virginia"],
|
264
|
+
"Rhode Island": ["Connecticut", "Massachusetts"],
|
265
|
+
"South Carolina": ["Georgia", "North Carolina"],
|
266
|
+
"South Dakota": ["Iowa", "Minnesota", "Montana", "Nebraska",
|
267
|
+
"North Dakota", "Wyoming"],
|
268
|
+
"Tennessee": ["Alabama", "Arkansas", "Georgia", "Kentucky",
|
269
|
+
"Mississippi", "Missouri", "North Carolina", "Virginia"],
|
270
|
+
"Texas": ["Arkansas", "Louisiana", "New Mexico", "Oklahoma"],
|
271
|
+
"Utah": ["Arizona", "Colorado", "Idaho", "Nevada", "New Mexico",
|
272
|
+
"Wyoming"],
|
273
|
+
"Vermont": ["Massachusetts", "New Hampshire", "New York"],
|
274
|
+
"Virginia": ["Kentucky", "Maryland", "North Carolina", "Tennessee",
|
275
|
+
"West Virginia"],
|
276
|
+
"Washington": ["Idaho", "Oregon"],
|
277
|
+
"West Virginia": ["Kentucky", "Maryland", "Ohio", "Pennsylvania",
|
278
|
+
"Virginia"],
|
279
|
+
"Wisconsin": ["Illinois", "Iowa", "Michigan", "Minnesota"],
|
280
|
+
"Wyoming": ["Colorado", "Idaho", "Montana", "Nebraska", "South Dakota",
|
281
|
+
"Utah"]
|
282
|
+
}
|
283
|
+
if continental:
|
284
|
+
name = "Continental USA Map"
|
285
|
+
else:
|
286
|
+
states['Alaska'] = []
|
287
|
+
states['Hawaii'] = []
|
288
|
+
name = "USA Map"
|
289
|
+
|
290
|
+
return Graph(states, format='dict_of_lists', name=name)
|
291
|
+
|
292
|
+
|
293
|
+
def WorldMap():
|
294
|
+
"""
|
295
|
+
Return the Graph of all the countries, in which two countries are adjacent
|
296
|
+
in the graph if they have a common boundary.
|
297
|
+
|
298
|
+
This graph has been built from the data available
|
299
|
+
in The CIA World Factbook [CIA]_ (2009-08-21).
|
300
|
+
|
301
|
+
The returned graph ``G`` has a member ``G.gps_coordinates`` equal to a
|
302
|
+
dictionary containing the GPS coordinates of each country's capital city.
|
303
|
+
|
304
|
+
EXAMPLES::
|
305
|
+
|
306
|
+
sage: g = graphs.WorldMap()
|
307
|
+
sage: g.has_edge("France", "Italy")
|
308
|
+
True
|
309
|
+
sage: g.gps_coordinates["Bolivia"]
|
310
|
+
[[17, 'S'], [65, 'W']]
|
311
|
+
sage: g.connected_component_containing_vertex('Ireland', sort=True)
|
312
|
+
['Ireland', 'United Kingdom']
|
313
|
+
|
314
|
+
TESTS:
|
315
|
+
|
316
|
+
:issue:`24488`::
|
317
|
+
|
318
|
+
sage: 'Iceland' in graphs.WorldMap()
|
319
|
+
True
|
320
|
+
"""
|
321
|
+
edges = [
|
322
|
+
('Afghanistan', 'China'), ('Afghanistan', 'Iran'),
|
323
|
+
('Afghanistan', 'Uzbekistan'), ('Albania', 'Greece'),
|
324
|
+
('Albania', 'Kosovo'), ('Albania', 'Macedonia'),
|
325
|
+
('Albania', 'Montenegro'), ('Algeria', 'Morocco'),
|
326
|
+
('Algeria', 'Tunisia'), ('Andorra', 'Spain'),
|
327
|
+
('Angola', 'Democratic Republic of the Congo'), ('Angola', 'Namibia'),
|
328
|
+
('Angola', 'Zambia'), ('Argentina', 'Bolivia'), ('Argentina', 'Brazil'),
|
329
|
+
('Argentina', 'Chile'), ('Argentina', 'Paraguay'),
|
330
|
+
('Argentina', 'Uruguay'), ('Armenia', 'Georgia'), ('Armenia', 'Iran'),
|
331
|
+
('Austria', 'Germany'), ('Azerbaijan', 'Armenia'),
|
332
|
+
('Azerbaijan', 'Georgia'), ('Azerbaijan', 'Iran'),
|
333
|
+
('Azerbaijan', 'Russia'), ('Azerbaijan', 'Turkey'),
|
334
|
+
('Bangladesh', 'Burma'), ('Belgium', 'Germany'),
|
335
|
+
('Belgium', 'Netherlands'), ('Belize', 'Mexico'),
|
336
|
+
('Benin', 'Burkina Faso'), ('Benin', 'Niger'), ('Benin', 'Nigeria'),
|
337
|
+
('Benin', 'Togo'), ('Bolivia', 'Brazil'), ('Bolivia', 'Chile'),
|
338
|
+
('Bolivia', 'Paraguay'), ('Bolivia', 'Peru'),
|
339
|
+
('Bosnia and Herzegovina', 'Croatia'),
|
340
|
+
('Bosnia and Herzegovina', 'Montenegro'),
|
341
|
+
('Bosnia and Herzegovina', 'Serbia'), ('Brazil', 'Colombia'),
|
342
|
+
('Brazil', 'Guyana'), ('Brazil', 'Suriname'), ('Brazil', 'Venezuela'),
|
343
|
+
('Bulgaria', 'Greece'), ('Bulgaria', 'Macedonia'),
|
344
|
+
('Bulgaria', 'Romania'), ('Bulgaria', 'Serbia'),
|
345
|
+
('Burkina Faso', 'Mali'), ('Burkina Faso', 'Niger'),
|
346
|
+
('Burkina Faso', 'Togo'),
|
347
|
+
('Burundi', 'Democratic Republic of the Congo'), ('Cambodia', 'Laos'),
|
348
|
+
('Cambodia', 'Thailand'), ('Cambodia', 'Vietnam'),
|
349
|
+
('Cameroon', 'Central African Republic'), ('Cameroon', 'Chad'),
|
350
|
+
('Cameroon', 'Equatorial Guinea'), ('Cameroon', 'Nigeria'),
|
351
|
+
('Cameroon', 'Republic of the Congo'), ('Canada', 'United States'),
|
352
|
+
('Central African Republic', 'Chad'),
|
353
|
+
('Central African Republic', 'Democratic Republic of the Congo'),
|
354
|
+
('Central African Republic', 'Sudan'), ('Chad', 'Niger'),
|
355
|
+
('Chad', 'Nigeria'), ('Chad', 'Sudan'), ('China', 'Bhutan'),
|
356
|
+
('China', 'Burma'), ('China', 'Hong Kong'), ('China', 'Kazakhstan'),
|
357
|
+
('China', 'Kyrgyzstan'), ('China', 'Mongolia'), ('China', 'Nepal'),
|
358
|
+
('China', 'North Korea'), ('China', 'Russia'), ('China', 'Vietnam'),
|
359
|
+
('Colombia', 'Venezuela'), ('Costa Rica', 'Nicaragua'),
|
360
|
+
("Cote d'Ivoire", 'Burkina Faso'), ("Cote d'Ivoire", 'Guinea'),
|
361
|
+
("Cote d'Ivoire", 'Mali'), ('Cyprus', 'Akrotiri'),
|
362
|
+
('Cyprus', 'Dhekelia'), ('Czech Republic', 'Austria'),
|
363
|
+
('Czech Republic', 'Germany'), ('Czech Republic', 'Poland'),
|
364
|
+
('Democratic Republic of the Congo', 'Zambia'), ('Denmark', 'Germany'),
|
365
|
+
('Djibouti', 'Eritrea'), ('Dominican Republic', 'Haiti'),
|
366
|
+
('Ecuador', 'Colombia'), ('El Salvador', 'Honduras'),
|
367
|
+
('Ethiopia', 'Djibouti'), ('Ethiopia', 'Eritrea'),
|
368
|
+
('Ethiopia', 'Kenya'), ('Ethiopia', 'Somalia'), ('Ethiopia', 'Sudan'),
|
369
|
+
('Finland', 'Russia'), ('Finland', 'Sweden'), ('France', 'Andorra'),
|
370
|
+
('France', 'Belgium'), ('France', 'Brazil'), ('France', 'Germany'),
|
371
|
+
('France', 'Italy'), ('France', 'Luxembourg'), ('France', 'Spain'),
|
372
|
+
('France', 'Suriname'), ('France', 'Switzerland'),
|
373
|
+
('Gabon', 'Cameroon'), ('Gabon', 'Equatorial Guinea'),
|
374
|
+
('Gabon', 'Republic of the Congo'), ('Gaza Strip', 'Egypt'),
|
375
|
+
('Gaza Strip', 'Israel'), ('Ghana', 'Burkina Faso'),
|
376
|
+
('Ghana', "Cote d'Ivoire"), ('Ghana', 'Togo'), ('Gibraltar', 'Spain'),
|
377
|
+
('Guatemala', 'Belize'), ('Guatemala', 'El Salvador'),
|
378
|
+
('Guatemala', 'Honduras'), ('Guatemala', 'Mexico'),
|
379
|
+
('Guinea', 'Sierra Leone'), ('Guinea-Bissau', 'Guinea'),
|
380
|
+
('Guinea-Bissau', 'Senegal'), ('Honduras', 'Nicaragua'),
|
381
|
+
('Hungary', 'Austria'), ('Hungary', 'Croatia'), ('Hungary', 'Serbia'),
|
382
|
+
('India', 'Bangladesh'), ('India', 'Bhutan'), ('India', 'Burma'),
|
383
|
+
('India', 'China'), ('India', 'Nepal'),
|
384
|
+
('Indonesia', 'Papua New Guinea'), ('Iran', 'Iraq'),
|
385
|
+
('Ireland', 'United Kingdom'), ('Israel', 'Egypt'),
|
386
|
+
('Italy', 'Austria'), ('Jordan', 'Iraq'), ('Jordan', 'Israel'),
|
387
|
+
('Jordan', 'Syria'), ('Jordan', 'West Bank'),
|
388
|
+
('Kazakhstan', 'Kyrgyzstan'), ('Kenya', 'Somalia'), ('Kenya', 'Sudan'),
|
389
|
+
('Kenya', 'Uganda'), ('Kosovo', 'Macedonia'), ('Kosovo', 'Serbia'),
|
390
|
+
('Kuwait', 'Iraq'), ('Laos', 'Burma'), ('Laos', 'China'),
|
391
|
+
('Laos', 'Thailand'), ('Laos', 'Vietnam'), ('Latvia', 'Belarus'),
|
392
|
+
('Latvia', 'Estonia'), ('Lebanon', 'Israel'),
|
393
|
+
('Lesotho', 'South Africa'), ('Liberia', "Cote d'Ivoire"),
|
394
|
+
('Liberia', 'Guinea'), ('Liberia', 'Sierra Leone'),
|
395
|
+
('Libya', 'Algeria'), ('Libya', 'Chad'), ('Libya', 'Egypt'),
|
396
|
+
('Libya', 'Niger'), ('Libya', 'Sudan'), ('Libya', 'Tunisia'),
|
397
|
+
('Liechtenstein', 'Austria'), ('Liechtenstein', 'Switzerland'),
|
398
|
+
('Lithuania', 'Belarus'), ('Lithuania', 'Latvia'),
|
399
|
+
('Lithuania', 'Poland'), ('Lithuania', 'Russia'),
|
400
|
+
('Luxembourg', 'Belgium'), ('Luxembourg', 'Germany'),
|
401
|
+
('Macau', 'China'), ('Macedonia', 'Greece'), ('Macedonia', 'Serbia'),
|
402
|
+
('Malaysia', 'Brunei'), ('Malaysia', 'Indonesia'),
|
403
|
+
('Malaysia', 'Thailand'), ('Mali', 'Algeria'), ('Mali', 'Guinea'),
|
404
|
+
('Mali', 'Niger'), ('Mali', 'Senegal'), ('Mauritania', 'Algeria'),
|
405
|
+
('Mauritania', 'Mali'), ('Mauritania', 'Senegal'),
|
406
|
+
('Mauritania', 'Western Sahara'), ('Monaco', 'France'),
|
407
|
+
('Montenegro', 'Croatia'), ('Montenegro', 'Kosovo'),
|
408
|
+
('Montenegro', 'Serbia'), ('Morocco', 'Spain'),
|
409
|
+
('Mozambique', 'Malawi'), ('Mozambique', 'Zambia'),
|
410
|
+
('Mozambique', 'Zimbabwe'), ('Namibia', 'Botswana'),
|
411
|
+
('Namibia', 'Zambia'), ('Netherlands', 'Germany'), ('Niger', 'Algeria'),
|
412
|
+
('Niger', 'Nigeria'), ('Norway', 'Finland'), ('Norway', 'Russia'),
|
413
|
+
('Norway', 'Sweden'), ('Oman', 'United Arab Emirates'),
|
414
|
+
('Oman', 'Yemen'), ('Pakistan', 'Afghanistan'), ('Pakistan', 'China'),
|
415
|
+
('Pakistan', 'India'), ('Pakistan', 'Iran'), ('Panama', 'Colombia'),
|
416
|
+
('Panama', 'Costa Rica'), ('Paraguay', 'Brazil'), ('Peru', 'Brazil'),
|
417
|
+
('Peru', 'Chile'), ('Peru', 'Colombia'), ('Peru', 'Ecuador'),
|
418
|
+
('Poland', 'Belarus'), ('Poland', 'Germany'), ('Portugal', 'Spain'),
|
419
|
+
('Republic of the Congo', 'Angola'),
|
420
|
+
('Republic of the Congo', 'Central African Republic'),
|
421
|
+
('Republic of the Congo', 'Democratic Republic of the Congo'),
|
422
|
+
('Romania', 'Hungary'), ('Romania', 'Moldova'), ('Romania', 'Serbia'),
|
423
|
+
('Russia', 'Belarus'), ('Russia', 'Estonia'), ('Russia', 'Georgia'),
|
424
|
+
('Russia', 'Kazakhstan'), ('Russia', 'Latvia'), ('Russia', 'Mongolia'),
|
425
|
+
('Russia', 'North Korea'), ('Russia', 'Poland'), ('Rwanda', 'Burundi'),
|
426
|
+
('Rwanda', 'Democratic Republic of the Congo'), ('Rwanda', 'Uganda'),
|
427
|
+
('Saint Martin', 'Netherlands Antilles'), ('San Marino', 'Italy'),
|
428
|
+
('Saudi Arabia', 'Iraq'), ('Saudi Arabia', 'Jordan'),
|
429
|
+
('Saudi Arabia', 'Kuwait'), ('Saudi Arabia', 'Oman'),
|
430
|
+
('Saudi Arabia', 'Qatar'), ('Saudi Arabia', 'United Arab Emirates'),
|
431
|
+
('Saudi Arabia', 'Yemen'), ('Senegal', 'Guinea'), ('Serbia', 'Croatia'),
|
432
|
+
('Slovakia', 'Austria'), ('Slovakia', 'Czech Republic'),
|
433
|
+
('Slovakia', 'Hungary'), ('Slovakia', 'Poland'),
|
434
|
+
('Slovakia', 'Ukraine'), ('Slovenia', 'Austria'),
|
435
|
+
('Slovenia', 'Croatia'), ('Slovenia', 'Hungary'), ('Slovenia', 'Italy'),
|
436
|
+
('Somalia', 'Djibouti'), ('South Africa', 'Botswana'),
|
437
|
+
('South Africa', 'Mozambique'), ('South Africa', 'Namibia'),
|
438
|
+
('South Africa', 'Zimbabwe'), ('South Korea', 'North Korea'),
|
439
|
+
('Sudan', 'Democratic Republic of the Congo'), ('Sudan', 'Egypt'),
|
440
|
+
('Sudan', 'Eritrea'), ('Suriname', 'Guyana'),
|
441
|
+
('Swaziland', 'Mozambique'), ('Swaziland', 'South Africa'),
|
442
|
+
('Switzerland', 'Austria'), ('Switzerland', 'Germany'),
|
443
|
+
('Switzerland', 'Italy'), ('Syria', 'Iraq'), ('Syria', 'Israel'),
|
444
|
+
('Syria', 'Lebanon'), ('Tajikistan', 'Afghanistan'),
|
445
|
+
('Tajikistan', 'China'), ('Tajikistan', 'Kyrgyzstan'),
|
446
|
+
('Tajikistan', 'Uzbekistan'), ('Tanzania', 'Burundi'),
|
447
|
+
('Tanzania', 'Democratic Republic of the Congo'), ('Tanzania', 'Kenya'),
|
448
|
+
('Tanzania', 'Malawi'), ('Tanzania', 'Mozambique'),
|
449
|
+
('Tanzania', 'Rwanda'), ('Tanzania', 'Uganda'), ('Tanzania', 'Zambia'),
|
450
|
+
('Thailand', 'Burma'), ('The Gambia', 'Senegal'),
|
451
|
+
('Timor-Leste', 'Indonesia'), ('Turkey', 'Armenia'),
|
452
|
+
('Turkey', 'Bulgaria'), ('Turkey', 'Georgia'), ('Turkey', 'Greece'),
|
453
|
+
('Turkey', 'Iran'), ('Turkey', 'Iraq'), ('Turkey', 'Syria'),
|
454
|
+
('Turkmenistan', 'Afghanistan'), ('Turkmenistan', 'Iran'),
|
455
|
+
('Turkmenistan', 'Kazakhstan'), ('Turkmenistan', 'Uzbekistan'),
|
456
|
+
('Uganda', 'Democratic Republic of the Congo'), ('Uganda', 'Sudan'),
|
457
|
+
('Ukraine', 'Belarus'), ('Ukraine', 'Hungary'), ('Ukraine', 'Moldova'),
|
458
|
+
('Ukraine', 'Poland'), ('Ukraine', 'Romania'), ('Ukraine', 'Russia'),
|
459
|
+
('United States', 'Mexico'), ('Uruguay', 'Brazil'),
|
460
|
+
('Uzbekistan', 'Kazakhstan'), ('Uzbekistan', 'Kyrgyzstan'),
|
461
|
+
('Vatican City', 'Italy'), ('Venezuela', 'Guyana'),
|
462
|
+
('West Bank', 'Israel'), ('Western Sahara', 'Algeria'),
|
463
|
+
('Western Sahara', 'Morocco'), ('Zambia', 'Malawi'),
|
464
|
+
('Zambia', 'Zimbabwe'), ('Zimbabwe', 'Botswana')
|
465
|
+
]
|
466
|
+
gps_coordinates = {
|
467
|
+
"Cote d'Ivoire": [[8, 'N'], [5, 'W']],
|
468
|
+
'Afghanistan': [[33, 'N'], [65, 'E']],
|
469
|
+
'Akrotiri': [[34, 'N'], [32, 'E']],
|
470
|
+
'Albania': [[41, 'N'], [20, 'E']],
|
471
|
+
'Algeria': [[28, 'N'], [3, 'E']],
|
472
|
+
'American Samoa': [[14, 'S'], [170, 'W']],
|
473
|
+
'Andorra': [[42, 'N'], [1, 'E']],
|
474
|
+
'Angola': [[12, 'S'], [18, 'E']],
|
475
|
+
'Anguilla': [[18, 'N'], [63, 'W']],
|
476
|
+
'Antarctica': [[90, 'S'], [0, 'E']],
|
477
|
+
'Antigua and Barbuda': [[17, 'N'], [61, 'W']],
|
478
|
+
'Argentina': [[34, 'S'], [64, 'W']],
|
479
|
+
'Armenia': [[40, 'N'], [45, 'E']],
|
480
|
+
'Aruba': [[12, 'N'], [69, 'W']],
|
481
|
+
'Ashmore and Cartier Islands': [[12, 'S'], [123, 'E']],
|
482
|
+
'Australia': [[27, 'S'], [133, 'E']],
|
483
|
+
'Austria': [[47, 'N'], [13, 'E']],
|
484
|
+
'Azerbaijan': [[40, 'N'], [47, 'E']],
|
485
|
+
'Bahamas, The': [[24, 'N'], [76, 'W']],
|
486
|
+
'Bahrain': [[26, 'N'], [50, 'E']],
|
487
|
+
'Bangladesh': [[24, 'N'], [90, 'E']],
|
488
|
+
'Barbados': [[13, 'N'], [59, 'W']],
|
489
|
+
'Belarus': [[53, 'N'], [28, 'E']],
|
490
|
+
'Belgium': [[50, 'N'], [4, 'E']],
|
491
|
+
'Belize': [[17, 'N'], [88, 'W']],
|
492
|
+
'Benin': [[9, 'N'], [2, 'E']],
|
493
|
+
'Bermuda': [[32, 'N'], [64, 'W']],
|
494
|
+
'Bhutan': [[27, 'N'], [90, 'E']],
|
495
|
+
'Bolivia': [[17, 'S'], [65, 'W']],
|
496
|
+
'Bosnia and Herzegovina': [[44, 'N'], [18, 'E']],
|
497
|
+
'Botswana': [[22, 'S'], [24, 'E']],
|
498
|
+
'Bouvet Island': [[54, 'S'], [3, 'E']],
|
499
|
+
'Brazil': [[10, 'S'], [55, 'W']],
|
500
|
+
'British Indian Ocean Territory': [[6, 'S'], [71, 'E']],
|
501
|
+
'British Virgin Islands': [[18, 'N'], [64, 'W']],
|
502
|
+
'Brunei': [[4, 'N'], [114, 'E']],
|
503
|
+
'Bulgaria': [[43, 'N'], [25, 'E']],
|
504
|
+
'Burkina Faso': [[13, 'N'], [2, 'W']],
|
505
|
+
'Burma': [[22, 'N'], [98, 'E']],
|
506
|
+
'Burundi': [[3, 'S'], [30, 'E']],
|
507
|
+
'Cambodia': [[13, 'N'], [105, 'E']],
|
508
|
+
'Cameroon': [[6, 'N'], [12, 'E']],
|
509
|
+
'Canada': [[60, 'N'], [95, 'W']],
|
510
|
+
'Cape Verde': [[16, 'N'], [24, 'W']],
|
511
|
+
'Cayman Islands': [[19, 'N'], [80, 'W']],
|
512
|
+
'Central African Republic': [[7, 'N'], [21, 'E']],
|
513
|
+
'Chad': [[15, 'N'], [19, 'E']],
|
514
|
+
'Chile': [[30, 'S'], [71, 'W']],
|
515
|
+
'China': [[35, 'N'], [105, 'E']],
|
516
|
+
'Christmas Island': [[10, 'S'], [105, 'E']],
|
517
|
+
'Clipperton Island': [[10, 'N'], [109, 'W']],
|
518
|
+
'Cocos (Keeling) Islands': [[12, 'S'], [96, 'E']],
|
519
|
+
'Colombia': [[4, 'N'], [72, 'W']],
|
520
|
+
'Comoros': [[12, 'S'], [44, 'E']],
|
521
|
+
'Cook Islands': [[21, 'S'], [159, 'W']],
|
522
|
+
'Coral Sea Islands': [[18, 'S'], [152, 'E']],
|
523
|
+
'Costa Rica': [[10, 'N'], [84, 'W']],
|
524
|
+
'Croatia': [[45, 'N'], [15, 'E']],
|
525
|
+
'Cuba': [[21, 'N'], [80, 'W']],
|
526
|
+
'Cyprus': [[35, 'N'], [33, 'E']],
|
527
|
+
'Czech Republic': [[49, 'N'], [15, 'E']],
|
528
|
+
'Democratic Republic of the Congo': [[0, 'N'], [25, 'E']],
|
529
|
+
'Denmark': [[56, 'N'], [10, 'E']],
|
530
|
+
'Dhekelia': [[34, 'N'], [33, 'E']],
|
531
|
+
'Djibouti': [[11, 'N'], [43, 'E']],
|
532
|
+
'Dominica': [[15, 'N'], [61, 'W']],
|
533
|
+
'Dominican Republic': [[19, 'N'], [70, 'W']],
|
534
|
+
'Ecuador': [[2, 'S'], [77, 'W']],
|
535
|
+
'Egypt': [[27, 'N'], [30, 'E']],
|
536
|
+
'El Salvador': [[13, 'N'], [88, 'W']],
|
537
|
+
'Equatorial Guinea': [[2, 'N'], [10, 'E']],
|
538
|
+
'Eritrea': [[15, 'N'], [39, 'E']],
|
539
|
+
'Estonia': [[59, 'N'], [26, 'E']],
|
540
|
+
'Ethiopia': [[8, 'N'], [38, 'E']],
|
541
|
+
'Falkland Islands (Islas Malvinas)': [[51, 'S'], [59, 'W']],
|
542
|
+
'Faroe Islands': [[62, 'N'], [7, 'W']],
|
543
|
+
'Fiji': [[18, 'S'], [175, 'E']],
|
544
|
+
'Finland': [[64, 'N'], [26, 'E']],
|
545
|
+
'France': [[46, 'N'], [2, 'E']],
|
546
|
+
'French Polynesia': [[15, 'S'], [140, 'W']],
|
547
|
+
'Gabon': [[1, 'S'], [11, 'E']],
|
548
|
+
'Gaza Strip': [[31, 'N'], [34, 'E']],
|
549
|
+
'Georgia': [[42, 'N'], [43, 'E']],
|
550
|
+
'Germany': [[51, 'N'], [9, 'E']],
|
551
|
+
'Ghana': [[8, 'N'], [2, 'W']],
|
552
|
+
'Gibraltar': [[36, 'N'], [5, 'W']],
|
553
|
+
'Greece': [[39, 'N'], [22, 'E']],
|
554
|
+
'Greenland': [[72, 'N'], [40, 'W']],
|
555
|
+
'Grenada': [[12, 'N'], [61, 'W']],
|
556
|
+
'Guam': [[13, 'N'], [144, 'E']],
|
557
|
+
'Guatemala': [[15, 'N'], [90, 'W']],
|
558
|
+
'Guernsey': [[49, 'N'], [2, 'W']],
|
559
|
+
'Guinea': [[11, 'N'], [10, 'W']],
|
560
|
+
'Guinea-Bissau': [[12, 'N'], [15, 'W']],
|
561
|
+
'Guyana': [[5, 'N'], [59, 'W']],
|
562
|
+
'Haiti': [[19, 'N'], [72, 'W']],
|
563
|
+
'Heard Island and McDonald Islands': [[53, 'S'], [72, 'E']],
|
564
|
+
'Honduras': [[15, 'N'], [86, 'W']],
|
565
|
+
'Hong Kong': [[22, 'N'], [114, 'E']],
|
566
|
+
'Hungary': [[47, 'N'], [20, 'E']],
|
567
|
+
'Iceland': [[65, 'N'], [18, 'W']],
|
568
|
+
'India': [[20, 'N'], [77, 'E']],
|
569
|
+
'Indonesia': [[5, 'S'], [120, 'E']],
|
570
|
+
'Iran': [[32, 'N'], [53, 'E']],
|
571
|
+
'Iraq': [[33, 'N'], [44, 'E']],
|
572
|
+
'Ireland': [[53, 'N'], [8, 'W']],
|
573
|
+
'Isle of Man': [[54, 'N'], [4, 'W']],
|
574
|
+
'Israel': [[31, 'N'], [34, 'E']],
|
575
|
+
'Italy': [[42, 'N'], [12, 'E']],
|
576
|
+
'Jamaica': [[18, 'N'], [77, 'W']],
|
577
|
+
'Jan Mayen': [[71, 'N'], [8, 'W']],
|
578
|
+
'Japan': [[36, 'N'], [138, 'E']],
|
579
|
+
'Jersey': [[49, 'N'], [2, 'W']],
|
580
|
+
'Jordan': [[31, 'N'], [36, 'E']],
|
581
|
+
'Kazakhstan': [[48, 'N'], [68, 'E']],
|
582
|
+
'Kenya': [[1, 'N'], [38, 'E']],
|
583
|
+
'Kiribati': [[1, 'N'], [173, 'E']],
|
584
|
+
'Kosovo': [[42, 'N'], [21, 'E']],
|
585
|
+
'Kuwait': [[29, 'N'], [45, 'E']],
|
586
|
+
'Kyrgyzstan': [[41, 'N'], [75, 'E']],
|
587
|
+
'Laos': [[18, 'N'], [105, 'E']],
|
588
|
+
'Latvia': [[57, 'N'], [25, 'E']],
|
589
|
+
'Lebanon': [[33, 'N'], [35, 'E']],
|
590
|
+
'Lesotho': [[29, 'S'], [28, 'E']],
|
591
|
+
'Liberia': [[6, 'N'], [9, 'W']],
|
592
|
+
'Libya': [[25, 'N'], [17, 'E']],
|
593
|
+
'Liechtenstein': [[47, 'N'], [9, 'E']],
|
594
|
+
'Lithuania': [[56, 'N'], [24, 'E']],
|
595
|
+
'Luxembourg': [[49, 'N'], [6, 'E']],
|
596
|
+
'Macau': [[22, 'N'], [113, 'E']],
|
597
|
+
'Macedonia': [[41, 'N'], [22, 'E']],
|
598
|
+
'Madagascar': [[20, 'S'], [47, 'E']],
|
599
|
+
'Malawi': [[13, 'S'], [34, 'E']],
|
600
|
+
'Malaysia': [[2, 'N'], [112, 'E']],
|
601
|
+
'Maldives': [[3, 'N'], [73, 'E']],
|
602
|
+
'Mali': [[17, 'N'], [4, 'W']],
|
603
|
+
'Malta': [[35, 'N'], [14, 'E']],
|
604
|
+
'Marshall Islands': [[9, 'N'], [168, 'E']],
|
605
|
+
'Mauritania': [[20, 'N'], [12, 'W']],
|
606
|
+
'Mauritius': [[20, 'S'], [57, 'E']],
|
607
|
+
'Mayotte': [[12, 'S'], [45, 'E']],
|
608
|
+
'Mexico': [[23, 'N'], [102, 'W']],
|
609
|
+
'Micronesia, Federated States of': [[6, 'N'], [158, 'E']],
|
610
|
+
'Moldova': [[47, 'N'], [29, 'E']],
|
611
|
+
'Monaco': [[43, 'N'], [7, 'E']],
|
612
|
+
'Mongolia': [[46, 'N'], [105, 'E']],
|
613
|
+
'Montenegro': [[42, 'N'], [19, 'E']],
|
614
|
+
'Montserrat': [[16, 'N'], [62, 'W']],
|
615
|
+
'Morocco': [[32, 'N'], [5, 'W']],
|
616
|
+
'Mozambique': [[18, 'S'], [35, 'E']],
|
617
|
+
'Namibia': [[22, 'S'], [17, 'E']],
|
618
|
+
'Nauru': [[0, 'S'], [166, 'E']],
|
619
|
+
'Navassa Island': [[18, 'N'], [75, 'W']],
|
620
|
+
'Nepal': [[28, 'N'], [84, 'E']],
|
621
|
+
'Netherlands Antilles': [[12, 'N'], [69, 'W']],
|
622
|
+
'Netherlands': [[52, 'N'], [5, 'E']],
|
623
|
+
'New Caledonia': [[21, 'S'], [165, 'E']],
|
624
|
+
'New Zealand': [[41, 'S'], [174, 'E']],
|
625
|
+
'Nicaragua': [[13, 'N'], [85, 'W']],
|
626
|
+
'Niger': [[16, 'N'], [8, 'E']],
|
627
|
+
'Nigeria': [[10, 'N'], [8, 'E']],
|
628
|
+
'Niue': [[19, 'S'], [169, 'W']],
|
629
|
+
'Norfolk Island': [[29, 'S'], [167, 'E']],
|
630
|
+
'North Korea': [[40, 'N'], [127, 'E']],
|
631
|
+
'Northern Mariana Islands': [[15, 'N'], [145, 'E']],
|
632
|
+
'Norway': [[62, 'N'], [10, 'E']],
|
633
|
+
'Oman': [[21, 'N'], [57, 'E']],
|
634
|
+
'Pakistan': [[30, 'N'], [70, 'E']],
|
635
|
+
'Palau': [[7, 'N'], [134, 'E']],
|
636
|
+
'Panama': [[9, 'N'], [80, 'W']],
|
637
|
+
'Papua New Guinea': [[6, 'S'], [147, 'E']],
|
638
|
+
'Paracel Islands': [[16, 'N'], [112, 'E']],
|
639
|
+
'Paraguay': [[23, 'S'], [58, 'W']],
|
640
|
+
'Peru': [[10, 'S'], [76, 'W']],
|
641
|
+
'Philippines': [[13, 'N'], [122, 'E']],
|
642
|
+
'Pitcairn Islands': [[25, 'S'], [130, 'W']],
|
643
|
+
'Poland': [[52, 'N'], [20, 'E']],
|
644
|
+
'Portugal': [[39, 'N'], [8, 'W']],
|
645
|
+
'Puerto Rico': [[18, 'N'], [66, 'W']],
|
646
|
+
'Qatar': [[25, 'N'], [51, 'E']],
|
647
|
+
'Republic of the Congo': [[1, 'S'], [15, 'E']],
|
648
|
+
'Romania': [[46, 'N'], [25, 'E']],
|
649
|
+
'Russia': [[60, 'N'], [100, 'E']],
|
650
|
+
'Rwanda': [[2, 'S'], [30, 'E']],
|
651
|
+
'Saint Barthelemy': [[17, 'N'], [62, 'W']],
|
652
|
+
'Saint Helena': [[15, 'S'], [5, 'W']],
|
653
|
+
'Saint Kitts and Nevis': [[17, 'N'], [62, 'W']],
|
654
|
+
'Saint Lucia': [[13, 'N'], [60, 'W']],
|
655
|
+
'Saint Martin': [[18, 'N'], [63, 'W']],
|
656
|
+
'Saint Pierre and Miquelon': [[46, 'N'], [56, 'W']],
|
657
|
+
'Saint Vincent and the Grenadines': [[13, 'N'], [61, 'W']],
|
658
|
+
'Samoa': [[13, 'S'], [172, 'W']],
|
659
|
+
'San Marino': [[43, 'N'], [12, 'E']],
|
660
|
+
'Sao Tome and Principe': [[1, 'N'], [7, 'E']],
|
661
|
+
'Saudi Arabia': [[25, 'N'], [45, 'E']],
|
662
|
+
'Senegal': [[14, 'N'], [14, 'W']],
|
663
|
+
'Serbia': [[44, 'N'], [21, 'E']],
|
664
|
+
'Seychelles': [[4, 'S'], [55, 'E']],
|
665
|
+
'Sierra Leone': [[8, 'N'], [11, 'W']],
|
666
|
+
'Singapore': [[1, 'N'], [103, 'E']],
|
667
|
+
'Slovakia': [[48, 'N'], [19, 'E']],
|
668
|
+
'Slovenia': [[46, 'N'], [14, 'E']],
|
669
|
+
'Solomon Islands': [[8, 'S'], [159, 'E']],
|
670
|
+
'Somalia': [[10, 'N'], [49, 'E']],
|
671
|
+
'South Africa': [[29, 'S'], [24, 'E']],
|
672
|
+
'South Georgia and the South Sandwich Islands': [[54, 'S'], [37, 'W']],
|
673
|
+
'South Korea': [[37, 'N'], [127, 'E']],
|
674
|
+
'Spain': [[40, 'N'], [4, 'W']],
|
675
|
+
'Spratly Islands': [[8, 'N'], [111, 'E']],
|
676
|
+
'Sri Lanka': [[7, 'N'], [81, 'E']],
|
677
|
+
'Sudan': [[15, 'N'], [30, 'E']],
|
678
|
+
'Suriname': [[4, 'N'], [56, 'W']],
|
679
|
+
'Svalbard': [[78, 'N'], [20, 'E']],
|
680
|
+
'Swaziland': [[26, 'S'], [31, 'E']],
|
681
|
+
'Sweden': [[62, 'N'], [15, 'E']],
|
682
|
+
'Switzerland': [[47, 'N'], [8, 'E']],
|
683
|
+
'Syria': [[35, 'N'], [38, 'E']],
|
684
|
+
'Taiwan': [[23, 'N'], [121, 'E']],
|
685
|
+
'Tajikistan': [[39, 'N'], [71, 'E']],
|
686
|
+
'Tanzania': [[6, 'S'], [35, 'E']],
|
687
|
+
'Thailand': [[15, 'N'], [100, 'E']],
|
688
|
+
'The Gambia': [[13, 'N'], [16, 'W']],
|
689
|
+
'Timor-Leste': [[8, 'S'], [125, 'E']],
|
690
|
+
'Togo': [[8, 'N'], [1, 'E']],
|
691
|
+
'Tokelau': [[9, 'S'], [172, 'W']],
|
692
|
+
'Tonga': [[20, 'S'], [175, 'W']],
|
693
|
+
'Trinidad and Tobago': [[11, 'N'], [61, 'W']],
|
694
|
+
'Tunisia': [[34, 'N'], [9, 'E']],
|
695
|
+
'Turkey': [[39, 'N'], [35, 'E']],
|
696
|
+
'Turkmenistan': [[40, 'N'], [60, 'E']],
|
697
|
+
'Turks and Caicos Islands': [[21, 'N'], [71, 'W']],
|
698
|
+
'Tuvalu': [[8, 'S'], [178, 'E']],
|
699
|
+
'Uganda': [[1, 'N'], [32, 'E']],
|
700
|
+
'Ukraine': [[49, 'N'], [32, 'E']],
|
701
|
+
'United Arab Emirates': [[24, 'N'], [54, 'E']],
|
702
|
+
'United Kingdom': [[54, 'N'], [2, 'W']],
|
703
|
+
'United States': [[38, 'N'], [97, 'W']],
|
704
|
+
'Uruguay': [[33, 'S'], [56, 'W']],
|
705
|
+
'Uzbekistan': [[41, 'N'], [64, 'E']],
|
706
|
+
'Vanuatu': [[16, 'S'], [167, 'E']],
|
707
|
+
'Vatican City': [[41, 'N'], [12, 'E']],
|
708
|
+
'Venezuela': [[8, 'N'], [66, 'W']],
|
709
|
+
'Vietnam': [[16, 'N'], [107, 'E']],
|
710
|
+
'Virgin Islands': [[18, 'N'], [64, 'W']],
|
711
|
+
'Wake Island': [[19, 'N'], [166, 'E']],
|
712
|
+
'Wallis and Futuna': [[13, 'S'], [176, 'W']],
|
713
|
+
'West Bank': [[32, 'N'], [35, 'E']],
|
714
|
+
'Western Sahara': [[24, 'N'], [13, 'W']],
|
715
|
+
'Yemen': [[15, 'N'], [48, 'E']],
|
716
|
+
'Zambia': [[15, 'S'], [30, 'E']],
|
717
|
+
'Zimbabwe': [[20, 'S'], [30, 'E']]
|
718
|
+
}
|
719
|
+
g = Graph()
|
720
|
+
g.add_edges(edges)
|
721
|
+
g.add_vertices(gps_coordinates)
|
722
|
+
g.gps_coordinates = gps_coordinates
|
723
|
+
g.name("World Map")
|
724
|
+
return g
|