上传者: 38724611
|
上传时间: 2022-01-16 21:29:58
|
文件大小: 33KB
|
文件类型: -
实例如下:
import 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