(graph, visited)
return lightest_edge
Return the lightest edge in graph going from a visited node to an unvisited one.
    
    @type  graph: graph
    @param graph: Graph.

    @type  visited: list
    @param visited: List of nodes.

    @rtype:  tuple
    @return: Lightest edge in graph going from a visited node to an unvisited one.
Return the lightest edge in graph going from a visited node to an unvisited one.
    
    @type  graph: graph
    @param graph: Graph.
Return the lightest edge in graph going from a visited node to an unvisited one . @type graph : graph @param graph : Graph .
def _lightest_edge(graph, visited):
    """
    Return the lightest edge in graph going from a visited node to an unvisited one.
    
    @type  graph: graph
    @param graph: Graph.

    @type  visited: list
    @param visited: List of nodes.

    @rtype:  tuple
    @return: Lightest edge in graph going from a visited node to an unvisited one.
    """
    lightest_edge = None
    weight = None
    for each in visited:
        for other in graph[each]:
            if (other not in visited):
                w = graph.edge_weight((each, other))
                if (weight is None or w < weight or weight < 0):
                    lightest_edge = (each, other)
                    weight = w
    return lightest_edge
def _lightest_edge ( graph , visited ) : lightest_edge = None weight = None for each in visited : for other in graph [ each ] : if ( other not in visited ) : w = graph . edge_weight ( ( each , other ) ) if ( weight is None or w < weight or weight < 0 ) : lightest_edge = ( each , other ) weight = w return lightest_edge