-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmap.coloring.py
More file actions
40 lines (36 loc) · 1.59 KB
/
Copy pathmap.coloring.py
File metadata and controls
40 lines (36 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
colors = ('red', 'blue', 'green', 'orange', 'yellow', 'purple', 'brown',
'black')
countries = {
'Guyana': ['Venezuella', 'Brazil', 'Suriname'],
'Suriname': ['Guyana', 'Brazil', 'French Guiana'],
'French Guiana': ['Suriname', 'Brazil'],
'Brazil': ['French Guiana', 'Suriname', 'Uruguay',
'Paraguay', 'Bolivia', 'Peru', 'Columbia',
'Venezuella', 'Guyana', 'Suriname'],
'Uruguay': ['Brazil', 'Argentina'],
'Argentina': ['Uruguay', 'Brazil', 'Paraguay', 'Bolivia', 'Chile'],
'Chile': ['Peru', 'Bolivia', 'Argentina'],
'Paraguay': ['Brazil', 'Bolivia', 'Uruguay', 'Argentina'],
'Bolivia':['Peru', 'Brazil', 'Paraguay', 'Argentina', 'Chile'],
'Peru': ['Chile', 'Bolivia', 'Brazil', 'Equador', 'Columbia'],
'Equador': ['Peru', 'Columbia'],
'Columbia': ['Equador', 'Peru', 'Brazil', 'Venezuella'],
'Venezuella': ['Columbia', 'Brazil', 'Guyana'],
'Guyana': ['Venezuella', 'Brazil', 'Suriname'],
'Suriname': ['Guyana', 'Brazil', 'French Guiana'],
'French Guiana': ['Brazil', 'Suriname'],
'Galapogos Islands': [],
'Falkland Islands': [],
'South Georgia': []}
# Get empty nodes
# Get richest nodes
# Appoint the most expensive color to the vertice with the highest number of relations
def get_richest():
sorted_keys = countries.keys()
sorted_keys.sort(
cmp=lambda x, y: len(countries[x]) - len(countries[y]),
reverse=True)
return sorted_keys
def set_color():
# Coloring algorithm
raise NotImplementedError