merge graph functions