Beispiel #1
0
 public Aresta AddAresta(Vertice origem, Vertice destino, Int32 peso = 1)
 {
     if (vertices.Contains(origem) && vertices.Contains(destino))
     {
         Aresta e = new Aresta(origem, destino, peso);
         origem.AddArestaAdj(e);
         arestas.Add(e);
         return(e);
     }
     throw new Exception("Não é possivel criar arestas entre vértices que não pertençam ao grafo.");
 }