Skip to content

Commit

Permalink
Allow cycles for input directed graph.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaydu1 committed Apr 20, 2024
1 parent af881b0 commit bb071f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions VITAE/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ def build_milestone_net(self, subgraph, init_node: int):
for edge in list(subgraph.edges):
if edge[0]==init_node:
dist = 1
elif edge[1]==init_node:
paths_0 = nx.all_simple_paths(subgraph, source=init_node, target=edge[0])
dist = - (np.max([len(p) for p in paths_1]) - 1)
else:
paths_0 = nx.all_simple_paths(subgraph, source=init_node, target=edge[0])
paths_1 = nx.all_simple_paths(subgraph, source=init_node, target=edge[1])
Expand Down

0 comments on commit bb071f8

Please sign in to comment.