runtime2.append(res2[1]) hop2.append(res2[2]) max2.append(res2[3]) mean2.append(res2[4]) median2.append(res2[5]) res4 = function4.function4(G, source, dstlist3, 5) cost4.append(res4[0]) runtime4.append(res4[1]) hop4.append(res4[2]) max4.append(res4[3]) mean4.append(res4[4]) median4.append(res4[5]) rpoint = pickle.load(open("save.p", "rb")) res5 = functiongpim.functiongpim(G, source, dstlist4, rpoint) cost5.append(res5[0]) runtime5.append(res5[1]) hop5.append(res5[2]) max5.append(res5[3]) mean5.append(res5[4]) median5.append(res5[5]) res6 = functionpim.functionpim(G, source, dstlist3) cost6.append(res6[0]) runtime6.append(res6[1]) hop6.append(res6[2]) max6.append(res6[3]) mean6.append(res6[4]) median6.append(res6[5])
M=nx.Graph() data = [] f = open('/home/sowrabh/Desktop/jellyfish_topo.data', 'r') for line in f.readlines(): vector = line.split() x1=int(vector[0]) if len(vector)<3: break x2=int(vector[1]) w=float(vector[2]) M.add_node(x1) M.add_node(x2) M.add_edge(x1,x2,weight=w) nodes=M.nodes() dstlist=[] #r= random.sample(nodes,43) for i in range(1,45): dstlist.append(i) # create destination list source=1 if source in dstlist: dstlist.remove(source) dstlist2=list(dstlist) dstlist3=list(dstlist) hopcount2=function2fast(M,49,dstlist2) print "____________________________________________________________________________________ " hopcount1=functiongpim(M,49,dstlist) print "_____________________________________________________________________________________" hopcount3=functionpim(M,49,dstlist3)
runtime2.append(res2[1]) hop2.append(res2[2]) max2.append(res2[3]) mean2.append(res2[4]) median2.append(res2[5]) res4=function4.function4(G,source,dstlist3,5) cost4.append(res4[0]) runtime4.append(res4[1]) hop4.append(res4[2]) max4.append(res4[3]) mean4.append(res4[4]) median4.append(res4[5]) rpoint = pickle.load( open( "save.p", "rb" ) ) res5=functiongpim.functiongpim(G,source,dstlist4,rpoint) cost5.append(res5[0]) runtime5.append(res5[1]) hop5.append(res5[2]) max5.append(res5[3]) mean5.append(res5[4]) median5.append(res5[5]) res6=functionpim.functionpim(G,source,dstlist3) cost6.append(res6[0]) runtime6.append(res6[1]) hop6.append(res6[2]) max6.append(res6[3]) mean6.append(res6[4]) median6.append(res6[5])
M = nx.Graph() data = [] f = open('/home/sowrabh/Desktop/jellyfish_topo.data', 'r') for line in f.readlines(): vector = line.split() x1 = int(vector[0]) if len(vector) < 3: break x2 = int(vector[1]) w = float(vector[2]) M.add_node(x1) M.add_node(x2) M.add_edge(x1, x2, weight=w) nodes = M.nodes() dstlist = [] #r= random.sample(nodes,43) for i in range(1, 45): dstlist.append(i) # create destination list source = 1 if source in dstlist: dstlist.remove(source) dstlist2 = list(dstlist) dstlist3 = list(dstlist) hopcount2 = function2fast(M, 49, dstlist2) print "____________________________________________________________________________________ " hopcount1 = functiongpim(M, 49, dstlist) print "_____________________________________________________________________________________" hopcount3 = functionpim(M, 49, dstlist3)