def getEdge(graph, vertexa, vertexb): """ Retorna el arco asociado a los vertices vertexa ---- vertexb Args: graph: El grafo sobre el que se ejecuta la operacion vertexa: Vertice de inicio vertexb: Vertice destino Returns: El grado el arco Raises: Exception """ return gr.getEdge(graph, vertexa, vertexb)
def addLine(analyzer,length,origin,destination): arco=gr.getEdge(analyzer['connections'],origin,destination) if arco == None: gr.addEdge(analyzer['connections'],origin,destination,length)