In graph algorithm, sometimes you need to merge a large graph to a small graph based on specific sequence.