This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

VertexCount

VertexCount[g]
gives a count of the number of vertices in the graph g.
VertexCount
gives a count of the number of vertices that match the pattern patt.
Count the number of vertices:
Count the number of vertices that match a pattern:
Count the number of vertices:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
 
Count the number of vertices that match a pattern:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
VertexCount works with undirected graphs:
Directed graphs:
Use patterns to count a subset of vertices:
VertexCount works with large graphs:
Count the number of vertices on symbolic graph constructors:
The minimum number of edges in a connected graph with vertices is :
A path graph with vertices has exactly edges:
Construct a graph with a random vertex coloring:
Count the vertices with the color blue:
Highlight the vertex by the vertex degree:
Count the vertex with degree 3:
Number of vertices of CompleteGraph[n]:
VertexCount can be found using VertexList:
The number of vertices can be found from matrix representations:
The number of rows and columns of an adjacency matrix:
The number of rows of an incidence matrix:
The number of rows or columns of a Kirchhoff matrix:
The number of vertices of the line graph of graph g is equal to the number of edges of g:
Line graph of g:
New in 8