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

graphe-matrice.py

Blame
  • Forked from Vuillemot Romain / INF-TC1
    Source project has a limited visibility.
    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)