Skip to content

Commit 85eb8e2

Browse files
committed
Solved bug for v2
1 parent bde57eb commit 85eb8e2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

exact_mif_v2.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,13 @@ def get_mif_len(G, F, active_v):
146146
return res
147147

148148
sg_F = nx.subgraph(G, F)
149+
# Verify is F is acyclic
150+
if len(sg_F.nodes) > 0 and not nx.is_forest(sg_F):
151+
return 0
152+
149153
new_G = G.copy()
150154
new_F = set(F)
151-
# Verify is F is acyclic?
155+
152156
if (
153157
len(sg_F.edges) != 0
154158
): # If F is not independent (if not every component of G[F] is an isolated vertex)

0 commit comments

Comments
 (0)