This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def cria_grafo(lista_de_vertices, lista_de_arestas): | |
| grafo = {} | |
| for vertice in lista_de_vertices: | |
| grafo[vertice] = [] | |
| for aresta in lista_de_arestas: | |
| grafo[aresta[0]].append(aresta[1]) | |
| return grafo | |