Finding backdoor sets can take unpredictable, and extreme, amounts of time for large graphs
Describe the bug When used in tests on graphs with 50 or greater nodes, attempts to calculate even the maximal backdoor adjustment sets can take either seconds, or hours -- or perhaps, have stopped working -- and it's unclear which has happened, or when the calculation might terminate.
Steps to reproduce the behavior Normal calls of the form:
ident_eff = AutoIdentifier(
estimand_type=EstimandType.NONPARAMETRIC_ATE,
backdoor_adjustment=BackdoorAdjustment.BACKDOOR_DEFAULT # *OR* BACKDOOR_MAX
)
eff = ident_eff.identify_effect(
graph=g,
action_nodes="T",
outcome_nodes="Y",
observed_nodes=list(g.nodes)
)have been tested over a range of graphs, and -- specifically when the graph is large, and path between treatment and outcome is long -- can take hours of time to run (or perhaps longer; I had to stop it manually). The only option at the moment is to choose to set a timeout trigger, and treat this as an error.
Expected behavior Ideally, the function would:
- Provide an estimate of the runtime (nice, but not critical)
- Have a fuse that timed out after a given period (again nice, but not critical)
- Either, after a given time amount of time, the function gives up the optimized search and defaults to a foolproof fallback method**, ex. the full Markov blanket of the mediating paths -- something crude, but correct. My impression is that BACKDOOR_MAX is supposed to be this simple default, but it also hangs at a certain point, suggesting that whatever it's calculating is not trivial. Or, there is simply a different method available that gives a fast foolproof answer. (My impression is that such a thing should exist.)
Version information:
- DoWhy version 1.4
Additional context My impression is that there should be some trivial set such as the parents of the treatment, or the parents of the treatment and outcome, or the Markov blanket of all variables between T and Y, that provide a functional, if potentially excessive, adjustment set. However given the amount of time needed to calculate even BACKDOOR_MAX at sufficient size, it's clear this isn't what's happening. I would write my own fallback method, but I'm not certain what it should be. (I'm considering the three listed above.)
Source: py-why/dowhy