Add weight attribute in merged graph