def subtree_BMG(filename, scenario):
    """Write the (subgraph of) BMG."""
    with open(filename, 'w') as f:
        begin = True
        for u, v in scenario.BMG_subtrees.edges:
            if begin:
                f.write(str(u) + '\t' + str(v))
                begin = False
            else:
                f.write('\n' + str(u) + '\t' + str(v))
