Basic guess and check enumeration
During the enumeration of seeds with clingo with pure reasoning, we can check the solutions on-the-fly and exclude bad solutions. This will enable to get non-subset-minimal but working solutions.
The attached script shows a very basic way to achieve this. The function check_seeds
can do anything, including calling cobra to check for the flux. If it returns False
the solution is excluded, and super-sets may be returned.
In principle, to make this approach efficient, we should think at how to generalize a bad solution: if there is no flux with a given set of seeds, can we add more constrains than just excluding that set? We can also mix with diversity heuristics of #9 (closed).
With enum_check = False
, we get:
$ python enum_check.py seed2lp/asp/seed-solving.lp instance_e_coli_core_rm_rxn_tgt_taf_max.lp
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c', 'M_xu5p__D_c']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_h2o_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_q8h2_c', 'M_succoa_c', 'M_xu5p__D_c']
12 ['M_adp_c', 'M_coa_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_xu5p__D_c']
12 ['M_13dpg_c', 'M_adp_c', 'M_coa_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8_c']
12 ['M_adp_c', 'M_coa_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8_c']
12 ['M_13dpg_c', 'M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8_c', 'M_succoa_c']
With enable_check = True
and check_seeds
which enforce seeds of length 13:
$ python enum_check.py seed2lp/asp/seed-solving.lp instance_e_coli_core_rm_rxn_tgt_taf_max.lp
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_lac__D_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_pi_c', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succ_c', 'M_succoa_c']
13 ['M_adp_c', 'M_amp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_lac__D_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_pi_c', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succ_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_o2_e', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_amp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_q8h2_c', 'M_ru5p__D_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_lac__D_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c', 'M_xu5p__D_c']