Skip to content

Commit

Permalink
test scc+att
Browse files Browse the repository at this point in the history
  • Loading branch information
kyuhyongpark committed Dec 20, 2023
1 parent fddd0e3 commit ea15298
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
37 changes: 37 additions & 0 deletions benchmark/bench_sd_attractors_scc+att.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import sys
sys.path.append("..")

import balm

from biodivine_aeon import BooleanNetwork
from balm.SuccessionDiagram import SuccessionDiagram
from balm._sd_algorithms.expand_source_SCCs import expand_source_SCCs

# Print progress and succession diagram size.
balm.SuccessionDiagram.DEBUG = True

NODE_LIMIT = 1_000_000
DEPTH_LIMIT = 10_000

# This is unfortunately necessary for PyEDA Boolean expression parser (for now).
sys.setrecursionlimit(150000)

bn = BooleanNetwork.from_file(sys.argv[1])
bn = bn.infer_regulatory_graph()

# Compute the succession diagram.
sd = SuccessionDiagram(bn)
fully_expanded = expand_source_SCCs(sd, SuccessionDiagram.expand_attractor_seeds)
assert fully_expanded

attractor_count = 0
motif_avoidant_count = 0

for node in sd.node_ids():
attr = sd.node_attractor_seeds(node, compute=True)
attractor_count += len(attr)
if not sd.node_is_minimal(node):
motif_avoidant_count += len(attr)

print("nodes, attractors, motif-avoidant")
print(f"{len(sd)}, {attractor_count}, {motif_avoidant_count}")
12 changes: 6 additions & 6 deletions benchmark/bench_sd_attractors_scc.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sys
sys.path.append(".")
sys.path.append("..")

import balm

from biodivine_aeon import BooleanNetwork
from nfvsmotifs.SuccessionDiagram import SuccessionDiagram
from nfvsmotifs._sd_algorithms.expand_source_SCCs import expand_source_SCCs
import sys
import nfvsmotifs
from balm.SuccessionDiagram import SuccessionDiagram
from balm._sd_algorithms.expand_source_SCCs import expand_source_SCCs

# Print progress and succession diagram size.
nfvsmotifs.SuccessionDiagram.DEBUG = True
balm.SuccessionDiagram.DEBUG = True

NODE_LIMIT = 1_000_000
DEPTH_LIMIT = 10_000
Expand Down

0 comments on commit ea15298

Please sign in to comment.