g = {
  1: (2, 6, 7, 4),
  2: (1, 3, 4, 5, 6, 17),
  3: (2, 5, 6),
  4: (2, 5, 17, 1, 26, 31),
  5: (2, 3, 6, 8, 14, 15, 16, 17, 4),
  6: (2, 3, 5, 8, 9, 7, 1),
  7: (10, 1, 6),
  8: (5, 6, 9, 13, 14),
  9: (6, 8, 13, 12, 10),
  10: (7, 12, 11, 9),
  11: (10, 12),
  12: (20, 13, 9, 11, 10, 37),
  13: (18, 14, 8, 9, 12),
  14: (5, 15, 18, 13, 8),
  15: (16, 5, 14, 18),
  16: (17, 5, 15, 18, 26),
  17: (4, 26, 16, 5, 2),
  18: (16, 15, 14, 13, 20, 21, 22, 26),
  19: (20,),
  20: (19, 23, 24, 21, 18, 12, 37),
  21: (25, 22, 18, 20, 24),
  22: (25, 26, 18, 21),
  23: (37, 20, 24),
  24: (27, 25, 21, 20, 23, 37),
  25: (31, 26, 22, 21, 24, 27, 28, 29, 30),
  26: (4, 17, 16, 18, 22, 25, 31),
  27: (25, 29, 32, 24),
  28: (25, 29),
  29: (28, 25, 27, 32, 31, 30, 33),
  30: (31, 25, 29),
  31: (4, 25, 30, 29, 33, 26),
  32: (27, 29, 33, 34, 35),
  33: (31, 34, 32, 29),
  34: (33, 32, 35),
  35: (34, 32, 37),
  36: (37,),
  37: (12, 20, 23, 24, 35, 36),
}

info = {
  1: {
    "name": "Daxia",
<<<<<<< HEAD
=======
    "short_name": "DAX",
>>>>>>> origin/master
    "type": "Forest",
    "towns": 1,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  2: {
    "name": "Ielia",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 3,
    "ports": 2,
  },
  3: {
    "name": "Violan Islands",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 0,
    "ports": 1,
  },
  4: {
    "name": "Iellean Sea",
    "type": "Water",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  5: {
    "name": "Moelean",
    "type": "Water",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  6: {
    "name": "Hoppara",
    "type": "Plains",
    "towns": 2,
    "fields": 4,
    "mines": 0,
    "ports": 1,
  },
  7: {
    "name": "Ule",
    "type": "Hill",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  8: {
    "name": "Sayenne",
    "type": "Plains",
    "towns": 3,
    "fields": 2,
    "mines": 0,
    "ports": 0,
  },
  9: {
    "name": "Cherobex",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 3,
    "ports": 0,
  },
  10: {
    "name": "Zulea",
    "type": "Plains",
    "towns": 1,
    "fields": 1,
    "mines": 1,
    "ports": 1,
  },
  11: {
    "name": "Western Isles",
    "type": "Plains",
    "towns": 0,
    "fields": 0,
    "mines": 2,
    "ports": 1,
  },
  12: {
    "name": "White Sea",
    "type": "Water",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  13: {
    "name": "Umbrawood",
    "type": "Forest",
    "towns": 2,
    "fields": 2,
    "mines": 0,
    "ports": 1,
  },
  14: {
    "name": "Leboa",
    "type": "Plains",
    "towns": 1,
    "fields": 3,
    "mines": 0,
    "ports": 1,
  },
  15: {
    "name": "Kwythellar",
    "type": "Capital",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 2,
  },
  16: {
    "name": "Aldwood",
    "type": "Plains",
    "towns": 2,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  17: {
    "name": "Frejland",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 2,
    "ports": 0,
  },
  18: {
    "name": "Kuriotatia",
    "type": "Plains",
    "towns": 4,
    "fields": 6,
    "mines": 0,
    "ports": 0,
  },
  19: {
    "name": "Ithralia",
    "type": "Hills",
    "towns": 0,
    "fields": 0,
    "mines": 4,
    "ports": 0,
  },
  20: {
    "name": "Oveska",
    "type": "Dessert",
    "towns": 1,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  21: {
    "name": "Florenta",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 2,
    "ports": 2,
  },
  22: {
    "name": "Terino",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 1,
    "ports": 2,
  },
  23: {
    "name": "Yaveh",
    "type": "Dessert",
    "towns": 2,
    "fields": 1,
    "mines": 0,
    "ports": 2,
  },
  24: {
    "name": "Salwah",
    "type": "Dessert",
    "towns": 2,
    "fields": 3,
    "mines": 0,
    "ports": 0,
  },
  25: {
    "name": "Aegean",
    "type": "Sea",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  26: {
    "name": "Korinthos",
    "type": "Plains",
    "towns": 2,
    "fields": 2,
    "mines": 0,
    "ports": 0,
  },
  27: {
    "name": "Isthmus",
    "type": "Forest",
    "towns": 0,
    "fields": 0,
    "mines": 1,
    "ports": 0,
  },
  28: {
    "name": "Sekeuthia",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 1,
    "ports": 1,
  },
  29: {
    "name": "Trileferate",
    "type": "Plains",
    "towns": 2,
    "fields": 3,
    "mines": 0,
    "ports": 0,
  },
  30: {
    "name": "Madeleigna",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 0,
    "ports": 1,
  },
  31: {
    "name": "Teluevea",
    "type": "Sea",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  32: {
    "name": "Gau",
    "type": "Forest",
    "towns": 1,
    "fields": 2,
    "mines": 2,
    "ports": 0,
  },
  33: {
    "name": "East Aszura",
    "type": "Forest",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 1,
  },
  34: {
    "name": "Aszura",
    "type": "Forest",
    "towns": 0,
    "fields": 0,
    "mines": 0,
    "ports": 0,
  },
  35: {
    "name": "Merroh",
    "type": "Forest",
    "towns": 0,
    "fields": 1,
    "mines": 1,
    "ports": 1,
  },
  36: {
    "name": "Pelapones",
    "type": "Plain",
    "towns": 1,
    "fields": 0,
    "mines": 0,
    "ports": 1,
  },
  37: {
    "name": "Doverean Sea",
    "type": "Plains",
    "towns": 1,
    "fields": 0,
    "mines": 0,
    "ports": 1,
  }
}

def check_links(v: dict):
  for key1 in v.keys():
    for key2 in v.keys():
      if key1 == key2:
        continue
      if key1 not in v[key2] and key2 in v[key1]:
        print("{} not in {}".format(key1, key2))

if __name__ == "__main__":
<<<<<<< HEAD
  # import networkx as nx
  # import matplotlib.pyplot as plt
  #
  # edges = set()
  # for key in g:
  #   for val in g[key]:
  #     if (key, val) not in edges and (val, key) not in edges:
  #       edges.add((key, val))
  # edges = [(x[0], x[1], {"color": "blue" if info[x[0]]["type"] == "Sea" else "black"}) for x in edges]
  # print(edges)
  # G = nx.Graph()
  # G.add_edges_from(ebunch_to_add=edges)
  # nx.draw(G, with_labels=True,  pos=nx.kamada_kawai_layout(G))
  # # nx.draw_spring(G)
  # plt.show()

  for key in info:
    info[key]["short_name"] = info[key]["name"][0:3].upper()
  print(info)
=======
  import networkx as nx
  import matplotlib.pyplot as plt

  edges = set()
  for key in g:
    for val in g[key]:
      if (key, val) not in edges and (val, key) not in edges:
        edges.add((key, val))
  edges = [(x[0], x[1], {"color": "blue" if info[x[0]]["type"] == "Sea" else "black"}) for x in edges]
  print(edges)
  G = nx.Graph()
  G.add_edges_from(ebunch_to_add=edges)
  nx.draw(G, with_labels=True,  pos=nx.kamada_kawai_layout(G))
  # nx.draw_spring(G)
  plt.show()
>>>>>>> origin/master
