Skip to content

Commit e742f84

Browse files
Add test3 to evaluate cyclic graphs and their properties
1 parent 2640d5a commit e742f84

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

examples/condensation.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,23 @@ def test2():
9090
print(f"Incompatible sequences: {incompatible_sequences}")
9191
assert len(incompatible_sequences) == 3
9292

93+
def test3():
94+
graph = fp.graphutils.read_graphs("tests/cyclic_graphs/gt4.kmer15.(0.10000).V1096.E1622.mincyc100.e1.0.graph")[0]
95+
print("graph id", graph.graph["id"])
96+
stDiGraph = fp.stDiGraph(graph)
97+
print("Graph width", stDiGraph.get_width())
98+
print("Is acyclic", nx.is_directed_acyclic_graph(graph))
99+
print("get_number_of_nontrivial_SCCs", stDiGraph.get_number_of_nontrivial_SCCs())
100+
print("get_size_of_largest_SCC", stDiGraph.get_size_of_largest_SCC())
101+
93102
def main():
94103
test1()
95104
test2()
105+
test3()
106+
107+
108+
109+
96110

97111
if __name__ == "__main__":
98112
# Configure logging

0 commit comments

Comments
 (0)