http://cs224w.stanford.edu Nodes Nodes Network Adjacency matrix - - PowerPoint PPT Presentation

http cs224w stanford edu
SMART_READER_LITE
LIVE PREVIEW

http://cs224w.stanford.edu Nodes Nodes Network Adjacency matrix - - PowerPoint PPT Presentation

CS224W: Analysis of Networks Jure Leskovec, Stanford University http://cs224w.stanford.edu Nodes Nodes Network Adjacency matrix 11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 2 Non-overlapping


slide-1
SLIDE 1

CS224W: Analysis of Networks Jure Leskovec, Stanford University

http://cs224w.stanford.edu

slide-2
SLIDE 2

2

Network Adjacency matrix

Nodes Nodes

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-3
SLIDE 3

¡ Non-overlapping vs. overlapping communities

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 3

slide-4
SLIDE 4

¡ A node can belong to many social “circles”

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 4

[Palla et al., ‘05]

slide-5
SLIDE 5

5

High school Company Stanford (Squash) Stanford (Basketball)

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-6
SLIDE 6

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 6

slide-7
SLIDE 7

¡ Two nodes belong to the same community if they

can be connected through adjacent k-cliques:

§ k-clique:

§ Fully connected graph on k nodes

§ Adjacent k-cliques:

§ overlap in k-1 nodes

¡ k-clique community

§ Set of nodes that can be reached through a sequence of adjacent k-cliques

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 7

3-clique Adjacent 3-cliques

[Palla et al., ‘05]

Non-adjacent 3-cliques Two overlapping 3-clique communities

slide-8
SLIDE 8

¡ Two nodes belong to the same community if

they can be connected through adjacent k- cliques:

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 8

4-clique Adjacent 4-cliques Communities for k=4

[Palla et al., ‘05]

Non-adjacent 4-cliques

slide-9
SLIDE 9

¡ Clique Percolation Method:

§ Find maximal-cliques

§ Def: Clique is maximal if no superset is a clique

§ Clique overlap super-graph:

§ Each clique is a super-node § Connect two cliques if they

  • verlap in at least k-1 nodes

§ Communities:

§ Connected components of the clique overlap matrix

¡ How to set k?

§ Set k so that we get the “richest” (most widely distributed cluster sizes) community structure

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 9

A C D B A C D B Cliques Communities Set: k=3

slide-10
SLIDE 10

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 10

(1) Graph (2) Clique overlap matrix (3) Thresholded matrix at 3 (4) Communities (connected components)

¡ Start with graph ¡ Find maximal cliques ¡ Create clique overlap

matrix 𝐵

§ Rows/Cols are max- cliques, entry is number

  • f nodes in common

¡ Threshold the matrix at

value k-1

§ If 𝑏#$ < 𝑙 − 1 set 0

¡ Communities are the

connected components

  • f the thresholded

matrix

Cliques Cliques Overlap size

slide-11
SLIDE 11

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11

Communities in a “tiny” part of a phone call network of 4 million users [Palla et al., ‘07]

[Palla et al., ‘07]

slide-12
SLIDE 12

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 12

[Farkas et. al. 07]

slide-13
SLIDE 13

¡ No nice way, hard combinatorial problem ¡ Maximal clique: Clique that can’t be extended

§ {𝑏, 𝑐, 𝑑} is a clique but not maximal clique § {𝑏, 𝑐, 𝑑, 𝑒} is maximal clique

¡ Algorithm: Sketch

§ Start with a seed node § Expand the clique around the seed § Once the clique cannot be further expanded we found the maximal clique § Note:

§ This method will generate the same clique multiple times

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 13

slide-14
SLIDE 14

¡ Start with a seed vertex 𝒃 ¡ Goal: Find the max clique 𝑹 that 𝒃 belongs to

§ Observation:

§ If some 𝒚 belongs to 𝑹 then it is a neighbor of 𝒃

§ Why? If 𝒃, 𝒚 ∈ 𝑹 but edge (𝒃, 𝒚) does not exist, 𝑹 is not a clique!

¡ Recursive algorithm:

§ 𝑹 … current clique § 𝑺 … candidate vertices to expand the clique to

¡ Example: Start with 𝒃 and expand around it

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 14

Q= {a} {a,b} {a,b,c} bktrack {a,b,d} R= {b,c,d} {b,c,d} {c,d}ÇG(c)={} {c}ÇG(d)={} ÇG(b)={c,d} Steps of the recursive algorithm G(u)…neighbor set of u

slide-15
SLIDE 15

¡ Start with a seed vertex 𝒃 ¡ Goal: Find the max clique 𝑹 that 𝒃 belongs to

§ Observation:

§ If some 𝒚 belongs to 𝑹 then it is a neighbor of 𝒃

§ Why? If 𝒃, 𝒚 ∈ 𝑹 but edge (𝒃, 𝒚) does not exist, 𝑹 is not a clique!

¡ Recursive algorithm:

§ 𝑹 … current clique § 𝑺 … candidate vertices to expand the clique to

¡ Example: Start with 𝒃 and expand around it

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 15

Q= {a} {a,b} {a,b,c} bktrack {a,b,d} R= {b,c,d} {b,c,d} {d}ÇG(c)={} {c}ÇG(d)={} ÇG(b)={c,d} Steps of the recursive algorithm G(u)…neighbor set of u

slide-16
SLIDE 16

§ 𝑹 … current clique § 𝑺 … candidate vertices

¡ Expand(R,Q)

§ while R ≠ {}

§ p = vertex in R § Qp = Q È {p} § Rp = R Ç G(p) § if Rp ≠ {}: Expand(Rp,Qp) else: output Qp § R = R – {p}

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 16

slide-17
SLIDE 17

§ 𝑹 … current clique § 𝑺 … candidate vertices

¡ Expand(R,Q)

§ while R ≠ {}

§ p = vertex in R § Qp = Q È {p} § Rp = R Ç G(p) § if Rp ≠ {}: Expand(Rp,Qp) else: output Qp § R = R – {p}

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 17

Start: Expand(V, {}) R={a,…f}, Q={} p = {b} Qp = {b} Rp = {a,c,d} Expand(Rp, Q): R = {a,c,d}, Q={b} p = {a} Qp = {b,a} Rp = {d} Expand(Rp, Q): R = {d}, Q={b,a} p = {d} Qp = {b,a,d} Rp = {} : output {b,a,d} p = {c} Qp = {b,c} Rp = {d} Expand(Rp, Q): R = {d}, Q={b,c} p = {d} Qp = {b,c,d} Rp = {} : output {b,c,d}

slide-18
SLIDE 18

¡ How to prevent maximal cliques

from being generated multiple times?

§ Only output cliques that are lexicographically minimum

§ {𝒃, 𝒄, 𝒅} < {𝒄, 𝒃, 𝒅}

§ Even better: Only expand to the nodes higher in the lexicographical order

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 18

slide-19
SLIDE 19
slide-20
SLIDE 20

¡ How should we think about large scale

  • rganization of clusters in networks?

§ Finding: Community Structure

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 20

slide-21
SLIDE 21

¡ How should we think about large scale

  • rganization of clusters in networks?

§ Finding: Core-periphery structure

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 21

Nested Core-Periphery

slide-22
SLIDE 22

¡ How do we reconcile these two views?

(and still do community detection)

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 22

vs.

Community structure Core-periphery

slide-23
SLIDE 23

¡ How community-like is a set of nodes? ¡ A good cluster S has

§ Many edges internally § Few edges pointing outside

¡ What’s a good metric:

Conductance

Small conductance corresponds to good clusters Note: We are assuming |𝑇| < |𝑊|/2, ds degree of node s

23

S S’

å

Î

Ï Î Î =

S s s

d S j S i E j i S | } , ; ) , {( | ) ( f

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-24
SLIDE 24

¡ Define:

Network community profile (NCP) plot

Plot the score of best community of size k

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 24

Community size, log k log Φ(k)

k=5 k=7

[WWW ‘08]

k=10

(Note |S| < |V|/2)

slide-25
SLIDE 25

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 25

  • Run the favorite clustering method(s)
  • Each dot represents a cluster
  • For each size 𝑙 find “best” cluster (min Φ(k))

Cluster size, log k Cluster score, log Φ(k)

Spectral Graclus Metis

slide-26
SLIDE 26

¡ Meshes, grids, dense random graphs:

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 26

d-dimensional meshes California road network

11/30/17

[WWW ‘08]

slide-27
SLIDE 27

¡ Collaborations between scientists in networks

[Newman, 2005]

27

Community size, log k Conductance, log Φ(k)

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

[WWW ‘08]

Dips in the conductance graph correspond to the "good" clusters we can visually detect

slide-28
SLIDE 28

Natural hypothesis about NCP:

¡ NCP of real networks slopes

downward

¡ Slope of the NCP corresponds

to the “dimensionality“ of the network

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 28

What about large networks?

[Internet Mathematics ‘09]

slide-29
SLIDE 29

Typical example: General Relativity collaborations (n=4,158, m=13,422)

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 29

[Internet Mathematics ‘09]

slide-30
SLIDE 30

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 30

[Internet Mathematics ‘09]

  • - Rewired graph
  • - Real graph
slide-31
SLIDE 31

Φ(k), (score) k, (cluster size)

31

Better and better clusters Clusters get worse and worse Best cluster has ~100 nodes

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-32
SLIDE 32

¡ As clusters grow the number of edges

inside grows slower that the number crossing

32

Φ=2/10 = 0.2

Each node has twice as many children

Φ=1/7=0.14 Φ=8/20 = 0.4 Φ=64/92 = 0.69

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-33
SLIDE 33

¡ Empirically we note that best clusters

(corresponding to green nodes “whiskers”) are barely connected to the network

33

NCP plot

Þ Core-periphery structure

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-34
SLIDE 34

34

Nothing happens! Þ Nestedness of the core-periphery structure

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

Whiskers

slide-35
SLIDE 35

Nested Core-Periphery (jellyfish, octopus)

Whiskers are responsible for good communities

Denser and denser core

  • f the

network Core contains 60% nodes and 80% edges

35 11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-36
SLIDE 36

36

vs.

How do we reconcile these two views?

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-37
SLIDE 37

¡ Basic question: nodes u, v share k communities ¡ What’s the edge probability?

§ Look at networks with ground-truth communities

37

LiveJournal social network Amazon product network

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-38
SLIDE 38

¡ Edge density in the overlaps is higher!

38

Communities as “tiles”

“The more different foci (communities) that two individuals share, the more likely it is that they will be tied”

  • S. Feld, 1981

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-39
SLIDE 39

39 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

Communities as overlapping tiles

The densest part of the graph

slide-40
SLIDE 40

40

What does this mean?

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-41
SLIDE 41

41

Required

How do we detect communities if they overlap as tiles?

Present methods

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-42
SLIDE 42

¡ Generative model: How is a network

generated from community affiliations?

¡ Model parameters:

§ Nodes V, Communities C, Memberships M § Each community c has a single probability pc

42

Communities, C Nodes, V

Community Affiliation Network

Model

pA pB

Memberships, M

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-43
SLIDE 43

¡ Given parameters (V, C, M, {pc})

§ Nodes in community c connect to each other by flipping a coin with probability pc § Nodes that belong to multiple communities have multiple coin flips: Dense community overlaps

§ If they "miss" the first time, they get another chance through the next community"

43

Communities, C Nodes, V

Community Affiliation Network

Model

pA pB

Memberships, M

N

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

Note: If two nodes u and v have no communities in common, then p(u,v)=0. We resolve this by having a “background” community that every node is a member of.

slide-44
SLIDE 44

44

Model el Net etwork

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-45
SLIDE 45

¡ AGM can express a

variety of community structures: Non-overlapping, Overlapping, Nested

45

[icdm ‘12]

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-46
SLIDE 46

¡ Detecting communities with AGM:

46

C A B D E H F G

Given a Graph, find the Model

1) Affiliation graph M 2) Number of communities C 3) Parameters pc

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

slide-47
SLIDE 47

¡ “Relax” the AGM: Memberships have strengths

§ 𝑮𝒗𝑩: The membership strength of node 𝒗 to community 𝑩 (𝑮𝒗𝑩 = 𝟏: no membership)

47

𝑮𝒗𝑩 𝑮𝒙𝑪

[wsdm ‘13]

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-48
SLIDE 48

¡ Prob. of nodes linking is proportional to the

strengths of shared memberships: 𝑸 𝒗, 𝒘 = 𝟐 − 𝐟𝐲𝐪 (−𝑮𝒗 ⋅ 𝑮𝒘

𝑼)

¡ Now, given a network, we estimate 𝑮

48

¡ Non-negative matrix factorization:

§ Update 𝑮𝒗𝑫 for node 𝒗 while fixing the memberships of all other nodes § Updating takes linear time in the degree of 𝒗

[wsdm ‘13]

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-49
SLIDE 49

¡ Apply block coordinate gradient ascent

§ Step size: backtracking line search § Project 𝑮𝒗 back to a non-negative vector

¡ Pure gradient ascent is slow! However:

¡ By caching 𝑮𝒘 the gradient step takes linear time in the

degree of 𝒗

49

[wsdm ‘13]

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-50
SLIDE 50

¡ How well do inferred communities

correspond to ground-truth?

§ F1 score, Ω-index, Mutual Information

¡ We can rank algorithms based on their ability

to detect ground-truth

50

C A B D E H F G

Fit Communities! Evaluate

Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-51
SLIDE 51

¡ BigClam improves:

§ 79% over Link clustering § 48% over CPM § 15% over MMSB (while being orders of magnitude faster)

51 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-52
SLIDE 52

¡ Protein-Protein interaction networks:

Gene Ontology based quality of detected communities

52 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 11/30/17

slide-53
SLIDE 53
slide-54
SLIDE 54

¡ Some issues with community detection:

§ Many different formalizations of clustering

  • bjective functions

§ Objectives are NP-hard to optimize exactly § Methods can find clusters that are systematically “biased”

¡ Questions:

§ How well do algorithms optimize objectives? § What clusters do different methods find?

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 54

slide-55
SLIDE 55

¡ Single-criterion:

§ Modularity: m-E(m) § Edges cut: c

¡ Multi-criterion:

§ Conductance: c/(2m+c) § Expansion: c/n § Density: 1-m/n2 § CutRatio: c/n(N-n) § Normalized Cut: c/(2m+c) + c/2(M-m)+c § Flake-ODF: frac. of nodes with more than ½ edges pointing outside S

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 55

S

n: nodes in S m: edges in S c: edges pointing

  • utside S

[WWW ‘09]

slide-56
SLIDE 56

Many algorithms that implicitly or explicitly

  • ptimize objectives and extract communities:

¡ Heuristics:

§ Girvan-Newman, Modularity optimization: popular heuristics § Metis: multi-resolution heuristic [Karypis-Kumar ‘98]

¡ Theoretical approximation algorithms:

§ Spectral partitioning

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu 56

[WWW ‘09]

slide-57
SLIDE 57

LiveJournal

Spectral Metis

57 11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

[WWW ‘09]

slide-58
SLIDE 58

500 node communities from Spectral: 500 node communities from Metis:

58 11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

[WWW ‘09]

slide-59
SLIDE 59

¡ Metis gives sets with better

conductance

¡ Spectral gives tighter and

more well-rounded sets

59

Conductance of bounding cut

Spectral Disconnected Metis Connected Metis

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

[WWW ‘09]

Diameter of the cluster External / Internal conductance

Lower is good

slide-60
SLIDE 60

60

¡ All qualitatively

similar

¡ Observations:

§ Conductance, Expansion, Norm- cut, Cut-ratio are similar § Flake-ODF prefers larger clusters § Density is bad § Cut-ratio has high variance

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

[WWW ‘09]

slide-61
SLIDE 61

61

Observations:

¡ All measures are

monotonic

¡ Modularity

§ prefers large clusters § Ignores small clusters

11/30/17 Jure Leskovec, Stanford CS224W: Analysis of Networks, http://cs224w.stanford.edu

[WWW ‘09]