support empty graph