示例#1
0
def compact_call_undersamples(G_star, steps=None):
    glist = [ug2num(G_star)]
    lastgraph = G_star
    while True:
        g = increment_u(G_star, lastgraph)
        if ug2num(g) in glist:
            return glist
        glist.append(ug2num(g))
        lastgraph = g
    return glist
示例#2
0
def cc_undersamples(G_star, steps=1):
    glist = [ug2num(G_star)]
    lastgraph = G_star
    for i in xrange(steps):
        g = increment_u(G_star, lastgraph)
        n = ug2num(g)
        if n in glist:
            return []
        glist.append(n)
        lastgraph = g
    return glist[-1]
示例#3
0
def checkconflict_(Hnum, G_test, au=None):
    if not au:
        allundersamples = call_undersamples(G_test)
    else:
        allundersamples = au
    # Hnum = ug2num(H)
    for graph in allundersamples:
        gnum = ug2num(graph)
        if gnum[0] & Hnum[0] == gnum[0] and gnum[1] & Hnum[1] == gnum[1]:
            return False
    return True