def fully_connected(self):
if self.graph is None:
return False
for i in range(1, self.num_rooms):
try:
path = networkx.shortest_path_length(
self.graph, source=0, target=i,
)
except networkx.NetworkXNoPath:
print('Graph isnt fully connected! Regenerating.')
return False
return True
评论列表
文章目录