Enumeration with diversity
When enumerating the first K seeds, we observe that they tend to be very close to each other. We can drive clingo towards more diverse solutions using multi-shot solving. The attached script shows a basic way of doing so.
By setting enable_diverse = False
and enumerating 10 solutions of the ecoli core instance, we get the following solutions:
$ python enum_diverse.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_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_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_c', 'M_q8_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_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_e', 'M_q8_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_c', 'M_q8_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_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8_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_q8_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_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_h2o_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c']
intersection of solutions 9
union of solutions 17
Setting enable_diversity = True
:
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_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_e', 'M_q8_c', 'M_ru5p__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_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_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_icit_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_cit_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']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_h_c', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c']
13 ['M_adp_c', 'M_fdp_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_s7p_c', 'M_succoa_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_q8h2_c', 'M_succoa_c']
12 ['M_adp_c', 'M_fru_e', 'M_fum_e', 'M_glc__D_e', 'M_gln__L_e', 'M_h_e', 'M_mal__L_e', 'M_nadh_c', 'M_nadp_c', 'M_o2_c', 'M_q8h2_c', 'M_succoa_c']
intersection of solutions 8
union of solutions 25
By default, forget_clues=100
which means the script will only avoid the latest found solutions. We can add randomness by decreasing this number, and combine it with other mechanisms to remember which seeds to try to avoid, but from first experiments, it doesn't change much the results on this case.