import networkx as nx           # pour la gestion des graphes
import matplotlib.pyplot as plt # pour la représentation graphique

def creer_graphe():
    G = nx.Graph()  # ici, graphe non-orienté ; sinon nx.DiGraph()

    # Ajout des sommets nommés (node en anglais)
    G.add_node("France")     # pour la Guyane Française
    G.add_node("Argentine")
    G.add_node("Bolivie")
    G.add_node("Bresil")
    G.add_node("Chili")
    G.add_node("Colombie")
    G.add_node("Equateur")
    G.add_node("Guyana")
    G.add_node("Paraguay")
    G.add_node("Perou")
    G.add_node("Suriname")
    G.add_node("Uruguay")
    G.add_node("Venezuela")

    # Ajout des arêtes (edge en anglais)
    G.add_edge("France", "Bresil")
    G.add_edge("France", "Suriname")
    G.add_edge("Argentine", "Bolivie")
    G.add_edge("Argentine", "Bresil")
    G.add_edge("Argentine", "Chili")
    G.add_edge("Argentine", "Paraguay")
    G.add_edge("Argentine", "Uruguay")
    G.add_edge("Bolivie", "Bresil")
    G.add_edge("Bolivie", "Chili")
    G.add_edge("Bolivie", "Paraguay")
    G.add_edge("Bolivie", "Perou")
    G.add_edge("Bolivie", "Uruguay")
    G.add_edge("Bresil", "Colombie")
    G.add_edge("Bresil", "France")
    G.add_edge("Bresil", "Guyana")
    G.add_edge("Bresil", "Paraguay")
    G.add_edge("Bresil", "Perou")
    G.add_edge("Bresil", "Suriname")
    G.add_edge("Bresil", "Uruguay")
    G.add_edge("Bresil", "Venezuela")
    G.add_edge("Colombie", "Equateur")
    G.add_edge("Colombie", "Perou")
    G.add_edge("Colombie", "Venezuela")
    G.add_edge("Equateur","Perou")
    G.add_edge("Guyana", "Suriname")
    G.add_edge("Guyana", "Venezuela")

    return G

# création du graphe par appel de la fonction précédente
Graphe = creer_graphe()

# Représentation graphique
nx.draw(Graphe, with_labels=True)
plt.show()