ribolands/pathfinder.py
def guiding_edge_search(nodes, edges = None):
    """ Find all edges of the guiding neighborhood.

    Annoying case, cannot add pq at dpq = 8
     - p ..........((((.....((((.((.........)).)))).))))... 
     - q ...((((...)))).....((((.((.........)).))))........
     - i .(((......)))......((((.((.........)).))))........

    Args:
        edges (set, optional): Provide a set of edges. They will not be deleted!
    """
    if edges is None:
        edges = set()
    for p, q in combinations(nodes, 2):
        if (p, q) in edges:
            assert (q, p) in edges
            continue
        for i in nodes:
            if i == p or i == q:
                continue
            dpq = get_bpd_cache(p, q)
            dpi = get_bpd_cache(p, i)
            diq = get_bpd_cache(i, q)
            if max([dpi, diq]) < dpq:
            #if dpi + diq <= dpq:
                #print(f'Cannot add {p}, {q} at {dpq=} due to {i=} {dpi=} {diq=}.')
                break
            #dqp = get_bpd_i_cache(q, p)
            #dqi = get_bpd_i_cache(q, i)
            #dip = get_bpd_i_cache(i, p)
            #if max([dqi, dip]) < dqp:
            ##if dqi + dip <= dqp:
            #    #print(f'Cannot add {q}, {p} at {dqp=} due to {i=} {dqi=} {dip=}.')
            #    break

        else:
            edges.add((p, q))
            edges.add((q, p))
    return edges
 Find all edges of the guiding neighborhood.

    Annoying case, cannot add pq at dpq = 8
     - p ..........((((.....((((.((.........)).)))).))))... 
     - q ...((((...)))).....((((.((.........)).))))........
     - i .(((......)))......((((.((.........)).))))........

    Args:
        edges (set, optional): Provide a set of edges. They will not be deleted!
    
Find all edges of the guiding neighborhood.
Find all edges of the guiding neighborhood .
def guiding_edge_search(nodes, edges = None):
    if edges is None:
        edges = set()
    for p, q in combinations(nodes, 2):
        if (p, q) in edges:
            assert (q, p) in edges
            continue
        for i in nodes:
            if i == p or i == q:
                continue
            dpq = get_bpd_cache(p, q)
            dpi = get_bpd_cache(p, i)
            diq = get_bpd_cache(i, q)
            if max([dpi, diq]) < dpq:
                break
        else:
            edges.add((p, q))
            edges.add((q, p))
    return edges
def guiding_edge_search ( nodes , edges = None ) : if edges is None : edges = set ( ) for p , q in combinations ( nodes , 2 ) : if ( p , q ) in edges : assert ( q , p ) in edges continue for i in nodes : if i == p or i == q : continue dpq = get_bpd_cache ( p , q ) dpi = get_bpd_cache ( p , i ) diq = get_bpd_cache ( i , q ) if max ( [ dpi , diq ] ) < dpq : break else : edges . add ( ( p , q ) ) edges . add ( ( q , p ) ) return edges
Find all edges of the guiding neighborhood.
Find all edges of the guiding neighborhood .
""" Find all edges of the guiding neighborhood.

    Annoying case, cannot add pq at dpq = 8
     - p ..........((((.....((((.((.........)).)))).))))... 
     - q ...((((...)))).....((((.((.........)).))))........
     - i .(((......)))......((((.((.........)).))))........

    Args:
        edges (set, optional): Provide a set of edges. They will not be deleted!
    """ #if dpi + diq <= dpq: #print(f'Cannot add {p}, {q} at {dpq=} due to {i=} {dpi=} {diq=}.') #dqp = get_bpd_i_cache(q, p) #dqi = get_bpd_i_cache(q, i) #dip = get_bpd_i_cache(i, p) #if max([dqi, dip]) < dqp: ##if dqi + dip <= dqp: #    #print(f'Cannot add {q}, {p} at {dqp=} due to {i=} {dqi=} {dip=}.') #    break
nodes
edges
Provide a set of edges. They will not be deleted!
Provide a set of edges . They will not be deleted!