Motivated by a problem of targeted advertising in social networks, we introduce and study a new model of online learning on labeled graphs where the graph is initially unknown and the algorithm is free to choose which vertex to predict next. After observing that natural nonadaptive exploration/prediction strategies, like depth-first with majority vote, do not behave satisfactorily on simple binary labeled graphs, we introduce an adaptive strategy that performs well under the hypothesis that the vertices of the unknown graph (i.e., members of the social network) can be partitioned into a few well-separated clusters within which labels (i.e., members’ preferences) are roughly constant. Our algorithm is efficiently implementable and provably competitive against the best of these partitions.