# Vertex Labeling on a generated graph.

I have a graph that I generated using upper half-plane. The graph will become bigger as I increase the iteration. For example, at first iteration, this is the graph that is generated.

And this is the graph generated at tenth iteration.

So, my question is how can I denote all the vertex in the graph in integer form? I have try using Show[SetProperty[G, VertexLabels -> "Name"], PlotRange -> All] .

I have also used the replace method by replacing the vertex coordinates to an integer. But I can only do that if the graph size is small. What can I do if the graph size is large?

Example:

g = NearestNeighborGraph[RandomReal[1, {10, 2}], VertexLabels -> "Name"]


IndexGraph[g]


If you only want to change how the vertices are labelled in the visualization, but you do not want to change the names that you use to refer to them in your program, then simply use the option

VertexLabels -> "Index"

• It works! Thank you so much @Szabolcs. – nasha amalina Feb 19 '18 at 14:45