Initial merge_graph code.