modify reorderGraph.m to handle the start index of graph is 0