Skip to content
Snippets Groups Projects
Select Git revision
  • b69c1e0a6b82a9187c9b49750700090ac8d0ecc6
  • master default protected
2 results

graphe-matrice.py

Blame
  • graphe-matrice.py 235 B
    
    # Création d'un matrice d'adjacence pour un graphe
    n = 5 
    G = [[0 for j in range(n)] for i in range (n)]
    
    # Ajout d'un lien (si le graphe est non orienté)
    G[0][1] = 1
    G[1][0] = 1
    
    # Affichage du graphe
    for row in G:
        print(row)