Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Europe map graph #24496

Closed
jm58660 mannequin opened this issue Jan 9, 2018 · 10 comments
Closed

Add Europe map graph #24496

jm58660 mannequin opened this issue Jan 9, 2018 · 10 comments

Comments

@jm58660
Copy link
Mannequin

jm58660 mannequin commented Jan 9, 2018

This patch will add a graph that could be useful in some examples.

Unfortunately center() of Europe is quite large.

Component: graph theory

Author: Jori Mäntysalo

Branch/Commit: d053e63

Reviewer: David Coudert

Issue created by migration from https://trac.sagemath.org/ticket/24496

@jm58660 jm58660 mannequin added this to the sage-8.2 milestone Jan 9, 2018
@jm58660 jm58660 mannequin added c: graph theory labels Jan 9, 2018
@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Jan 9, 2018

Branch: u/jmantysalo/europe-map

@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Jan 9, 2018

Commit: 3e0fcdc

@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Jan 9, 2018

New commits:

3e0fcdcAdd map graph for Europe.

@jm58660 jm58660 mannequin added the s: needs review label Jan 9, 2018
@dcoudert
Copy link
Contributor

dcoudert commented Jan 9, 2018

comment:3

You could do:

+    if continental:
+        G = G.subgraph(G.connected_component_containing_vertex('France'))
+        G.name(new="Continental Europe Map")
+    else:
+        G.add_vertices(no_land_border)
+        G.name(new="Europe Map")

Instead of France, you can of course choose another country ;)
The most important is to be independent of the order in which connected components are returned.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2018

Branch pushed to git repo; I updated commit sha1. New commits:

d053e63Minor modification.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jan 9, 2018

Changed commit from 3e0fcdc to d053e63

@jm58660
Copy link
Mannequin Author

jm58660 mannequin commented Jan 9, 2018

comment:5

As you wish. Actually "The list is ordered from largest to smallest component.", says documentation of connected_components, but it is not explicitly said in connected_components_subgraphs.

I select Austria as "central point". At least it will survive climate change and raising sea level...

@dcoudert
Copy link
Contributor

dcoudert commented Jan 9, 2018

comment:6

I checked that europe is a subgraph of the world (after removing Malta and Iceland that are added back to the world in #24488) !

@dcoudert
Copy link
Contributor

dcoudert commented Jan 9, 2018

Reviewer: David Coudert

@vbraun
Copy link
Member

vbraun commented Jan 14, 2018

Changed branch from u/jmantysalo/europe-map to d053e63

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants