Predicting the labels of an unknown graph via adaptive exploration