Social Network Analysis 
in Mathematica 9

Charles Pooh

Wolfram Research

charlesp@wolfram.com

(Row)

Social Network Analysis

Outlines of the Talk

Social Network Data

Centralities and Prestiges

Roles in Networks

Cohesive Groups and Community Detection

Assortativity Mixing and Clustering

Wolfram|Alpha Facebook Analysis

Social Network Data

Theoretical and Empirical Networks

Random Graphs

∘ BarabasiAlbertGraphDistribution

∘ WattsStrogatzGraphDistribution

Row[{RandomGraph[BarabasiAlbertGraphDistribution[100,2],ImageSize-> Medium],
g=RandomGraph[BarabasiAlbertGraphDistribution[10^4,2]];
Show[ListPlot[Tally[VertexDegree[g]],PlotRange->{{20,60},{0,20}}],Plot[1.3 10^5d^-3,{d,20,60},PlotStyle->Purple],ImageSize-> Medium]},Spacer[50]]

A network with few very highly connected nodes and many nodes with low degree (long-tailed degree distribution)

Importing Data

∘ Import [ref]

∘ Export [ref]

Empirical Data

ExampleData["NetworkGraph"]

Social Media Data — Facebook

Access to Facebook data

Friend network . Friend statistics . Posting activity …

Reference page [ref]

Examples

SocialMediaData["Facebook", "Friends"]

Social Media Data — Twitter

Access to Twitter data

Friend network . Follower network . Information network . Posting activity …

Reference Page [ref]

Examples

SocialMediaData["Twitter", "Followers"]

Centrality Measures and Roles

Centrality Measures and Roles

∘ DegreeCentrality . ClosenessCentrality . BetweennessCentrality . EigenvectorCentrality . KatzCentrality . PageRankCentrality . HITSCentrality . StatusCentrality . RadialityCentrality

TabView[{DegreeCentrality-> HighlightGraph[g,VertexList[g],VertexSize-> Thread[VertexList[g]->0.1+ Rescale[DegreeCentrality[g]]],GraphHighlightStyle->"Thick",EdgeStyle-> Thick],
EigenvectorCentrality-> HighlightGraph[g,VertexList[g],VertexSize-> Thread[VertexList[g]-> 0.1+Rescale[EigenvectorCentrality[g]]],GraphHighlightStyle->"Thick",EdgeStyle-> Thick],
ClosenessCentrality-> HighlightGraph[g,VertexList[g],VertexSize-> Thread[VertexList[g]-> 0.1+Rescale[ClosenessCentrality[g]]],GraphHighlightStyle->"Thick",EdgeStyle-> Thick],
BetweennessCentrality-> HighlightGraph[g,VertexList[g],VertexSize-> Thread[VertexList[g]-> 0.1+Rescale[BetweennessCentrality[g]]],GraphHighlightStyle->"Thick",EdgeStyle-> Thick],
StatusCentrality-> HighlightGraph[g,VertexList[g],VertexSize-> Thread[VertexList[g]-> 0.1+Rescale[StatusCentrality[g]]],GraphHighlightStyle->"Thick",EdgeStyle-> Thick],
RadialityCentrality-> HighlightGraph[g,VertexList[g],VertexSize-> Thread[VertexList[g]-> 0.1+Rescale[RadialityCentrality[g]]],GraphHighlightStyle->"Thick",EdgeStyle-> Thick]},ControlPlacement->Left ]

Roles

({{Connector, connects people who are in two different groups}, {"Gatekeeper", buffer between their group and other groups }, {"Broadcaster", conveys information from the group to the outside}, {"Coordinator", connects people within the same group}})

Cohesive Groups

Cliques

∘ FindClique . FindKClique . FindKClan . FindKClub . FindKPlex

TabView[{"Clique"-> HighlightGraph[g,Subgraph[g,FindClique[g]],GraphHighlightStyle->"Thick"],
"KClique"-> HighlightGraph[g,Subgraph[g,FindKClique[g,2]],GraphHighlightStyle->"Thick"],
"KClan"-> HighlightGraph[g,Subgraph[g,FindKClan[g,2]],GraphHighlightStyle->"Thick"],
"KPlex"-> HighlightGraph[g,Subgraph[g,FindKPlex[g,2]],GraphHighlightStyle->"Thick"]}]

Community Detection

A weighted network of wins in the National Hockey League during regular season 2010–2011. Group teams by conferences:

g=ExampleData[{"NetworkGraph","NationalHockeyLeague"}];

conferences=FindGraphCommunities[g]

CommunityGraphPlot[g, CommunityLabels->(Style[#,"Subsubsubsection"]&/@{"Division A", "Division B"})]

Assortativity Mixing and Clustering

Assortativity Mixing

The tendency to relate to people with similar characteristics (race, age, beliefs, …)

club=ExampleData[{"NetworkGraph","ZacharyKarateClub"}]

part=FindGraphPartition[club,{0.38,0.62}]

HighlightGraph[club,Subgraph[club,#]& /@ %]

N[GraphAssortativity[club,part]]

N[GraphAssortativity[club,part,"Normalized"->False]]

Clustering

∘ GlobalClusteringCoefficient . LocalClusteringCoefficient . MeanClusteringCoefficient

Facebook Analysis

Wolfram|Alpha Facebook Analysis

Mathematica Facebook Analysis

Thank You …