generate labelinfo using graph and topo order