Wolfram Technology Guide: Fully Automated Graph Layout  previous | next 
Add Labels to Graphs
Mathematica can automatically add labels of any form to graphs.
In[1]:=

Click for copyable input
GraphPlot[Table[i -> Mod[i^2, 20], {i, 40}], VertexLabeling -> True]
Out[1]=