DegreeCentrality

DegreeCentrality[g]
gives a list of vertex degrees for the vertices in the underlying simple graph of g.

DegreeCentrality[g, "In"]
gives a list of vertex in-degrees.

DegreeCentrality[g, "Out"]
gives a list of vertex out-degrees.

DetailsDetails

  • DegreeCentrality will give high centralities to vertices that have high vertex degrees.
  • The vertex degree for a vertex is the number of edges incident to .
  • For a directed graph, the in-degree is the number of incoming edges and the out-degree is the number of outgoing edges.
  • For an undirected graph, in-degree and out-degree coincide.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Compute degree centralities:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Highlight:

In[3]:=
Click for copyable input
Out[3]=

Rank vertices. Highest-ranked vertices have the most connections to other vertices:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=
New in 8
New to Mathematica? Find your learning path »
Have a question? Ask support »