實(shí)例如下:
創(chuàng)新互聯(lián)建站從2013年成立,是專業(yè)互聯(lián)網(wǎng)技術(shù)服務(wù)公司,擁有項(xiàng)目做網(wǎng)站、成都網(wǎng)站建設(shè)網(wǎng)站策劃,項(xiàng)目實(shí)施與項(xiàng)目整合能力。我們以讓每一個(gè)夢(mèng)想脫穎而出為使命,1280元南縣做網(wǎng)站,已為上家服務(wù),為南縣各地企業(yè)和個(gè)人服務(wù),聯(lián)系電話:18982081108import numpy from numpy import * def dfs( v ): vis[v] = -1 flag = 0 for i in range(n): # print (a[v][i],'---', vis[i] ) if a[v][i] != 0 and vis[i] != -1: dfs(i) vis[i] = 1 else: pass if a[v][i] != 0 and vis[i] == -1: print ('Yes, there is A loop in this network\n') global swi swi = True exit() return # break else: pass print ('s = 0') return False global swi swi = False '''===裝載數(shù)據(jù)''' edges = numpy.loadtxt('9_nodes_with_r_edge_8_to_3.txt') # edges = [ int(i) for i in edges] bian = int(shape(edges)[0]) - 1 print (bian,'edges in the network \n') print (shape(edges),'\n') n = int( edges[0][1] ) c = int( edges[0][0] ) # n, c = input().split() # n = int(n) # c = int(c) a = [([0] * n) for i in range(n)] vis = [0] * c for i in range(1, c+1): s, t = edges[i][0:2] # print (s,' - ', t ) '''GO_OBO文件則 s, t 不需要 -1 ''' s = int(s) - 1 t = int(t) - 1 # s = int(s) # t = int(t) a[s][t] = 1 # print (a) # print (vis) dfs(0) # print (swi) if not swi: print('No loop, DAG - DAG - DAG')
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢(shì),專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場(chǎng)景需求。