amazing, tutorial

277
Algorithmic Techniques for Modeling and Mining Large Graphs (AMAzING) Alan Frieze 1 Aristides Gionis 2 Charalampos E. Tsourakakis 2 1 Carnegie Mellon University 2 Aalto University Tutorial website: http://www.math.cmu.edu/ ~ ctsourak/kdd13.html

Upload: charalampos-tsourakakis

Post on 20-Mar-2016

236 views

Category:

Documents


0 download

DESCRIPTION

KDD'13, ECML-PKDD'13

TRANSCRIPT

Page 1: Amazing, tutorial

Algorithmic Techniques for Modeling and MiningLarge Graphs (AMAzING)

Alan Frieze 1 Aristides Gionis 2

Charalampos E. Tsourakakis 2

1Carnegie Mellon University

2Aalto University

Tutorial website:http://www.math.cmu.edu/~ctsourak/kdd13.html

Page 2: Amazing, tutorial

Introduction to graphs and networks

Page 3: Amazing, tutorial

Graphs: a simple model

• entities – set of vertices

• pairwise relations among vertices– set of edges

• can add directions, weights,. . .

• graphs can be used to model many realdatasets• people who are friends• computers that are interconnected• web pages that point to each other• proteins that interact

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 3 / 277

Page 4: Amazing, tutorial

Graph theory

• graph theory started in the 18thcentury, with Leonhard Euler• the problem of Konigsberg bridges• since then, graphs have been studied

extensively

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 4 / 277

Page 5: Amazing, tutorial

Analysis of graph datasets in the past

• graphs datasets have been studied in the paste.g., networks of highways, social networks• usually these datasets were small• visual inspection can reveal a lot of information

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 5 / 277

Page 6: Amazing, tutorial

Analysis of graph datasets now

• more and larger networks appear• products of technological advancement

• e.g., internet, web

• result of our ability to collect more, better-quality, andmore complex data• e.g., gene regulatory networks

• networks of thousands, millions, or billions of nodes• impossible to visualize

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 6 / 277

Page 7: Amazing, tutorial

The internet map

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 7 / 277

Page 8: Amazing, tutorial

Types of networks

• social networks

• knowledge and information networks

• technology networks

• biological networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 8 / 277

Page 9: Amazing, tutorial

Social networks

• links denote a social interaction• networks of acquaintances• collaboration networks

• actor networks• co-authorship networks• director networks

• phone-call networks• e-mail networks• IM networks• sexual networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 9 / 277

Page 10: Amazing, tutorial

Knowledge and information networks

• nodes store information, linksassociate information• citation network (directed

acyclic)• the web (directed)• peer-to-peer networks• word networks• networks of trust• software graphs• bluetooth networks• home page/blog networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 10 / 277

Page 11: Amazing, tutorial

Technological networks

• networks built for distribution of a commodity• the internet, power grids, telephone networks• airline networks, transportation networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 11 / 277

Page 12: Amazing, tutorial

US power grid

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 12 / 277

Page 13: Amazing, tutorial

Biological networks

• biological systems represented as networks• protein-protein interaction networks• gene regulation networks• gene co-expression networks• metabolic pathways• the food web• neural networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 13 / 277

Page 14: Amazing, tutorial

Photo-sharing site

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 14 / 277

Page 15: Amazing, tutorial

What is the underlying graph?

• nodes: photos, tags, users, groups, albums, sets,collections, geo, query, . . .

• edges: upload, belong, tag, create, join, contact, friend,family, comment, fave, search, click, . . .

• also many interesting induced graphs• tag graph: based on photos• tag graph: based on users• user graph: based on favorites• user graph: based on groups

• which graph to pick — not an easy choice

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 15 / 277

Page 16: Amazing, tutorial

Recurring theme

• social media, user-generated content

• user interaction is composed by many atomic actions• post, comment, like, mark, join, comment, fave,

thumps-up, . . .• generates all kind of interesting graphs to mine

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 16 / 277

Page 17: Amazing, tutorial

Network science

• the world is full with networks

• what do we do with them?• understand their topology and measure their properties• study their evolution and dynamics• create realistic models• create algorithms that make use of the network structure

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 17 / 277

Page 18: Amazing, tutorial

Outline

• introduction and graphs and networks

• random graphs as models of real-world networks

• properties of real-world networks

• Erdos-Renyi graphs

• models of real-world networks

• applications of random graphs

• algorithm design for large-scale networks

• graph partitioning and community detection

• dense subgraphs

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 18 / 277

Page 19: Amazing, tutorial

Properties of real-world networks

Page 20: Amazing, tutorial

Properties of real-world networks

diverse collections of graphs arising from different phenomena

are there typical patterns?

• static networks

1 heavy tails2 clustering coefficients3 communities4 small diameters

• time-evolving networks

1 densification2 shrinking diameters

• web graph

1 bow-tie structure2 bipartite cliques

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 20 / 277

Page 21: Amazing, tutorial

Heavy tailsWhat do the proteins in our bodies, the Internet, acool collection of atoms and sexual networks have incommon? One man thinks he has the answer and itis going to transform the way we view the world.

Scientist 2002

Albert-Laszlo Barabasi

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 21 / 277

Page 22: Amazing, tutorial

Degree distribution

• Ck = number of vertices with degree k

• problem : find the probability distribution that fits bestthe observed data

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 22 / 277

Page 23: Amazing, tutorial

Power-law degree distribution

• Ck = number of vertices with degree k , then

Ck = ck−γ

with γ > 1, or

ln Ck = ln c − γ ln k

• plotting ln Ck versus ln k gives a straight line withslope −γ

• heavy-tail distribution : there is a non-negligible fractionof nodes that has very high degree (hubs)

• scale free : average is not informative

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 23 / 277

Page 24: Amazing, tutorial

Power-law degree distribution

power-laws in a wide variety of networks ([Newman, 2003])sheer contrast with Erdos-Renyi random graphs

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 24 / 277

Page 25: Amazing, tutorial

Power-law degree distribution

do the degrees follow a power-law distribution?

three problems with the initial studies

• graphs generated with traceroute sampling, whichproduces power-law distributions, even for regular graphs[Lakhina et al., 2003].

• methodological flaws in determining the exponentsee [Clauset et al., 2009] for a proper methodology

• other distributions could potentially fit the data betterbut were not considered, e.g., lognormal, double Pareto,lognormal

disclaimer: we will be referring to these distributions asheavy-tailed, avoiding a specific characterization

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 25 / 277

Page 26: Amazing, tutorial

Power-law degree distribution

• frequently, we hear about “scale-free networks”correct term is networks with scale-free degreedistribution

all networks above have the same degree sequence butstructurally are very different (source [Li et al., 2005])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 26 / 277

Page 27: Amazing, tutorial

Maximum degree

• for random graphs, the maximum degree is highlyconcentrated around the average degree z

• for power-law graphs

dmax ≈ n1/(α−1)

• hand-waving argument: solve n Pr[X ≥ d ] = Θ(1)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 27 / 277

Page 28: Amazing, tutorial

Heavy tails, eigenvalues

log-log plot of eigenvalues of the Internet graph indecreasing order

again a power law emerges [Faloutsos et al., 1999]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 28 / 277

Page 29: Amazing, tutorial

Heavy tails, triangles

• triangle distribution in flickr

• figure shows the count of nodes with k triangles vs. k inlog-log scale

• again, heavy tails emerge [Tsourakakis, 2008]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 29 / 277

Page 30: Amazing, tutorial

Clustering coefficients

• intuitively a subset of vertices that are more connected toeach other than to other vertices in the graph

• a proposed measure is the graph transitivity

T (G ) =3× number of triangles in the network

number of connected triples of vertices

• captures “transitivity of clustering”

• if u is connected to v andv is connected to w , it is also likely thatu is connected to w

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 30 / 277

Page 31: Amazing, tutorial

Clustering coefficients

• alternative definition

• local clustering coefficient

Ci =Number of triangles connected to vertex i

Number of triples centered at vertex i

• global clustering coefficient

C (G ) =1

n

∑i

Ci

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 31 / 277

Page 32: Amazing, tutorial

Community structureloose definition of community: a set of vertices denselyconnected to each other and sparsely connected to the rest ofthe graph

artificial communities:http://projects.skewed.de/graph-tool/

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 32 / 277

Page 33: Amazing, tutorial

Community structure

[Leskovec et al., 2009]

• study community structure in an extensive collection ofreal-world networks

• authors introduce the network community profile plot

• it characterizes the best possible community over a rangeof scales

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 33 / 277

Page 34: Amazing, tutorial

Community structure

dolphins network and its NCP(source [Leskovec et al., 2009])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 34 / 277

Page 35: Amazing, tutorial

Community structure

• do large-scale real-world networks have this nicestructure? NO!

NCP of a DBLP graph (source [Leskovec et al., 2009])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 35 / 277

Page 36: Amazing, tutorial

Community structure

important findings of [Leskovec et al., 2009]

1. up to a certain size k (k ∼ 100 vertices) there exist goodcuts

- as the size increases so does the quality of the community

2. at the size k we observe the best possible community

- such communities are typically connected to theremainder with a single edge

3. above the size k the community quality decreases

- this is because they blend in and gradually disappear

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 36 / 277

Page 37: Amazing, tutorial

Small-world phenomena

small worlds : graphs with short paths

• Stanley Milgram (1933-1984)“The man who shocked the world”

• obedience to authority (1963)

• small-World experiment (1967)

• we live in a small-world

• for criticism on the small-world experiment, see “Could ItBe a Big World After All? What the Milgram Papers inthe Yale Archives Reveal About the Original Small WorldStudy” by Judith Kleinfeld

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 37 / 277

Page 38: Amazing, tutorial

Small-world experiments

• letters were handed out to people in Nebraska to be sentto a target in Boston

• people were instructed to pass on the letters to someonethey knew on first-name basis

• the letters that reached the destination (64 / 296)followed paths of length around 6

• Six degrees of separation : (play of John Guare)

• also:• the Kevin Bacon game• the Erdos number

• small-World project:http://smallworld.columbia.edu/index.html

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 38 / 277

Page 39: Amazing, tutorial

Small diameter

proposed measures

• diameter : largest shortest-path over all pairs.

• dffective diameter : upper bound of the shortest path of90% of the pairs of vertices.

• average shortest path : average of the shortest paths overall pairs of vertices.

• characteristic path length : median of the shortest pathsover all pairs of vertices.

• hop-plots : plot of |Nh(u)|, the number of neighbors of uat distance at most h, as a function of h[Faloutsos et al., 1999].

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 39 / 277

Page 40: Amazing, tutorial

Other properties

• degree correlations, assortativity

• distribution of size of connected components

• resilience

• distribution of motifs

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 40 / 277

Page 41: Amazing, tutorial

Time-evolving networks

J. Leskovec J. Kleinberg C. Faloutsos

[Leskovec et al., 2005b]

• densification power law:

|Et | ∝ |Vt |α 1 ≤ α ≤ 2

• shrinking diameters: diameter is shrinking over time.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 41 / 277

Page 42: Amazing, tutorial

Web graph

• the Web graph is a particularly important real-worldnetwork

Few events in the history of computing havewrought as profound an influence on society asthe advent and growth of the World Wide Web

[Kleinberg et al., 1999a]

• vertices correspond to static web pages

• directed edge (i , j) models a link from page i to page j

• will discuss two structural properties of the web graph:

1. the bow-tie structure [Broder et al., 2000]2. abundance of bipartite cliques

[Kleinberg et al., 1999a, Kumar et al., 2000]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 42 / 277

Page 43: Amazing, tutorial

Web is a bow-tie

(source [Broder et al., 2000])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 43 / 277

Page 44: Amazing, tutorial

Bipartite subgraphs

• websites that are part of the same community frequentlydo not reference one another

(competitive reasons, disagreements, ignorance)[Kumar et al., 1999].

• similar websites are co-cited

• therefore, web communities are characterized bydense directed bipartite subgraphs

(source [Kleinberg et al., 1999a])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 44 / 277

Page 45: Amazing, tutorial

Erdos-Renyi graphs

Page 46: Amazing, tutorial

Random graphs

• a random graph is a set of graphs together with aprobability distribution on that set

• example

1 2

3

1

2

32

3

1

Probability 13

Probability 13

Probability 13

a random graph on {1, 2, 3} with 2 edges with theuniform distribution

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 46 / 277

Page 47: Amazing, tutorial

Random graphs

• Erdos-Renyi (or Gilbert-Erdos-Renyi ) random graphmodel

Paul Erdos Alfred Renyi1913 – 1996 1921 – 1970

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 47 / 277

Page 48: Amazing, tutorial

Random graphs

• the G (n, p) model:

• n : the number of vertices

• 0 ≤ p ≤ 1 : probability

• for each pair (u, v), independently generate the edge(u, v) with probability p

• G (n, p) a family of graphs, in which a graph with m

edges appears with probability pm(1− p)(n2)−m

• the G (n,m) model: related, but not identical

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 48 / 277

Page 49: Amazing, tutorial

Properties of random graphs

• a property P holds almost surely/with high probability(whp → 1− o(1)) if

limn→∞

Pr[G has P] = 1

• which properties hold as p increases?

• threshold phenomena : many properties appear suddenly

• there exist a probability pc such that

for p < pc the property does not hold a.s.

for p > pc the property holds a.s.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 49 / 277

Page 50: Amazing, tutorial

The giant component

• let z = np be the average degree

• if z < 1 the largest component has size O(log n) a.s.

• if z > 1 the largest component has size Θ(n) a.s.;the second largest component has size O(log n) a.s.

• if z = ω(log n) the graph is connected a.s.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 50 / 277

Page 51: Amazing, tutorial

Phase transition

• if z = 1 there is a phase transition

• the largest component has size O(n2/3)

• the sizes of the components follow a power-law

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 51 / 277

Page 52: Amazing, tutorial

Phase transition — proof sketch

Michael Krivelevich Benny Sudakov

the phase transition in random graphs — a simple proof

The Erdos-Renyi paper, which launched the moderntheory of random graphs, has had enormousinfluence on the development of the field and isgenerally considered to be a single most importantpaper in Probabilistic Combinatorics, if not in all ofCombinatorics

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 52 / 277

Page 53: Amazing, tutorial

Phase transition — proof sketch[Krivelevich and Sudakov, 2013] give a simple proof for thetransition based on running depth first search (DFS) on G

• S : vertices whose exploration is complete

• T : unvisited vertices

• U = V − (S ∪ T ) : vertices in stack

observation:

• the set U always spans a path

- when a vertex u is added in U , it happens because u is aneighbor of the last vertex v in U ; thus, u augments thepath spanned by U , of which v is the last vertex

• epoch is the period of time between two consecutiveemptyings of U

- each epoch corresponds to a connected component

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 53 / 277

Page 54: Amazing, tutorial

Phase transition — proof sketch

Lemma

Let ε > 0 be a small enough constant and let N =(n2

)Consider the sequence X = (Xi)

Ni=1 of i.i.d. Bernoulli random

variables with parameter p

1 let p = 1−εn

and k = 7ε2

ln n

then whp there is no interval of length kn in [N], inwhich at least k of the random variables Xi take value 1

2 let p = 1+εn

and N0 = εn2

2

then whp∣∣∣∑N0

i=1 Xi − ε(1+ε)n2

∣∣∣ ≤ n2/3

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 54 / 277

Page 55: Amazing, tutorial

Phase transition — useful tools

Lemma (Union bound)

For any events A1, . . . ,An, Pr [A1 ∪ . . .An] ≤∑n

i=1Pr [Ai ]

Lemma (Chebyshev’s inequality)

Let X be a random variable with finite expectation E [X ] andfinite non-zero variance Var [X ]. Then for any t > 0,

Pr [|X − E [X ] | ≥ t] ≤ Var [X ]

t2

Lemma (Chernoff bound, upper tail)

Let 0 ≤ ε ≤ 1. Then,

Pr [Bin(n, p) ≥ (1 + ε)np] ≤ e−ε2

3np

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 55 / 277

Page 56: Amazing, tutorial

Phase transition — proof sketchProof.• fix interval I of length kn in [N], N =

(n2

)then

∑i∈I Xi ∼ Bin(kn, p)

1. apply Chernoff bound to the upper tail of B(kn, p).2. apply union bound on all (N − k + 1) possible intervals

of length kn- upper bound the probability of the existence of a

violating interval

(N − k + 1)Pr [B(kn, p) ≥ k] < n2 · e−ε2

3(1−ε)k = o(1)

• sum∑N0

i=1 Xi distributed binomially (params N0 and p)

- expectation: N0p = εn2p2

= ε(1+ε)n2

- standard deviation of order n

- applying Chebyshev’s inequality gives the estimate

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 56 / 277

Page 57: Amazing, tutorial

Phase transition — proof sketchProof.CASE I: p = 1−ε

n

• assume to the contrary that G contains a connectedcomponent C with more than k = 7

ε2ln n vertices

• consider the moment inside this epoch when thealgorithm has found the (k + 1)-st vertex of C and isabout to move it to U

• denote ∆S = S ∩ C at that moment then |∆S ∪ U | = k ,and thus the algorithm got exactly k positive answers toits queries to random variables Xi during the epoch, witheach positive answer being responsible for revealing a newvertex of C , after the first vertex of C was put into U inthe beginning of the epoch.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 57 / 277

Page 58: Amazing, tutorial

Phase transition — proof sketch

Proof.• at that moment during the epoch only pairs of edges

touching ∆S ∪ U have been queried, and the number ofsuch pairs is therefore at most

(k2

)+ k(n − k) < kn

- it thus follows that the sequence X contains an interval oflength at most kn with at least k 1’s inside — acontradiction to Property 1 of Lemma 1

CASE II: p = 1+εn

• same type of argument:

assume the result does not hold and reach a contradictionby examining carefully the number of queries

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 58 / 277

Page 59: Amazing, tutorial

Degree distribution

• degree distribution : binomial

Ck =

(n − 1

k

)pk(1− p)n−1−k

• the limit distribution of the normalized binomialdistribution Bin(n, p) is the normal distribution providedthat np(1− p)→ +∞ as n→ +∞.

• if p = λn

the limit distribution of Bin(n, p) is the Poissondistribution.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 59 / 277

Page 60: Amazing, tutorial

Degree distribution

Bin(10000, 0.5) and Gaussian(0,1)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 60 / 277

Page 61: Amazing, tutorial

Degree distribution

Bin(1000, 0.003) and Poisson(3)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 61 / 277

Page 62: Amazing, tutorial

Degree distribution

Theorem

Let p = log nn· ω(n) with ω(n)→ +∞ arbitrarily slowly.

Fix x ∈ G and ε > 0. Then in G (n, p) whp for all vertices x

deg(x) ∼ (n − 1)p

Theorem ([McKay and Wormald, 1997])

Let Xk be the number of vertices of degree k in G (n, p) whenp = c

n, with c > 0 constant. Then whp for k = 0, 1, . . .

cke−c

k!≤ Xk

n≤ (1 + ε)

cke−c

k!, as n→ +∞

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 62 / 277

Page 63: Amazing, tutorial

Random graphs and real datasets

• a beautiful and elegant theory studied exhaustively

• have been used as idealized generative models

• unfortunately, they don’t always capture reality. . .

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 63 / 277

Page 64: Amazing, tutorial

Models of real-world networks

Page 65: Amazing, tutorial

Models

1 classic• grown versus static random graphs (CHKNS)• growth with preferential attachment• structure + randomness → small-world networks

2 more models• Copying model• Cooper-Frieze model• Kronecker graphs• Chung-Lu model• Forest-fire model

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 65 / 277

Page 66: Amazing, tutorial

CHKNS model

Callaway, Hopcroft, Kleinberg, Newman and Strogatz[Callaway et al., 2001]

• simple growth model for a random graph withoutpreferential attachment

• main thesis: grown graphs, however randomly they areconstructed, are fundamentally different from their staticrandom-graph counterparts

CHKNS model

• start with 0 vertices at time 0.

• at time t, a new vertex is created

• with probability δ add a random edge by choosing twoexisting vertices uniformly at random

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 66 / 277

Page 67: Amazing, tutorial

CHKNS model

let dk(t) be the number of vertices of degree k at time t

then

E [d0(t + 1)] = E [d0(t)] + 1− δ2E [d0(t)]

t

E [dk(t + 1)] = E [dk(t)] + δ(2E [dk−1(t)]

t− 2E [dk(t)]

t

)it turns out that

E [dk(t)]

t=

1

2δ + 1

( 2δ

2δ + 1

)k

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 67 / 277

Page 68: Amazing, tutorial

CHKNS model

size of giant component for a CHKNS random graph and astatic random graph with the same degree distribution

• why are grown and static random graphs so different?• intuition:

- positive correlation between the degrees of connectedvertices in the grown graph

- older vertices tend to have higher degree, and to link withother high degree vertices, merely by virtue of their age

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 68 / 277

Page 69: Amazing, tutorial

Preferential attachment

R. Albert L. Barabasi B. Bollobas O. Riordan

growth model:

• at time n, vertex n is added to the graph

• one edge is attached to the new vertex

• the other vertex is selected at random with probabilityproportional to its degree

• obtain a sequence of graphs {G (n)1 }.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 69 / 277

Page 70: Amazing, tutorial

Preferential attachment — generalization

The case of G(n)m where instead of a single edge we add m

edges reduces to G(n)1 by creating a G

(nm)1 and then collapsing

vertices km, km − 1, . . . , (k − 1)m + 1 to create vertex k .

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 70 / 277

Page 71: Amazing, tutorial

Preferential attachment

at time t, vertices 1 to 1d2 have degrees greater than d (Source

[Hopcroft and Kannan, 2012])

heuristic analysis• degi(t) the expected degree of the i -th vertex at time t

• the probability an edge is connected to i is degi (t)2t

• therefore∂degi(t)

∂t=

degi(t)

2t

• the solution is degi(t) =√

ti

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 71 / 277

Page 72: Amazing, tutorial

Preferential attachment

∫ d

0

Pr [degree = d ]∂d = Pr [degree ≤ d ] = 1− 1

d2

by using the fact that di(t) < d if i > td2 and by taking the

derivative

Pr [degree = d ] =∂

∂d

(1− 1

d2

)=

2

d3

power law distribution!

these results can be proved rigorously using the linearizedchord diagrams (LCD) model and also prove strongconcentration around the expectation using martingales

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 72 / 277

Page 73: Amazing, tutorial

Generalized preferential attachment

log-linear plot of the exponents of all the networks reported ashaving power-law (source [Dorogovtsev and Mendes, 2002])

many real-world networks have a power-law slope 2 < α < 3

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 73 / 277

Page 74: Amazing, tutorial

Generalized preferential attachment

how can we tune the power-law slope?

• [Buckley and Osthus, 2004] analyze a modifiedpreferential attachment process where α > 0 is a fitnessparameter

• when t vertex comes in, it chooses i according to

Pr [t chooses i ] =

{degt−1(i)+α−1

(α+1)t−1 , if 1 ≤ i ≤ t − 1α

(α+1)t−1 , if i = t.

• α = 1 gives the Barabasi-Albert/Bollobas-Riordan

G(n)1 model

• the power-law slope is 2 + α.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 74 / 277

Page 75: Amazing, tutorial

Generalized preferential attachment

• clustering coefficient of G(n)m is (m−1) log2 n

8nin expectation

• therefore tends to 0 [Bollobas and Riordan, 2003].

• can also be fixed by generalizing the model[Holme and Kim, 2002, Ostroumova et al., 2012].

• triangle formation: if an edge between v and u was addedin the previous preferential attachment step, then add onemore edge from v to a randomly chosen neighbor of u.

Holme-Kim Model

• perform a preferential attachment step• the perform with probability βt another preferential attach-ment step or a triangle formation step with probability 1− βtdiameter for PA and GPA is log n

log log nand log n respectively

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 75 / 277

Page 76: Amazing, tutorial

Random Apollonian networksare there power-law planar graphs?

snapshots of a random Apollonian network (RAN) at:(a) t = 1 (b) t = 2 (c) t = 3 (d) t = 100

• at time t + 1 we choose a face F uniformly at randomamong the faces of Gt

• let (i , j , k) be the vertices of F

• we add a new vertex inside F and we connect it to i , j , k

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 76 / 277

Page 77: Amazing, tutorial

Random Apollonian networks

Preferential attachment mechanism

what each vertex “sees” (boundary and the rest respectively)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 77 / 277

Page 78: Amazing, tutorial

Random Apollonian networks

Theorem ([Frieze and Tsourakakis, 2013])

Let Zk(t) denote the number of vertices of degree k at time t,k ≥ 3. For any t ≥ 1 and any k ≥ 3 there exists a constant bk

depending on k such that

|E [Zk(t)]− bkt| ≤ K , where K = 3.6.

Furthermore, for t sufficiently large and any λ > 0

Pr [|Zk(t)− E [Zk(t)] | ≥ λ] ≤ e−λ2

72t

Corollary

The diameter d(Gt) of Gt satisfies asymptotically whp

Pr [d(Gt) > 7.1 log t]→ 0

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 78 / 277

Page 79: Amazing, tutorial

Random Apollonian networks

key idea: establish a bijection with random ternary trees

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 79 / 277

Page 80: Amazing, tutorial

Random Apollonian networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 80 / 277

Page 81: Amazing, tutorial

Random Apollonian networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 81 / 277

Page 82: Amazing, tutorial

Random Apollonian networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 82 / 277

Page 83: Amazing, tutorial

Small-world models

Duncan Watts Steven Strogatz

construct a network with

• small diameter

• positive density of triangles

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 83 / 277

Page 84: Amazing, tutorial

Small-world models

why should we want to construct a network with

• small diameter,

• positive density of triangles?

L(G ) =∑

pairsu,v

d(u, v)(n2

) ,C (G ) =1

n

∑i

Ci .

Graph ∼ |V | 2|E |/|V | Lactual Lrandom Cactual Crandom

Film actors 225K 61 3.65 2.99 0.79 0.00027Power grid 5K 2.67 18.7 12.4 0.08 0.005C. elegans 0.3K 14 2.65 2.25 0.28 0.05

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 84 / 277

Page 85: Amazing, tutorial

Small-world models

model

• let G be the r -th power of the cycle on n vertices

- notice that diam(G ) = n2r

and C (G ) = 3(r−1)2(2r−1)

• let G (p) be the graph obtained from G by deletingindependently each edge with probability and then addingthe same number of edges back at random

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 85 / 277

Page 86: Amazing, tutorial

Small-world models

Watts-Strogatz on 1 000 vertices with rewiringprobability p = 0.05

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 86 / 277

Page 87: Amazing, tutorial

Small-world models

rewiring probability, p

even for a small value of p, L(G (p)) drops to O(log n),which C (G (p)) ≈ 3

4Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 87 / 277

Page 88: Amazing, tutorial

Small-world models

0.005 0.010 0.050 0.100 0.500 1.000

10

20

30

40

0.005 0.010 0.050 0.100 0.500 1.000

0.1

0.2

0.3

0.4

0.5

0.6

average distance clustering coefficient

Watts-Strogatz graph on 4 000 vertices, starting from a10-regular graph

• intuition: if you add a little bit of randomness to astructured graph, you get the small world effect

• related work: see [Bollobas and Chung, 1988]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 88 / 277

Page 89: Amazing, tutorial

Navigation in a small world

Jon Kleinberg

how to find short paths using only local information?

• we will use a simple directed model [Kleinberg, 2000].

• a local algorithm• can remember the source, the destination and its current

location• can query the graph to find the long-distance edge at

the current location.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 89 / 277

Page 90: Amazing, tutorial

Navigation in a small world

d(u, v): shortest path distance using only original grid edges

directed graph model, parameter r :

• each vertex is connected to its four adjacent vertices

• for each vertex v we add an extra link (v , u) where u ischosen with probability proportional to d(v , u)−r

notice: compared to the Watts-Strogatz model the long rangeedges are added in a biased way

(source [Kleinberg, 2000])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 90 / 277

Page 91: Amazing, tutorial

Navigation in a small world• r = 0: random edges, independent of distance

• as r increases the length of the long distance edgesdecreases in expectation

results

1. r < 2: the end points of the long distance edges tend tobe uniformly distributed over the vertices of the grid

- is unlikely on a short path to encounter a long distanceedge whose end point is close to the destination

- no local algorithm can find them

2. r = 2: there are short paths

- a short path can be found be the simple algorithm thatalways selects the edge that takes closest to thedestination

2. r > 2: there are no short paths, with high probability

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 91 / 277

Page 92: Amazing, tutorial

Copying model

[Kumar et al., 2000] analyze the copying model of[Kleinberg et al., 1999b].

• α ∈ (0, 1): copy factor

• d constant out degree.

evolving copying model, time t + 1

• create a new vertex t + 1• choose a prototype vertex u ∈ Vt uniformly at random

• the i -th out-link of t + 1 is chosen as follows:

with probability α we select x ∈ Vt−1 uniformly at random, and

with the remaining probability it copies the i -th out-lin of u

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 92 / 277

Page 93: Amazing, tutorial

Copying model

in-degrees follow power-law distribution [Kumar et al., 2000]

Theorem

for r > 0 the limit Pr = limt→+∞Nt(r)t

exists and satisfies

Pr = Θ(r−2−α1−α ).

explains the large number of bipartite cliques in the web graph

static models with power-law degree distributions do notaccount for this phenomenon!

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 93 / 277

Page 94: Amazing, tutorial

Cooper-Frieze model

Colin Cooper Alan Frieze

Cooper and Frieze [Cooper and Frieze, 2003] introduce ageneral model

1 many parameters

2 generalizes preferential attachment, generalizedpreferential attachment and copying models

3 whose attachment rule is a mixture of preferential anduniform

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 94 / 277

Page 95: Amazing, tutorial

Cooper-Frieze model

findings

1. we can obtain densification and shrinking diameters

- add edges among existing vertices

2. power law in expectation and strong concentration undermild assumptions.

3. novel techniques for concentration

martingales + Laplace

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 95 / 277

Page 96: Amazing, tutorial

Kronecker graphs

reminder: Kronecker product

A = [aij ] an m × n matrix

B = [bij ] a p × q matrix

then, A⊗ B is the mp × nq matrix a11B .. a1nB.. .. ..

am1B .. amnB

[Leskovec et al., 2010] propose a model based on theKronecker product, generalizing RMAT[Chakrabarti et al., 2004].

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 96 / 277

Page 97: Amazing, tutorial

Kronecker graphs

source [Leskovec et al., 2010]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 97 / 277

Page 98: Amazing, tutorial

Kronecker graphs

source [Leskovec et al., 2010]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 98 / 277

Page 99: Amazing, tutorial

Kronecker graphsa stochastic Kronecker graph is defined by two parameters

• an integer k

• the seed/initiator matrix θ(a bb c

)• we obtain a graph with n = 2k vertices by taking

repeatedly Kronecker products

• let Ak,θ = θ ⊗ . . .⊗ θ︸ ︷︷ ︸l times

be the resulting matrix

• adjacency matrix Ak,θ obtained by a randomized rounding

• typically 2× 2 seed matrices are used;

however, one can use other seed matrices

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 99 / 277

Page 100: Amazing, tutorial

Kronecker graphs

in practice we never need to compute A, but we can actuallydo a sampling based on the hierarchical properties ofKronecker products.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 100 / 277

Page 101: Amazing, tutorial

Kronecker graphs

consider G (V ,E ) such that |V | = n = 2k .

• Erdos-Renyi (0.5 0.50.5 0.5

)• core-periphery (

0.9 0.50.5 0.1

)• hierarchical community structure(

0.9 0.10.1 0.9

)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 101 / 277

Page 102: Amazing, tutorial

Kronecker graphs

• power-law degree distributions [Leskovec et al., 2010]

• power-law eigenvalue distribution [Leskovec et al., 2010]

• small diameter [Leskovec et al., 2010]

• densification power law [Leskovec et al., 2010]

• shrinking diameter [Leskovec et al., 2010]

• triangles [Tsourakakis, 2008]

• connectivity [Mahdian and Xu, 2007]

• giant components [Mahdian and Xu, 2007]

• diameter [Mahdian and Xu, 2007]

• searchability [Mahdian and Xu, 2007]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 102 / 277

Page 103: Amazing, tutorial

Kronecker graphs

how do we find a seed matrix θ such that AG ≈ θ ⊗ . . .⊗ θ︸ ︷︷ ︸k times

?

• maximum-likelihood estimation: argmaxθPr [G |θ]

- hard since exact computation requires O(n!n2) time, but

- Metropolis sampling and approximations allow O(m) timegood approximations [Leskovec and Faloutsos, 2007]

• moment based estimation: express the expected numberof certain subgraphs (e.g., edges, triangles, triples) as afunction of a, b, c and solve a system of equations[Gleich and Owen, 2012]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 103 / 277

Page 104: Amazing, tutorial

Chung-Lu model

Fan Chung Graham Linyuan Lu

• model is specified by w = (w1, . . . ,wn) representingexpected degree sequence

• certices i , j are connected with probability

pij =wiwj∑nk=1 wk

= ρwiwj .

• to have a proper probability distribution w 2max ≤ ρ

• can obtain an Erdos-Renyi random graph by setting

w = (pn, . . . , pn)Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 104 / 277

Page 105: Amazing, tutorial

Chung-Lu modelHow to set the weights to get power law exponent β?

• the probability of having degree k in power law

Pr [deg(v) = k] =k−β

ζ(β)

• hence, for β > 1

Pr [deg(v) ≥ k] =+∞∑l≥k

k−β

ζ(β)=

1

ζ(β)(β − 1)kβ−1

• assuming weights are decreasing and settingwi = k , i/n = Pr [deg(v) ≥ k]

wi =( i

ζ(β)(β − 1)i

)− 1β−1

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 105 / 277

Page 106: Amazing, tutorial

Chung-Lu modelrigorous results on:• degree sequence• giant component• average distance and the diameter• eigenvalues of the adjacency and the Laplacian matrix• ...

Complex graphs and networks, AMSFrieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 106 / 277

Page 107: Amazing, tutorial

Kronecker vs. Chung-Lu

“the SKG model is close enough to its associated CLmodel that most users of SKG could just as well usethe CL model for generating graphs.”

[Pinar et al., 2011]

Comparison of the graph properties of SKG and an equivalentCL.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 107 / 277

Page 108: Amazing, tutorial

Forest-fire model

J. Leskovec J. Kleinberg C. Faloutsos

[Leskovec et al., 2007] propose the forest fire model that isable to re-produce at a qualitative scale most of theestablished properties of real-world networks

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 108 / 277

Page 109: Amazing, tutorial

Forest-fire modelbasic version of the model

1. p : forward burning probability

2. r : backward burning ratio

• initially, we have a single vertex

• at time t a new vertex v arrives to Gt

• node v picks an ambassador/seed node u uniformly atrandom link to u

• two numbers x , y are sampled from two geometricdistributions with parameters p

1−p and rp1−rp respectively

- then, v chooses x out-links and y in-links of u which areincident to unvisited vertices

- let u1, . . . , ux+y be these chosen endpoints• mark u1, . . . , ux+y as visited and apply the previous step

recursively to each of them

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 109 / 277

Page 110: Amazing, tutorial

Forest-fire modelthe forest-fire model is able to explain

• heavy tailed in-degrees and out-degrees• densification power law• shrinking diameter• ...• deep cuts at small size scales and the absence of deep

cuts at large size scales

reminder

NCP of a DBLP graph (source [Leskovec et al., 2009]).

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 110 / 277

Page 111: Amazing, tutorial

Applications of random graphs

Page 112: Amazing, tutorial

Influence of search engines on preferential

attachment

Junghoo Cho

search-engine bias project

• in early days, search engines merely observed andexploited the web graph for ranking

• nowadays, they are unquestionably influencing theevolution of the web graph

• how?Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 112 / 277

Page 113: Amazing, tutorial

Influence of search engines on preferential

attachment

• “virtuous circle of limelight”

a search engine ranks a page highly

→ web page owners find this page more often and link to it

→ raises its popularity

and so on...

• main finding

[Cho and Roy, 2004] estimate that the time taken for apage to reach prominence can be delayed by a factor ofover 60 if a search engine diverts clicks to popular pages

• random graphs used to obtain insights into thisphenomenon [Chakrabarti et al., 2005]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 113 / 277

Page 114: Amazing, tutorial

Influence of search engines on preferential

attachmentFrieze, Vera and Chakrabarti [Chakrabarti et al., 2005]introduce a model with three parameters:

• p: a probability

• N : maximum number of celebrity nodes listed by thesearch engine

• m: edge parameter

notation:

• sequence of graphs {Gt}+∞t=1 . Gt will have t vertices andmt edges.

• Dt(U) =∑

x∈U degt(x)

• St the set of at most N vertices with largest degrees in Gt .

• dk(t) denotes the number of vertices of degree k at timet. in the set Vt − St .

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 114 / 277

Page 115: Amazing, tutorial

Influence of search engines on preferential

attachment• time step 1: the process is initialized with graph G1 which

consists of an isolated vertex x1 and m loops

• time step t > 1: we add a vertex xt to Gt−1- we then add m random edges (xt , yi), i = 1, . . . ,m

incident with xt , where yi are nodes in Gt−1- for each i :

• with probability p we choose yi ∈ St−1• with probability 1− p we choose yi ∈ Vt−1

in both case yi is selected by preferential attachment, i.e.,

Pr [yi = x ] =degt−1(x)∑u∈U degt−1(u)

where U = St−1 or U = Vt−1

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 115 / 277

Page 116: Amazing, tutorial

Influence of search engines on preferential

attachment

TheoremLet m ≥ max{15, 2

1−p} and 0 < p < 1

• Let St = {s1, . . . sN} in decreasing order of degree.

Then E [degt(si)] ∼ αi t for every i ≤ N for someconstant αi > 0

• There is an absolute constant A1 such that for everyk ≥ m

E [dk(t)] =A1n

k1+

21−p

+ second order terms

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 116 / 277

Page 117: Amazing, tutorial

Influence of search engines on preferential

attachment

the theorem and its proof verify our intuition

• the celebrity lit gets fixed quickly

• each celebrity page captures a constant fraction of alledges ever generated in the graph

• the non-celebrity vertices obey a power law which issteeper

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 117 / 277

Page 118: Amazing, tutorial

Robustness and vulnerability

• intuitively, a complex network is robust if it keeps its basicfunctionality under the failure of some of its components.

• distinguish between random failure and intentional attacks

• related to percolation

percolation

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 118 / 277

Page 119: Amazing, tutorial

Robustness and vulnerability

R. Albert H. Jeong L. Barabasi

[Albert et al., 2000] provide simulations indicating that scalefree networks are robust to random failures

10 second sound bite science

The Internet is robust yet fragile. 95% of the linkscan be removed and the graph will stay connected.However, targeted removal of 2.3% of the hubswould disconnect the Internet.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 119 / 277

Page 120: Amazing, tutorial

Robustness and vulnerability

n = 10 000 vertices m = 20 000 links

• diameter of an Erdos-Renyi and a scale-free network as afunction of the fraction f of vertices deleted

• the power-law distribution implies that under randomsampling, vertices with small degree are selected selected withmuch higher probability

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 120 / 277

Page 121: Amazing, tutorial

Robustness and vulnerability• the cluster size

distribution for variousvalues of f for anErdos-Renyi graph anda scale-free networkunder random andmalicious failures(source[Albert et al., 2000])

• Intuition: scale-freegraphs areinhomogeneous whichimplies both betterperformance underrandom failures andreduced attacksurvivability

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 121 / 277

Page 122: Amazing, tutorial

Robustness and vulnerability

Bella Bollobas Oliver Riordan

[Bollobas and Riordan, 2004] studied the robustness andvulnerability of a scale-free graph, using specifically theBarabasi-Albert model

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 122 / 277

Page 123: Amazing, tutorial

Robustness and vulnerability

• when vertices of G(n)m are deleted independently with

probability 1− p, there is always a giant component!

- no critical p

• however the size of the giant component depends on p

TheoremLet m ≥ 2, 0 < p < 1 be fixed and let Gp be obtained from

G(n)m by deleting vertices independently with probability 1− p

Then as n→ +∞ whp the largest component of Gp has order((c(p,m) + o(1))n

Furthermore, as p → 0 with m fixed, c(p,m) = exp(

1O(p)

)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 123 / 277

Page 124: Amazing, tutorial

Robustness and vulnerability

• when G(n)m is deliberately attacked, finding the “best”

attack is hard

• Bollobas and Riordan consider the natural attack ofdeleting the earliest vertices up to some cutoff cn

Theorem

Let Gc be obtained by G(n)m by deleting all vertices with index

less than cn, where 0 < c < 1 is a constant.

Let cm = m−1m+1

.

If c < cm then whp Gc has a component with Θ(n) vertices.

If c > cm then whp Gc has no such component.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 124 / 277

Page 125: Amazing, tutorial

More applications

• study of interdependent networks [Brummitt et al., 2012]

a random three- and four-regular graph connected by Bernoullidistributed coupling with interconnectivity parameter p = 0.1

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 125 / 277

Page 126: Amazing, tutorial

More applications

Itai Ashlagi Alvin Roth

compatibility graph : each vertex is a donor-patient pair andeach edge between two vertices denotes compatibility forkidney exchange.

• model kidney exchange with many patient-donor pairs asa random compatibility graph

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 126 / 277

Page 127: Amazing, tutorial

More applications

Motivation

• we wish to messages in a cellular network G , between anytwo vertices in a pipeline

• we require that each link on the route between thevertices (namely, each edge on the path) is assigned adistinct channel (e.g., a distinct frequency)

an edge colored graph G is rainbow edge connected if any twovertices are connected by a path whose edges have distinctcolors

goal: Find the minimum number of colors needed to rainbowcolor the edges of G

[Frieze and Tsourakakis, 2012] study rainbow connectivity insparse random graphs

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 127 / 277

Page 128: Amazing, tutorial

More applications• [Cooper and Frieze, 2004] studied the performance of

crawlers in random evolving scale-free graphs

• [Valiant, 2005] uses random graphs to modelmemorization and association functionalities of the brain

• simulations (epidemics, performance of algorithms etc.)

• graph anonymization [Leskovec et al., 2005a]

• allow to argue about the structure of real-world networks

for instance, given a random graph with a fixed degreedistribution, what do we expect for the spectrum,subgraphs etc?

• give rise to objectives by using them as null models(modularity)

• and many more ..

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 128 / 277

Page 129: Amazing, tutorial

Conclusions (random graphs)

• just scratched the tip of the iceberg• random geometric graphs [Penrose, 2003]

• hyperbolic geometry [Gugelmann et al., 2012]• line of sight networks [Frieze et al., 2009]

• protean graphs [ Luczak and Pra lat, 2006]• geometric preferential attachment [Flaxman et al., 2006]• affiliation networks [Lattanzi and Sivakumar, 2009]• many other interesting stochastic models ..• optimization based models for topology

• Doyle et al. [Doyle and Carlson, 2000, Li et al., 2005]• heuristically optimized trade-offs [Fabrikant et al., 2002]

• a different line of research, networks as biproduct ofstrategy selection [Dutta and Jackson, 2003],[Fabrikant et al., 2003], [Borgs et al., 2011]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 129 / 277

Page 130: Amazing, tutorial

Conclusions (random graphs)

• there is no single model that matches all establishedexisting properties• the forest-fire model appears to match most, but we do

not understand well this model

• many types of networks (social networks, informationnetworks, technological networks), develop specializedmodels

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 130 / 277

Page 131: Amazing, tutorial

Outline

• introduction and graphs and networks

• random graphs as models of real-world networks

• properties of real-world networks

• Erdos-Renyi graphs

• models of real-world networks

• applications of random graphs

• algorithm design for large-scale networks

• graph partitioning and community detection

• dense subgraphs

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 131 / 277

Page 132: Amazing, tutorial

Graph partitioning and community detection

Page 133: Amazing, tutorial

Graph partitioning and community detection

• knowledge discovery• partition the web into sets of related pages (web graph)• find groups of scientists who collaborate with each other

(co-authorship graph)• find groups of related queries submitted in a search

engine (query graph)

• performance• partition the nodes of a large social network into

different machines so that, to a large extent, friends arein the same machine (social networks)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 133 / 277

Page 134: Amazing, tutorial

Graph partitioning — high-level problem definition

• graph G = (V ,E ,w)

• edge (u, v) denotes affinity between u and v

• weight of edge w(u, v) can be used to quantify thedegree of affinity

• we want to partition the vertices in clusters so that:• vertices within clusters are well connected, and• vertices across clusters are sparsely connected

• typical graph-partitioning problems are NP-hard

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 134 / 277

Page 135: Amazing, tutorial

Graph partitioning

(Zachary’s karate-club network, figure from [Newman and Girvan, 2004])Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 135 / 277

Page 136: Amazing, tutorial

Objective functions: (1) min cut• the minimum number of edges cut by a two-component

partitioning• cut:

E (S ,T ) = {(u, v) ∈ E | u ∈ S and v ∈ T}

• min cut:c(G ) = min

S⊆V|E (S ,V \ S)|

V−S

SS

V−S

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 136 / 277

Page 137: Amazing, tutorial

Objective functions: (2) graph expansion

• normalize the cut by the size of the smallest component

• ratio cut:

α(G , S) =|E (S ,V \ S)|

min{|S |, |V \ S |}• graph expansion:

α(G ) = minS

|E (S ,V \ S)|min{|S |, |V \ S |}

V−S

SS

V−S

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 137 / 277

Page 138: Amazing, tutorial

Objective functions: (3) conductance

• normalize by volume

vol(S) =∑i∈S

di , for S ⊆ V (so, vol(V ) = 2m)

• set conductance:

φ(G , S) =|E (S ,V \ S)|

min{vol(S), vol(V \ S)}

• graph conductance:

φ(G ) = minS⊆V

|E (S ,V \ S)|min{vol(S), vol(V \ S)}

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 138 / 277

Page 139: Amazing, tutorial

Background: linear algebra and eigenvalues

• consider a real n × n matrix A

• (λ,u) an eigenvalue–eigenvector pair if Au = λu

• a symmetric real matrix has real eigenvalues

• the set of eigenvalues of a matrix is called the spectrumof the matrix

σ(A) = {λ1, . . . , λn}

index them so that λ1 ≤ . . . ≤ λn

• A is positive semi-definite if xTA x ≥ 0 for all x ∈ Rn

• a symmetric positive semi-definite real matrix has nonnegative eigenvalues

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 139 / 277

Page 140: Amazing, tutorial

Background: linear algebra and eigenvalues• for a symmetric matrix, the eigenvectors that corespond

to different eigenvalues are orthogonal(λi 6= λj implies uT

i uj = 0)• the range of A is the linear space spanned by the columns

of A

range(A) = {x ∈ Rn | A y = x, for some y ∈ Rn}

• for a real and symmetric matrix A, the range of A isspanned by the eigenvectors with non-zero eigenvalues

• for a real and symmetric matrix A, with eigenvaluesλ1 ≤ . . . ≤ λn and corresponding eigenvectors u1, . . . ,un

A =n∑

i=1

λi ui uTi

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 140 / 277

Page 141: Amazing, tutorial

Background: min–max characterization of

eigenvalues• for a real and symmetric matrix A with eigenvaluesλ1 ≤ . . . ≤ λn

λn = maxvT v=1

vTA v

λ1 = minvT v=1

vTA v

λ2 = minvT v=1vTu1=0

vTA v

and in general

λk = minvT v=1

vTui=0,i=1...k−1

vTA v

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 141 / 277

Page 142: Amazing, tutorial

Spectral analysis of graphs

• G = (V ,E ) an undirected graph

• A the adjacency matrix of G :

• define the Laplacian matrix of A as

L = D − A or Lij =

di if i = j−1 if (i , j) ∈ E , i 6= j0 if (i , j) 6∈ E , i 6= j

• where D = diag(d1, . . . , dn), a diagonal matrix

• L is symmetric positive semi-definite

• The smallest eigenvalue of L is λ1 = 0, with eigenvectoru1 = (1, 1, . . . , 1)T

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 142 / 277

Page 143: Amazing, tutorial

Spectral analysis of graphs

• consider the second smallest eigenvector λ2 of L

λ2 = min||x||=1xTu1=0

xTL x = min∑xi=0

∑(i ,j)∈E (xi − xj)

2∑i x2

i

• the corresponding eigenvector u2 is called Fielder vector

• ordering according to the values of u2 will group similar(connected) vertices together

• one-dimensional embedding that preserves the graphstructure

• physical interpretation: minimize elastic potential energyif graph is materialized with springs at its edges

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 143 / 277

Page 144: Amazing, tutorial

Spectral analysis of graphs

λ2 = min||x||=1xTu1=0

xTL x = min∑xi=0

∑(i ,j)∈E (xi − xj)

2∑i x2

i

• ordering according to the values of u2 will group similar(connected) vertices together

• one-dimensional embedding that preserves the graphstructure

Tuesday, July 23, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 144 / 277

Page 145: Amazing, tutorial

Random walks

• consider random walk on the graph G by following edges

• from vertex i move to vertex j with prob. 1/di if (i , j) ∈ E

• p(t)i probability of being at vertex i at time t

• process is described by equation p(t+1) = p(t)P ,

where P = D−1 A is row-stochastic

• process converges to stationary distribution π = π P(under certain irreducibility conditions)

• for undirected and connected graphs

πi =di

2m(stationary distribution ∼ degree)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 145 / 277

Page 146: Amazing, tutorial

Random walks — useful concepts• hitting time H(i , j): expected number of steps before

visiting vertex j , starting from i• commute time κ(i , j): expected number of steps before

visiting j and i again, starting at i

κ(i , j) = H(i , j) + H(j , i)

• cover time R : expected number of steps to reach everynode

• mixing time τ(ε): a measure of how fast the random walkapproaches its stationary distribution

τ(ε) = min{t | d(t) ≤ ε}where

d(t) = maxi||pt(i , ·)− π|| = max

i

{∑j

|pt(i , j)− πj |

}Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 146 / 277

Page 147: Amazing, tutorial

Random walks — spectral analysis• instead of L = D − A consider normalized Laplacian

L′ = I − D−1/2A D−1/2

L′ u = λu

(I − D−1/2A D−1/2)u = λu

(D − A)u = λD u

D u = Au + λD u

(1− λ)u = D−1Au

µu = P u

• (λ,u) is an eigenvalue–eigenvector pair for L′ if and onlyif (1− λ,u) is an eigenvalue–eigenvector pair for P

• the eigenvector with smallest eigenvalue for L′ is theeigenvector with largest eigenvalue for P

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 147 / 277

Page 148: Amazing, tutorial

Random walks — spectral analysis

• stochastic matrix P , describing the random walk

• eigenvalues: −1 < µn ≤ . . . ≤ µ2 < µ1 = 1

• spectral gap: γ∗ = 1− µ2

• relaxation time: τ∗ = 1γ∗

• theorem: for an aperiodic, irreducible, and reversiblerandom walk, and any ε

(τ∗ − 1) log

(1

)≤ τ(ε) ≤ τ∗ log

(1

2ε√πmin

)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 148 / 277

Page 149: Amazing, tutorial

Random walks — spectral analysis

• intuition: fast mixing related to graph being an expander

• large mixing time ⇒ bottlenecks ⇒ clusters

• large spectral gap ⇒ no clusters

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 149 / 277

Page 150: Amazing, tutorial

Spectral analysis and clustering measures

• clustered structure of G captured bymin cut c(G )expansion α(G )conductance φ(G )

• no surprise those clustering measures are related tospectral gap

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 150 / 277

Page 151: Amazing, tutorial

Cheeger inequality• eigenvalues of the stochastic matrix P , describing the

random walk: −1 < µn ≤ . . . ≤ µ2 < µ1 = 1

• eigenvalues of normalized Laplacian:0 = λ1 < λ2 ≤ . . . ≤ λn

• spectral gap: γ∗ = 1− µ2 = λ2

• Cheeger inequality:

φ(G )2

2≤ γ∗ = λ2 ≤ 2φ(G )

• [reminder] graph conductance:

φ(G ) = minS⊆V

|E (S ,V \ S)|min{vol(S), vol(V \ S)}

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 151 / 277

Page 152: Amazing, tutorial

Spectral analysis of graphs

• consider the second smallest eigenvector λ2 of L

λ2 = min||x||=1xTu1=0

xTL x = min∑xi=0

∑(i ,j)∈E (xi − xj)

2∑i x2

i

• ordering according to the values of u2 will group similar(connected) vertices together

• one-dimensional embedding that preserves the graphstructure

• λ2 corresponds to spectral gap

• the smaller λ2 the better the clusters

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 152 / 277

Page 153: Amazing, tutorial

Interesting special case

• the smaller λ2 the better the clusters

• theorem: let L be the Laplacian of a graph G = (V ,E ).λ2 > 0 if and only if G is connected

proof: if G disconnected then

L =

(L1 00 L2

)consider also

λ2 = min||x||=1xTu1=0

xTL x = min∑xi=0

∑(i ,j)∈E (xi − xj)

2∑i x2

i

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 153 / 277

Page 154: Amazing, tutorial

Inside the proof of Cheeger’s inequality

• 0 = λ1 < λ2 ≤ . . . ≤ λn (normalized Laplacian)

• Cheeger inequality

φ(G )2

2≤ γ∗ = λ2 ≤ 2φ(G )

[λ2 ≤ 2φ(G )]

• 2φ(G ) can be written as an expression over xi ∈ {0, 1}indicating whether i ∈ S

• λ2 can be written as the fractional relaxation of theprevious expression

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 154 / 277

Page 155: Amazing, tutorial

Inside the proof of Cheeger’s inequality

• 0 = λ1 < λ2 ≤ . . . ≤ λn (normalized Laplacian)

• Cheeger inequality

φ(G )2

2≤ γ∗ = λ2 ≤ 2φ(G )

[φ(G ) ≤√

2λ2]

• constructive

• order graph vertices according to the eigenvector of λ2

• form S by spliting vertices around their median

• show for that partitioning φ(S) ≤√

2λ2

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 155 / 277

Page 156: Amazing, tutorial

Basic spectral-partition algorithm

1 form normalized Laplacian L′ = I − D−1/2A D−1/2

2 compute the eigenvector u2 that corresponds to λ2

3 order vertices according their coefficient value on u2

4 consider only sweeping cuts: splits that respect the order

5 take the sweeping cut S that minimizes φ(S)

theorem the basic spectral-partition algorithm finds a cut S suchthat φ(S) ≤ 2

√φ(G )

proof by Cheeger inequality φ(S) ≤√

2 · λ2 ≤√

2 · 2 · φ(G )

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 156 / 277

Page 157: Amazing, tutorial

Spectral partitioning rules

1 conductance: find the partition that minimizes φ(G )

2 bisection: split in two equal parts

3 sign: separate positive and negative values

4 gap: separate according to the largest gap

Tuesday, July 23, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 157 / 277

Page 158: Amazing, tutorial

Other common spectral-partitioning algorithms

1 utilize more eigenvectors than just the Fielder vector

use k eigenvectors

2 different versions of the Laplacian matrix

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 158 / 277

Page 159: Amazing, tutorial

Using k eigenvectors

• ideal scenario: the graph consists of k disconnectedcomponents (perfect clusters)

• then: eigenvalue 0 of the Laplacian has multplicity kthe eigenspace of eigenvalue 0 is spanned by indicatorvectors of the graph components

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 159 / 277

Page 160: Amazing, tutorial

Using k eigenvectors

1111

111

11

111

Tuesday, July 30, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 160 / 277

Page 161: Amazing, tutorial

Using k eigenvectors

1111

111

11

111

Tuesday, July 30, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 161 / 277

Page 162: Amazing, tutorial

Using k eigenvectors

1111

111

11

111

1

1

1

Tuesday, July 30, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 162 / 277

Page 163: Amazing, tutorial

Using k eigenvectors

• robustness under perturbations: if the graph has lesswell-separated components the previous structure holdsapproximately

• clustering of Euclidean points can be used to separate thecomponents

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 163 / 277

Page 164: Amazing, tutorial

Using k eigenvectors

Tuesday, July 30, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 164 / 277

Page 165: Amazing, tutorial

Laplacian matrices

• unormalized Laplacian: L = D − A

Lij =

di if i = j−1 if (i , j) ∈ E , i 6= j0 if (i , j) 6∈ E , i 6= j

• normalized symmetric Laplacian: L′ = I − D−1/2A D−1/2

• normalized “random-walk” Laplacian: Lrw = I − D−1A

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 165 / 277

Page 166: Amazing, tutorial

All Laplacian matrices are related

• unormalized Laplacian: λ2 = min ||x||=1xTu1=0

∑(i ,j)∈E (xi − xj)

2

• normalized Laplacian:

λ2 = min||x||=1xTu1=0

∑(i ,j)∈E

(xi√di

− xj√dj

)2

• (λ,u) is an eigenvalue/vector of Lrw if and only if(λ,D1/2 u) is an eigenvalue/vector of L’

• (λ,u) is an eigenvalue/vector of Lrw if and only if(λ,u) solve the generalized eigen-problem Lu = λD u

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 166 / 277

Page 167: Amazing, tutorial

Algorithm 1: unormalized spectral clustering

input graph adjacency matrix A, number k

1. form diagonal matrix D

2. form unormalized Laplacian L = D − A

3. compute the first k eigenvectors u1, . . . , uk of L

4. form matrix U ∈ Rn×k with columns u1, . . . , uk

5. consider the i -th row of U as point yi ∈ Rk , i = 1, . . . , n,

6. cluster the points {yi}i=1,...,n into clusters C1, . . . ,Ck

e.g., with k-means clustering

output clusters A1, . . . ,Ak with Ai = {j | yj ∈ Ci}

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 167 / 277

Page 168: Amazing, tutorial

Algorithm 2: normalized spectral clustering

[Shi and Malik, 2000]

input graph adjacency matrix A, number k

1. form diagonal matrix D

2. form unormalized Laplacian L = D − A

3. compute the first k eigenvectors u1, . . . , uk of thegeneralized eigen-problem Lu = λD u (eigvctrs of Lrw)

4. form matrix U ∈ Rn×k with columns u1, . . . , uk

5. consider the i -th row of U as point yi ∈ Rk , i = 1, . . . , n,

6. cluster the points {yi}i=1,...,n into clusters C1, . . . ,Ck

e.g., with k-means clustering

output clusters A1, . . . ,Ak with Ai = {j | yj ∈ Ci}

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 168 / 277

Page 169: Amazing, tutorial

Algorithm 3: normalized spectral clustering

[Ng et al., 2001]

input graph adjacency matrix A, number k

1. form diagonal matrix D

2. form normalized Laplacian L′ = I − D−1/2A D−1/2

3. compute the first k u1, . . . , uk of L′

4. form matrix U ∈ Rn×k with columns u1, . . . , uk

5. normalize U so that rows have norm 1

6. consider the i -th row of U as point yi ∈ Rk , i = 1, . . . , n,

7. cluster the points {yi}i=1,...,n into clusters C1, . . . ,Ck

e.g., with k-means clustering

output clusters A1, . . . ,Ak with Ai = {j | yj ∈ Ci}

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 169 / 277

Page 170: Amazing, tutorial

intuition of the spectral algorithms

Tuesday, July 30, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 170 / 277

Page 171: Amazing, tutorial

Notes on the three spectral algorithms

• quite similar except for using the three differentLaplacians

• can be used to cluster any type of data, not just graphsform all-pairs similarity matrix and use as adjacencymatrix

• computation of the first eigenvectors of sparse matricescan be done efficiently using the Lanczos method

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 171 / 277

Page 172: Amazing, tutorial

Zachary’s karate-club network

1

111213

14

18

2

20

22

3

324

5

6

7

8

9

10 34

15 3316 19

31

21

2324

26

28

30

25

27

29

17

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 172 / 277

Page 173: Amazing, tutorial

Zachary’s karate-club network

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 173 / 277

Page 174: Amazing, tutorial

Zachary’s karate-club network

Thursday, August 1, 13

unormalized normalized normalizedLaplacian symmetric random walk

Laplacian LaplacianFrieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 174 / 277

Page 175: Amazing, tutorial

Zachary’s karate-club network

1

111213

14

18

2

20

22

3

324

5

6

7

8

9

10 34

15 3316 19

31

21

2324

26

28

30

25

27

29

17

1

111213

14

18

2

20

22

3

324

5

6

7

8

9

10 34

15 3316 19

31

21

2324

26

28

30

25

27

29

17

1

111213

14

18

2

20

22

3

324

5

6

7

8

9

10 34

15 3316 19

31

21

2324

26

28

30

25

27

29

17

unormalized normalized normalizedLaplacian symmetric random walk

Laplacian Laplacian

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 175 / 277

Page 176: Amazing, tutorial

Which Laplacian to use?

[von Luxburg, 2007]

• when graph vertices have about the same degree allLaplacians are about the same

• for skewed degree distributions normalized Laplacianstend to perform better, and Lrw is preferable

• normalized Laplacians are associated with conductance,which is preferable than ratio cut

(conductance involves vol(S) rather than |S | andcaptures better community structure)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 176 / 277

Page 177: Amazing, tutorial

Modularity

• cut ratio, graph expension, conductance useful to extractone component

• not clear how to extend to measure quality of graphpartitions

• related question: what is the optimal number ofpartitions?

• modularity measure has been used to answer thosequestions

• [Newman and Girvan, 2004]

• originally developed to find the optimal number ofpartitions in hierarchical graph partitioning

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 177 / 277

Page 178: Amazing, tutorial

Modularity• intuition: compare actual subgraph density with

expected subgraph density, if vertices were attachedregardless of community structure

Q =1

2m

∑ij

(Aij − Pij)δ(Ci ,Cj)

=1

2m

∑ij

(Aij −didj

2m)δ(Ci ,Cj)

=∑c

[mc

2m−(

dc

2m

)2]

Pij = 2mpipj = 2m(di/2m)(dj/2m) = (didj/2m)mc : edges within cluster cdc : total degree of cluster c

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 178 / 277

Page 179: Amazing, tutorial

Values of modularity

• 0 random structure; 1 strong community structure;[0.3..0.7]; typical good structure; can be negative, too

• Q measure is not monotone with k4

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5x 105

−0.1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

xth join

mod

ular

ity, Q

FIG. 1: The modularity Q over the course of the algorithm(the x axis shows the number of joins). Its maximum value isQ = 0.745, where the partition consists of 1684 communities.

in practical situations it is usually unnecessary to main-tain the separate max-heaps for each row. These heapsare used to find the largest element in a row quickly, buttheir maintenance takes a moderate amount of e!ort andthis e!ort is wasted if the largest element in a row doesnot change when two rows are amalgamated, which turnsout often to be the case. Thus we find that the followingsimpler implementation works quite well in realistic sit-uations: if the largest element of the kth row was "Qki

or "Qkj and is now reduced by Eq. (10b) or (10c), wesimply scan the kth row to find the new largest element.Although the worst-case running time of this approachhas an additional factor of n, the average-case runningtime is often better than that of the more sophisticatedalgorithm. It should be noted that the hierarchies gen-erated by these two versions of our algorithm will di!erslightly as a result of the di!erences in how ties are bro-ken for the maximum element in a row. However, we findthat in practice these di!erences do not cause significantdeviations in the modularity, the community size distri-bution, or the composition of the largest communities.

III. AMAZON.COM PURCHASING NETWORK

The output of the algorithm described above is pre-cisely the same as that of the slower hierarchical algo-rithm of [32]. The much improved speed of our algorithmhowever makes possible studies of very large networks forwhich previous methods were too slow to produce usefulresults. Here we give one example, the analysis of a co-purchasing or “recommender” network from the onlinevendor Amazon.com. Amazon sells a variety of products,particularly books and music, and as part of their websales operation they list for each item A the ten otheritems most frequently purchased by buyers of A. This

FIG. 2: A visualization of the community structure at max-imum modularity. Note that the some major communitieshave a large number of “satellite” communities connected onlyto them (top, lower left, lower right). Also, some pairs of ma-jor communities have sets of smaller communities that actas “bridges” between them (e.g., between the lower left andlower right, near the center).

information can be represented as a directed network inwhich vertices represent items and there is a edge fromitem A to another item B if B was frequently purchasedby buyers of A. In our study we have ignored the directednature of the network (as is common in community struc-ture calculations), assuming any link between two items,regardless of direction, to be an indication of their simi-larity. The network we study consists of items listed onthe Amazon web site in August 2003. We concentrate onthe largest component of the network, which has 409 687items and 2 464 630 edges.

The dendrogram for this calculation is of course toobig to draw, but Fig. 1 illustrates the modularity over thecourse of the algorithm as vertices are joined into largerand larger groups. The maximum value is Q = 0.745,which is high as calculations of this type go [21, 32]and indicates strong community structure in the network.The maximum occurs when there are 1684 communitieswith a mean size of 243 items each. Fig. 2 gives a visual-ization of the community structure, including the majorcommunities, smaller “satellite” communities connectedto them, and “bridge” communities that connect two ma-jor communities with each other.

Looking at the largest communities in the network, wefind that they tend to consist of items (books, music) insimilar genres or on similar topics. In Table I, we give in-formal descriptions of the ten largest communities, whichaccount for about 87% of the entire network. The remain-der is generally divided into small, densely connectedcommunities that represent highly specific co-purchasinghabits, e.g., major works of science fiction (162 items),music by John Cougar Mellencamp (17 items), and books

4

0 0.5 1 1.5 2 2.5 3 3.5 4 4.5x 105

−0.1

0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

xth join

mod

ular

ity, Q

FIG. 1: The modularity Q over the course of the algorithm(the x axis shows the number of joins). Its maximum value isQ = 0.745, where the partition consists of 1684 communities.

in practical situations it is usually unnecessary to main-tain the separate max-heaps for each row. These heapsare used to find the largest element in a row quickly, buttheir maintenance takes a moderate amount of e!ort andthis e!ort is wasted if the largest element in a row doesnot change when two rows are amalgamated, which turnsout often to be the case. Thus we find that the followingsimpler implementation works quite well in realistic sit-uations: if the largest element of the kth row was "Qki

or "Qkj and is now reduced by Eq. (10b) or (10c), wesimply scan the kth row to find the new largest element.Although the worst-case running time of this approachhas an additional factor of n, the average-case runningtime is often better than that of the more sophisticatedalgorithm. It should be noted that the hierarchies gen-erated by these two versions of our algorithm will di!erslightly as a result of the di!erences in how ties are bro-ken for the maximum element in a row. However, we findthat in practice these di!erences do not cause significantdeviations in the modularity, the community size distri-bution, or the composition of the largest communities.

III. AMAZON.COM PURCHASING NETWORK

The output of the algorithm described above is pre-cisely the same as that of the slower hierarchical algo-rithm of [32]. The much improved speed of our algorithmhowever makes possible studies of very large networks forwhich previous methods were too slow to produce usefulresults. Here we give one example, the analysis of a co-purchasing or “recommender” network from the onlinevendor Amazon.com. Amazon sells a variety of products,particularly books and music, and as part of their websales operation they list for each item A the ten otheritems most frequently purchased by buyers of A. This

FIG. 2: A visualization of the community structure at max-imum modularity. Note that the some major communitieshave a large number of “satellite” communities connected onlyto them (top, lower left, lower right). Also, some pairs of ma-jor communities have sets of smaller communities that actas “bridges” between them (e.g., between the lower left andlower right, near the center).

information can be represented as a directed network inwhich vertices represent items and there is a edge fromitem A to another item B if B was frequently purchasedby buyers of A. In our study we have ignored the directednature of the network (as is common in community struc-ture calculations), assuming any link between two items,regardless of direction, to be an indication of their simi-larity. The network we study consists of items listed onthe Amazon web site in August 2003. We concentrate onthe largest component of the network, which has 409 687items and 2 464 630 edges.

The dendrogram for this calculation is of course toobig to draw, but Fig. 1 illustrates the modularity over thecourse of the algorithm as vertices are joined into largerand larger groups. The maximum value is Q = 0.745,which is high as calculations of this type go [21, 32]and indicates strong community structure in the network.The maximum occurs when there are 1684 communitieswith a mean size of 243 items each. Fig. 2 gives a visual-ization of the community structure, including the majorcommunities, smaller “satellite” communities connectedto them, and “bridge” communities that connect two ma-jor communities with each other.

Looking at the largest communities in the network, wefind that they tend to consist of items (books, music) insimilar genres or on similar topics. In Table I, we give in-formal descriptions of the ten largest communities, whichaccount for about 87% of the entire network. The remain-der is generally divided into small, densely connectedcommunities that represent highly specific co-purchasinghabits, e.g., major works of science fiction (162 items),music by John Cougar Mellencamp (17 items), and books

(figures from [Clauset et al., 2004])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 179 / 277

Page 180: Amazing, tutorial

Optimizing modularity

• problem: find the partitioning that optimizes modularity

• NP-hard problem [Brandes et al., 2006]

• top-down approaches [Newman and Girvan, 2004]

• spectral approaches [Smyth and White, 2005]

• mathematical-programming [Agarwal and Kempe, 2008]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 180 / 277

Page 181: Amazing, tutorial

Top-down algorithms for optimizing modularity

[Newman and Girvan, 2004]

• a set of algorithms based on removing edges from thegraph, one at a time

• the graph gets progressively disconnected, creating ahierarchy of communities

3

22 14 4 13 8 3 10 23 19 16 15 21 9 31 33 29 25 26 32 24 27 30 34 281 6 17 7 5 11 12 20 2 18

FIG. 2: Dendrogram of the communities found by our algo-rithm in the “karate club” network of Zachary [5, 17]. Theshapes of the vertices represent the two groups into which theclub split as the result of an internal dispute.

not to continue using it—it appears to give the bestresults. For systems too large to make use of this ap-proach, however, our new algorithm gives useful com-munity structure information with comparatively littlee!ort.

We have applied our algorithm to a variety of real-world networks also. We have looked, for example, atthe “karate club” network studied in [5], which representsfriendships between 34 members of a club at a US univer-sity, as recorded over a two-year period by Zachary [17].During the course of the study, the club split into twogroups as a result of a dispute within the organization,and the members of one group left to start their ownclub. In Fig. 2 we show the dendrogram derived by feed-ing the friendship network into our algorithm. The peakmodularity is Q = 0.381 and corresponds to a split intotwo groups of 17, as shown in the figure. The shapes ofthe vertices represent the alignments of the club mem-bers following the split and, as we can see, the divisionfound by the algorithm corresponds almost perfectly tothese alignments; only one vertex, number 10, is classifiedwrongly. The GN algorithm performs similarly on thistask, but not better—it also finds the split but classifiesone vertex wrongly (although a di!erent one, vertex 3).In other tests, we find that our algorithm also success-fully detects the main two-way division of the dolphinsocial network of Lusseau [6, 18], and the division be-tween black and white musicians in the jazz network ofGleiser and Danon [11].

As a demonstration of how our algorithm can some-times miss some of the structure in a network, we takeanother example from Ref. 5, a network representingthe schedule of games between American college foot-ball teams in a single season. Because the teams are di-vided into groups or “conferences,” with intra-conferencegames being more frequent than inter-conference games,we have a reasonable idea ahead of time about what com-munities our algorithm should find. The dendrogramgenerated by the algorithm is shown in Fig. 3, and hasan optimal modularity of Q = 0.546, which is a little shy

of the value 0.601 for the best split reported in [5]. Asthe dendrogram reveals, the algorithm finds six commu-nities. Some of them correspond to single conferences,but most correspond to two or more. The GN algorithm,by contrast, finds all eleven conferences, as well as accu-rately identifying independent teams that belong to noconference. Nonetheless, it is clear that the new algo-rithm is quite capable of picking out useful communitystructure from the network, and of course it is much thefaster algorithm. On the author’s personal computer thealgorithm ran to completion in an unmeasureably smalltime—less than a hundredth of a second. The algorithmof Girvan and Newman took a little over a second.

A time di!erence of this magnitude will not presenta big problem in most practical situations, but perfor-mance rapidly becomes an issue when we look at largernetworks; we expect the ratio of running times to in-crease with the number of vertices. Thus, for example,in applying our algorithm to the 1275-node network ofjazz musician collaborations mentioned above, we foundthat it runs to completion in about one second of CPUtime. The GN algorithm by contrast takes more thanthree hours to reach very similar results.

As an example of an analysis made possible by thespeed of the new algorithm, we have looked at a networkof collaborations between physicists as documented bypapers posted on the widely-used Physics E-print Archiveat arxiv.org. The network is an updated version of theone described in Ref. 13, in which scientists are consid-ered connected if they have coauthored one or more pa-pers posted on the archive. We analyze only the largestcomponent of the network, which contains n = 56 276 sci-entists in all branches of physics covered by the archive.Since two vertices that are unconnected by any path arenever put in the same community by our algorithm, thesmall fraction of vertices that are not part of the largestcomponent can safely be assumed to be in separate com-munities in the sense of our algorithm. Our algorithmtakes 42 minutes to find the full community structure.Our best estimates indicate that the GN algorithm wouldtake somewhere between three and five years to completeits version of the same calculation.

The analysis reveals that the network in question con-sists of about 600 communities, with a high peak modu-larity of Q = 0.713, indicating strong community struc-ture in the physics world. Four of the communities foundare large, containing between them 77% of all the ver-tices, while the others are small—see Fig. 4, left panel.The four large communities correspond closely to subjectsubareas: one to astrophysics, one to high-energy physics,and two to condensed matter physics. Thus there ap-pears to be a strong correlation between the structurefound by our algorithm and the community divisions per-ceived by human observers. It is precisely correlationof this kind that makes community structure analysis auseful tool in understanding the behavior of networkedsystems.

We can repeat the analysis with any of the subcom-

(figure from [Newman, 2004])Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 181 / 277

Page 182: Amazing, tutorial

Top-down algorithms

• select edge to remove based on “betweenness”

Three definitions

• Shortest-path betweenness: Number of shortest pathsthat the edge belongs to

• Random-walk betweenness: Expected number of paths fora random walk from u to v

• Current-flow betweenness: Resistance derived fromconsidering the graph as an electric circuit

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 182 / 277

Page 183: Amazing, tutorial

Top-down algorithms

general scheme

TopDown1. Compute betweenness value of all edges2. Remove the edge with the highest betweenness3. Recompute betweenness value of all remaining edges4. Repeat until no edges left

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 183 / 277

Page 184: Amazing, tutorial

Shortest-path betweenness

• how to compute shortest-path betweenness?

• BFS from each vertex

• leads to O(mn) for all edge betweenness

• OK if there are single paths to all vertices

s

42

1 1 2

1

1/2

1/2

1/2

1/2

s

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 184 / 277

Page 185: Amazing, tutorial

Shortest-path betweenness

s

overall time of TopDown is O(m2n)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 185 / 277

Page 186: Amazing, tutorial

Shortest-path betweenness

1

1

11

2

3

s

overall time of TopDown is O(m2n)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 186 / 277

Page 187: Amazing, tutorial

Shortest-path betweenness

1

1

11

2

31/32/3 1

7/35/6

5/6

11/6 25/6

s

overall time of TopDown is O(m2n)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 187 / 277

Page 188: Amazing, tutorial

Random-walk betweenness

• stochastic matrix of random walk is M = D−1 A

• s is the vector with 1 at position s and 0 elsewhere

• probability distribution over vertices at time n is sMn

• expected number of visits at each vertex given by∑n

sMn = s (1−M)−1

cu = E[# times passing from u to v ] =[s (1−M)−1

]u

1

du

c = s (1−M)−1 D−1 = s (D − A)−1

• define random-walk betweenness at (u, v) as |cu − cv |

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 188 / 277

Page 189: Amazing, tutorial

Random-walk betweenness

• random-walk betweenness at (u, v) is |cu − cv |with c = s (D − A)−1

• one matrix inversion O(n3)

• in total O(n3m) time with recalculation

• not scalable

• current-flow betweenness is equivalent!

[Newman and Girvan, 2004] recommend shortest-pathbetweenness

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 189 / 277

Page 190: Amazing, tutorial

Other modularity-based algorithms

spectral approach [Smyth and White, 2005]

Q =k∑

c=1

[mc

2m−(

dc

2m

)2]∝

k∑c=1

[(2m) mc − d2

c

]=

k∑c=1

(2m)n∑

i ,j=1

wijxicxjc −

(n∑

i=1

dixic

)2

=k∑

c=1

[(2m) xTc W xc − xTc D xc

]= tr(XT (W ′ − D) X )

where X = [x1 . . . xk ] = [xic ] point-cluster assignment matrix

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 190 / 277

Page 191: Amazing, tutorial

Spectral-based modularity optimization

maximize tr(XT (W ′ − D) X )

such that X is an assignment matrix

solution:LQ X = X Λ

where LQ = W ′ − D, Q-Laplacian

• standard eigenvalue problem

• but solution is fractional, we want integral

• treat rows of X as vectors and cluster graph verticesusing k-means

• [Smyth and White, 2005] propose two algorithms, basedon this idea

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 191 / 277

Page 192: Amazing, tutorial

Spectral-based modularity optimization

spectral algorithms perform almost as good as theagglomerative, but they are more efficient

organism

attribute

social relation

play

break

drive

catch

device

change

activity

folly

music

profession

learned profession

architecture

law

politics

medicine

theology

exercisecontrol

regulation lock

reproduction

judgment

estimate

discipline

training

representation

taxonomy

abstinenceinhibition

suppression

social control

government

restraint

collar

damperconfinement

imprisonment

containment

restriction

punishment

stick

detention

opinion

segregation

airbrake

band

body

brake

building

communication system

cosmography

dress

engineering

exhaust

fastener

infrastructure

instrumentality

memory

network

room settlespike

study

system

train

water system

trait

personality

character

nature

thoughtfulness

self−discipline

continence

wisdom

age

sound

majority

better

live body

body part

articulatory systemdigestive system

endocrine system

immune system

reticuloendothelial system

system

muscular structuremusculoskeletal system

nervous system system

system

reproductive systemurogenital system

respiratory systemsensory system

vascular system

skeletal systemlogicaccounting

explanation

content

gravitation

action

hypostasis

belief

doctrine

philosophy

theory

functionalism

gravitation

scientific theory

economic theory

major

frontier

knowledge domain

scientific knowledge

science

natural science

mathematics

pure mathematicsapplied mathematics

statistics

life science

medical science

agronomy

agrobiology

agrology

cognitive neuroscience

chemistry

physics

nuclear physics

atomic theory

wave theorycorpuscular theory

kinetic theoryrelativity

quantum theory

uncertainty principle

germ theory

information theory

evolution

inheritance earth science

architectonics

metallurgy

computer science

artificial intelligence

machine translation

nutrition

psychology

experimental psychology

cognitive psychologysocial psychology

information science

cognitive science

social science

anthropologyeconomics

game theory

sociology

systematicshumanistic disciplinehistory

structuralism

computational linguistics

etymology

historical linguistics

linguistics

grammar

syntax

lexicologysemantics

sound law

synchronic linguistics military science

judiciary

hierarchy

social organization

growthanabolism bodily process

catabolism

gastrulation

Krebs cycle

metabolism

natural process

organic process

oxidative phosphorylation

parturitiontransduction

transpiration

prime

make

grow

suspend

build up

develop

redevelop

prepare

build

mature

evolve

work out

elaborate

expand

happen

translate

complicate

socialize

cram

modernize

explicate

generateoriginate

create

cultivate

mortify

solarize

educate

amercepunish

great

leading/p/

scientific

technological

unscientific

pseudoscientific

Figure 2: Clusters for WordNet data, k = 12 (best viewed in color).

0 10 20 30 40 500

0.1

0.2

0.3

0.4

0.5

0.6

0.7

K

Q

normalized Qstandard Qtransition matrix

Figure 3: Q versus k for the WordNet data.

Ruppin E,Horn D,Shadmehr R

Morgan N,Rumelhart D,Keeler JBower J,Abu-Mostafa Y,Hasselmo M

Goodman R,Moore A,Atkeson C

Coolen A,Saad D,Hertz J

Alspector J,Meir R,Allen R

Barto A,Singh S,Sutton R

Bengio Y,Denker J,LeCun Y

Tresp V,Tsitsiklis J,Atlas L

Sejnowski T,Hinton G,Dayan P

Mozer M,Lee S,Jang J

Platt J,Smola A,Scholkopf B

Waibel A,Amari S,Tebelskis J

Moody J,Mjolsness E,Leen T

Tishby N,Warmuth M,Singer Y

Cauwenberghs G,Andreou A,Edwards R

Robinson A,de-Freitas J,Niranjan M

Wiles J,Pollack J,Blair A

Koch C,Bialek W,DeWeerth S

Eeckman F,Buhmann J,Baird B

Giles C,Cottrell G,Lippmann RBaldi P,Venkatesh S,Psaltis D

Thrun S,Baluja S,Merzenich M

Seung H,Lee D,vanHemmen J

Jordan M,Ghahramani Z,Saul L

Touretzky D,Spence C,Pearson J

Geiger D,Poggio T,Girosi F

Maass W,Zador A,Sontag E

Pentland A,Darrell T,Jebara T

Kawato M,Principe J,Vatikiotis-Bateson E

Nadal J,Personnaz L,Dreyfus G

Figure 6: Clustering for NIPS co-authorship data, k = 31 (best viewed in color).

0 20 40 60 80 1000

0.2

0.4

0.6

0.8

1

KQ

Spectral−1Spectral−2Newman

Figure 7: Q versus k for NIPS coauthorship data.

[Smyth and White, 2005]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 192 / 277

Page 193: Amazing, tutorial

Other modularity-based algorithms

mathematical programming [Agarwal and Kempe, 2008]

Q ∝n∑

i ,j=1

Bij(1− xij)

where

xij =

{0 if i and j get assigned to the same cluster1 otherwise

it should be

xik ≤ xij + xjk for all vertices i , j , k

solve the integer program with triangle inequality constraints

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 193 / 277

Page 194: Amazing, tutorial

Mathematical-programming approach

for modularity optimization

[Agarwal and Kempe, 2008]

• integer program is NP-hard

• relax integrality constraints

replace xij ∈ {0, 1} with 0 ≤ xij ≤ 1

• corresponding linear program can be solved in polynomialtime

• solve linear program and round the fractional solution

• place in the same cluster vertices i and j if xij is small

(pivot algorithm [Ailon et al., 2008])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 194 / 277

Page 195: Amazing, tutorial

ResultsGaurav Agarwal, David Kempe: Modularity-Maximizing Graph Communities via Mathematical Programming 9

Network size n GN DA EIG VP LP UBKARATE 34 0.401 0.419 0.419 0.420 0.420 0.420DOLPH 62 0.520 - - 0.526 0.529 0.531MIS 76 0.540 - - 0.560 0.560 0.561BOOKS 105 - - 0.526 0.527 0.527 0.528BALL 115 0.601 - - 0.605 0.605 0.606JAZZ 198 0.405 0.445 0.442 0.445 0.445 0.446COLL 235 0.720 - - 0.803 0.803 0.805META 453 0.403 0.434 0.435 0.450 - -EMAIL 1133 0.532 0.574 0.572 0.579 - -

Table 2. The modularity obtained by many of the previouslypublished methods and by the methods introduced in this pa-per, along with the upper bound.

any clustering; it seems quite plausible that the clusteringproduced by our algorithms is in fact optimal.

Since the running time of the LP and VP roundingalgorithms is significantly larger than for past heuristics,we also compare them with Simulated Annealing [49], aslower and more exhaustive algorithm. For this compari-son, we report both the modularity values obtained andthe running time of the di!erent algorithms. For SimulatedAnnealing, we chose three cooling schedules, 0.999, 0.99and 0.95. As mentioned above, all the running times weremeasured on a Linux-based Intel PC with two 3.2GHz pro-cessors and 2GB of RAM. For readability, we omit fromthe table below the modularity obtained by the LP algo-rithm, which is given in Table 2 and identical to the onefor the VP algorithm, except for the DOLPH network.We also omit the results for the cooling schedule of 0.99.Both the modularity obtained and the running time werebetween the ones for 0.999 and 0.95.

Network SA (0.999) SA (0.95) VP LPKARATE 0.420 [0:12] 0.420 [0:02] 0.420 [0:06] [0:02]DOLPH 0.528 [2:55] 0.527 [0:05] 0.526 [0:09] [0:04]MIS 0.560 [4:22] 0.556 [0:10] 0.560 [0:11] [0:04]BOOKS 0.527 [13:02] 0.527 [0:26] 0.527 [0:12] [0:28]BALL 0.605 [4:10] 0.604 [0:06] 0.605 [0:23] [0:18]JAZZ 0.445 [58:05] 0.445 [2:50] 0.445 [0:24] [29:22]COLL 0.799 [25] 0.799 [0:32] 0.803 [1:45] [32:21]META 0.450 [146] 0.445 [9:02] 0.450 [1:30] -EMAIL 0.579 [1143] 0.575 [40:12] 0.579 [15:08] -

Table 3. The modularity and running times (in minutes andseconds) of our algorithms as well as Simulated Annealing withdi!erent cooling schedules.

Notice that the results obtained by our algorithm areonly inferior for one data set to Simulated Annealing withthe slowest cooling schedule. For all other data sets andschedules, our algorithms match or outperform SimulatedAnnealing, even while taking comparable or less time thanthe faster cooling schedules.

5 Conclusion

We have shown that the technique of rounding solutionsto fractional mathematical programs yields high-qualitymodularity maximizing communities, while also providinga useful upper bound on the best possible modularity. Thedrawback of our algorithms is their resource requirement.Due to !(n3) constraints in the LP, and !(n2) variablesin the VP, the algorithms currently do not scale beyondabout 300 resp. 4000 nodes. Thus, a central goal for fu-ture work would be to improve the running time withoutsacrificing solution quality. An ideal outcome would be apurely combinatorial algorithm avoiding the explicit solu-tion to the mathematical programs, but yielding the sameperformance.

Secondly, while our algorithms perform very well on allnetworks we considered, they do not come with a prioriguarantees on their performance. Heuristics with such per-formance guarantees are called approximation algorithms[29], and are desirable because they give the user a hardguarantee on the solution quality, even for pathologicalnetworks. Since the algorithms of Charikar et al. and Goe-mans and Williamson on which our approaches are baseddo have provable approximation guarantees, one wouldhope that similar guarantees could be attained for modu-larity maximization. However, this does not hold for theparticular algorithms we use, due to the shift of the ob-jective function by a constant. Obtaining approximationalgorithms for modularity maximization thus remains achallenging direction for future work.

Acknowledgments

We would like to thank Aaron Clauset, Cris Moore, MarkNewman and Ashish Vaswani for useful discussions andadvice, Fernando Ordonez for providing computational re-sources, and Roger Guimera for sharing his implementa-tion of Simulated Annealing. We also thank several anony-mous reviewers for helpful feedback on previous versionsof the paper. David Kempe has been supported in part byNSF CAREER Award 0545855.

References

1. M. Newman, A. Barabasi, and D. Watts. The Structureand Dynamics of Networks. Princeton University Press,2006.

2. J. Scott. Social Network Analysis: A Handbook. Sage Pub-lications, second edition, 2000.

3. S. Wasserman and K. Faust. Social Network Analysis.Cambridge University Press, 1994.

4. J. Kleinberg, R. Kumar, P. Raghavan, S. Rajagopalan, andA. Tomkins. The web as a graph: Measurements, modelsand methods. In International Conference on Combina-torics and Computing, 1999.

5. R. Guimera and L. Amaral. Functional cartography ofcomplex metabolic networks. Nature, 433:895–900, 2005.

(table from [Agarwal and Kempe, 2008])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 195 / 277

Page 196: Amazing, tutorial

Need for scalable algorithms

• spectral, agglomerative, LP-based algorithms

• not scalable to very large graphs

• handle datasets with billions of vertices and edges

• facebook: ∼ 1 billion users with avg degree 130

• twitter: ≥ 1.5 billion social relations

• google: web graph more than a trillion edges (2011)

• design algorithms for streaming scenarios

• real-time story identification using twitter posts

• election trends, twitter as election barometer

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 196 / 277

Page 197: Amazing, tutorial

Graph partitioning

• graph partitioning is a way to split the graph vertices inmultiple machines

• graph partitioning objectives guarantee lowcommunication overhead among different machines

• additionally balanced partitioning is desirable

G = (V, E)

Sunday, August 4, 13

• each partition contains ≈ n/k vertices

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 197 / 277

Page 198: Amazing, tutorial

Off-line k-way graph partitioning

METIS algorithm [Karypis and Kumar, 1998]

• popular family of algorithms and software

• multilevel algorithm

• coarsening phase in which the size of the graph issuccessively decreased

• followed by bisection (based on spectral or KL method)

• followed by uncoarsening phase in which the bisection issuccessively refined and projected to larger graphs

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 198 / 277

Page 199: Amazing, tutorial

Off-line k-way graph partitioning

Krauthgamer, Naor and Schwartz [Krauthgamer et al., 2009]

• problem: minimize number of edges cut, subject tocluster sizes Θ(n/k)

• approximation guarantee: O(√

log k log n)

• based on the work of Arora-Rao-Vazirani for thesparsest-cut problem (k = 2) [Arora et al., 2009]

• Is it scalable practical algorithm?

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 199 / 277

Page 200: Amazing, tutorial

streaming k-way graph partitioning

• input is a data stream

• graph is ordered• arbitrarily• breadth-first search• depth-first search

• generate an approximately balanced graph partitioning

graph streampartitioner

⇥(n/k)each partitionholds vertices

Monday, August 5, 13

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 200 / 277

Page 201: Amazing, tutorial

Graph representations

• adjacency stream

• at time t, a vertex arrives with its neighbors

• edge stream

• at time t, an edge arrives

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 201 / 277

Page 202: Amazing, tutorial

Partitioning strategies

• hashing: place a new vertex to a cluster/machine chosenuniformly at random

• neighbors heuristic: place a new vertex to thecluster/machine with the maximum number of neighbors

• non-neighbors heuristic: place a new vertex to thecluster/machine with the minimum number ofnon-neighbors

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 202 / 277

Page 203: Amazing, tutorial

Partitioning strategies

[Stanton and Kliot, 2012]

• dc(v): neighbors of v in cluster c

• tc(v): number of triangles that v participates in cluster c

• balanced: Vertex v goes to cluster with least number ofvertices

• hashing: random assignment

• weighted degree: v goes to cluster c that maximizesdc(v) · w(c)

• weighted triangles: v goes to cluster j that maximizestc(v)/

(dc (v)2

)· w(c)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 203 / 277

Page 204: Amazing, tutorial

Weight functions

• sc : number of vertices in cluster c

• unweighted: w(c) = 1

• linearly weighted: w(c) = 1− sc(k/n)

• exponentially weighted: w(c) = 1− e(sc−n/k)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 204 / 277

Page 205: Amazing, tutorial

fennel algorithm

[Tsourakakis et al., 2012]

minimize P=(S1,...,Sk ) |∂ e(P)|

subject to |Si | ≤ νn

k, for all 1 ≤ i ≤ k

• hits the arv barrier

minimize P=(S1,...,Sk ) |∂ E (P)|+ cIN(P)

where cIN(P) =∑

i s(|Si |), so that objective self-balances

• relax hard cardinality constraints

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 205 / 277

Page 206: Amazing, tutorial

fennel algorithm

[Tsourakakis et al., 2012]

• for S ⊆ V f (S) = e[S ]− α|S |γ, with γ ≥ 1

• given partition P = (S1, . . . , Sk) of V in k parts define

g(P) = f (S1) + . . . + f (Sk)

• the goal: maximize g(P) over all possible k-partitions

• notice:g(P) =

∑i

e[S1]︸ ︷︷ ︸number ofedges cut

− α∑i

|Si |γ︸ ︷︷ ︸minimized for

balanced partition!

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 206 / 277

Page 207: Amazing, tutorial

Connection

notice

f (S) = e[S ]− α(|S |2

),

• related to modularity

• related to quasicliques (see next)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 207 / 277

Page 208: Amazing, tutorial

fennel algorithm

theorem [Tsourakakis et al., 2012]

• γ = 2 gives approximation factor log(k)/k

where k is the number of clusters

• random partitioning gives approximation factor 1/k

• no dependence on n

mainly because relaxing the hard cardinality constraints

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 208 / 277

Page 209: Amazing, tutorial

fennel algorithm — greedy scheme

• γ = 2 gives non-neighbors heuristic ???

• γ = 1 gives neighbors heuristic

• interpolate between the two heuristics, e.g., γ = 1.5

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 209 / 277

Page 210: Amazing, tutorial

fennel algorithm — greedy scheme

graph streampartitioner

⇥(n/k)each partitionholds vertices

Monday, August 5, 13

• send v to the partition / machine that maximizes

f (Si ∪{v})− f (Si)

= e[Si ∪ {v}]− α(|Si |+ 1)γ − (e[Si ]− α|Si |γ)

≈ dSi (v)− α|Si |γ−1 ???

• fast, amenable to streaming and distributed setting

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 210 / 277

Page 211: Amazing, tutorial

fennel algorithm — results

λ =#{edges cut}

mρ = max

1≤i≤k

|Si |n/k

Fennel METISm k � ⇢ � ⇢

7 185 314 4 62.5 % 1.04 65.2% 1.026 714 510 8 82.2 % 1.04 81.5% 1.026 483 201 16 92.9 % 1.01 92.2% 1.026 364 819 32 96.3% 1.00 96.2% 1.026 308 013 64 98.2% 1.01 97.9% 1.026 279 566 128 98.4 % 1.02 98.8% 1.02

Table 4: Fraction of edges cut � and normalizedmaximum load ⇢ for Fennel and METIS [29] averagedover 5 random graphs generated according to theHP(5000,0.8,0.5) model. As we see, Fennel despiteits small computational overhead and deciding on-the-fly where each vertex should go, achieves com-parable performance to METIS.

• Linear Weighted Deterministic Greedy (LDG): place v

to Si that maximizes |N(v) \ Si| ⇥ (1 � |Si|nk

).

• Exponentially Weighted Deterministic Greedy (EDG):

place v to Si that maximizes |N(v)\Si|⇥⇣1�exp

�|Si| � n

k

�⌘.

• Triangles (T): place v to Si that maximizes tSi(v).

• Linear Weighted Triangles (LT): place v to Si that

maximizes tSi(v) ⇥⇣1 � |Si|

nk

⌘.

• Exponentially Weighted Triangles (ET): place v to Si

that maximizes tSi(v) ⇥⇣1 � exp

�|Si| � n

k

�⌘.

• Non-Neighbors (NN): place v to Si that minimizes |Si\N(v)|.

In accordance with [54], we observed that LDG is the bestperforming heuristic. Even if Stanton and Kliot do not com-pare with NN, LDG outperforms it also. Non-neighbors typ-ically have very good load balancing properties, as LDG aswell, but cut significantly more edges. Table 3 shows thetypical performance we observe across all datasets. Specif-ically, it shows � and ⇢ for both BFS and random orderfor amazon0312. DFS order is omitted since qualitatively itdoes not di↵er from BFS. We observe that LDG is the bestcompetitor, Fennel outperforms all existing competitors andis inferior to METIS, but of comparable performance. Inwhatever follows, whenever we refer to the best competi-tor, unless otherwise mentioned we refer to LDG. Time-wiseMETIS is the fastest, taking 11.4 seconds to run. Hashingfollows with 12 seconds and the rest of the methods exceptfor T, LT, ET take the same time up the integer part, i.e., 13seconds. Triangle based methods take about 10 times moretime. Existing approximate counting methods can mitigatethis [57, 58]. It is also worth emphasizing that for largergraphs Fennel is faster than METIS.

5.2 Synthetic DatasetsBefore we delve into our findings, it is worth summarizing

the main findings of this section. (a) For all synthetic graphswe generated, the value � = 3

2achieves the best performance

pointwise, not in average. (b) The e↵ect of the stream or-der is minimal on the results. Specifically, when � � 3

2all

orders result in the same qualitative results. When � < 32

BFS and DFS orders result in the same results which areworse with respect to load balancing –and hence better forthe edge cuts– compared to the random order. (c) Fennel’sperformance is comparable to METIS.

Hidden Partition: We report averages over five randomlygenerated graphs according to the model HP(5000, k, 0.8, 0.5)for each value of k we use. We study (a) the e↵ect of theparameter �, which parameterizes the function c(x) = ↵x� ,and (b) the e↵ect of the number of clusters k.

We range � from 1 to 4 with a step of 1/4, for six di↵erentvalues of k shown in the second column of Table 4. Forall k, we observe, consistently, the following behavior: for� = 1 we observe that � = 0 and ⇢ = k. This means thatone cluster receives all vertices. For any � greater than 1,we obtain excellent load balancing with ⇢ ranging from 1 to1.05, and the same fraction of edges cut with METIS up thethe first decimal digit. This behavior was not expected apriori, since in general we expect � shifting from small tolarge values and see ⇢ shifting from large to small valuesas � grows. Given the insensitivity of Fennel to � in thissetting, we fix � = 3

2and present in Table 4 our findings. For

each k shown in the second column we generate five randomgraphs. The first column shows the average number of edges.Notice that despite the fact that we have only 5,000 vertices,we obtain graphs with several millions of edges. The fourlast columns show the performance of Fennel and METIS.As we see, their performance is comparable and in one case(k=128) Fennel clearly outperforms METIS.

Power Law: It is well known that power law graphs haveno good cuts [23], but they are commonly observed in prac-tice. We examine the e↵ect of parameter � for k fixed to10. In contrast to the hidden partition experiment, we ob-serve the expected tradeo↵ between � and ⇢ as � changes.We generate five random power law graphs CL(20 000,2.5),since this value matches the slope of numerous real-worldnetworks [45]. Figure 1 shows the tradeo↵ when � rangesfrom 1 to 4 with a step of 0.25 for the random stream order.The straight line shows the performance of METIS. As wesee, when � < 1.5, ⇢ is unacceptably large for demandingreal-world applications. When � = 1.5 we obtain essentiallythe same load balancing performance with METIS. Specifi-cally, ⇢Fennel = 1.02, ⇢METIS = 1.03. The corresponding cutbehavior for � = 1.5 is �Fennel = 62.58%,�METIS = 54.46%.Furthermore, we experimented with the random, BFS andDFS stream orders. We observe that the only major di↵er-ence between the stream orders is obtained for � = 1.25. Forall other � values the behavior is identical. For � = 1.25 weobserve that BFS and DFS stream orders result in signifi-cantly worse load balancing properties. Specifically, ⇢BFS =3.81, ⇢DFS = 3.73, ⇢Random = 1.7130. The correspondingfractions of edges cut are �BFS = 37.83%, �DFS = 38.85%,and �Random = 63.51%.

5.3 Real-World DatasetsAgain, before we delve into the details of the experimen-

tal results, we summarize the main points of this Section:(1) Fennel is superior to existing streaming partitioning al-gorithms. Specifically, it consistently, over a wide range of kvalues and over all datasets, performs better than the cur-rent state-of-the-art. Fennel achieves excellent load balanc-ing with significantly smaller edge cuts. (2) For smaller val-ues of k (less or equal than 64) the observed gain is morepronounced. (c) Fennel is fast. Our implementation scales

• γ = 1.5

• comparable results in quality, but fennel is lightway,fast, and streamable

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 211 / 277

Page 212: Amazing, tutorial

Conclusions (graph partitioning)

summary

• spectral techniques, modularity-based methods,graph partitioning

• well-studied and mature area

future directions

• develop alternative notions for communities,e.g., accounting for graph labels, constraints, etc.

• further improve efficiency of methods

• overlapping communities

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 212 / 277

Page 213: Amazing, tutorial

Dense subgraphs

Page 214: Amazing, tutorial

What is a dense subgraph?

• a set of vertices with abundance of edges

• a highly connected subgraph

• key primitive for detectiving communities

• related problem to community detection andgraph partitioning, but not identical

• not constrainted for a disjoint partition of all vertices

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 214 / 277

Page 215: Amazing, tutorial

Applications of finding dense subgraphs

• thematic communities and spam link farms[Kumar et al., 1999]

• graph visualization [Alvarez-Hamelin et al., 2005]

• real-time story identification [Angel et al., 2012]

• motif detection [Fratkin et al., 2006]

• epilepsy prediction [Iasemidis et al., 2003]

• finding correlated genes [Zhang and Horvath, 2005]

• many more ...

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 215 / 277

Page 216: Amazing, tutorial

Density measures

• consider subgraph induced by S ⊆ V of G = (V ,E )

• clique: each vertex in S is connectedto every other vertex in S

• α-quasiclique: the set S has at least α|S |(|S | − 1)/2edges

• k-core: every vertex in S is connected to at least k othervertices in S

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 216 / 277

Page 217: Amazing, tutorial

Density measures

• consider subgraph induced by S ⊆ V of G = (V ,E )

• density:

δ(S) =e[S ](|S |

2

) =2e[S ]

|S |(|S | − 1)

• average degree:

d(S) =2e[S ]

|S |

• k-densest subgraph:

δ(S) =2e[S ]

|S |, such that |S | = k

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 217 / 277

Page 218: Amazing, tutorial

Density measures

compare with measures we saw previously....

graph expansion:

α(G ) = minS

e[S ,V \ S ]

min{|S |, |V \ S |}

graph conductance:

φ(G ) = minS⊆V

e[S ,V \ S ]

min{vol(S), vol(V \ S)}

edges within (e[S ]) instead of edges accross (e[S ,V \ S ])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 218 / 277

Page 219: Amazing, tutorial

Complexity of density problems — clique

• find the max-size clique in a graph:NP-hard problem

• strong innaproximability result:

for any ε > 0, there cannot be a polynomial-timealgorithm that approximates the maximum clique problemwithin a factor better than O(n1−ε), unless P = NP

[Hastad, 1997]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 219 / 277

Page 220: Amazing, tutorial

Complexity of other density problems

density δ(S) = e[S]

(|S|2 )pick a single edge

average degree d(S) = 2e[S]|S| in P

k-densest subgraph δ(S) = 2e[S]|S | , |S | = k NP-hard

DalkS δ(S) = 2e[S]|S | , |S | ≥ k NP-hard

DamkS δ(S) = 2e[S]|S | , |S | ≤ k L-reduction to DkS

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 220 / 277

Page 221: Amazing, tutorial

Densest subgraph problem

• find set of vertices S ⊆ V with maximum average degreed(S) = 2e[S ]/|S |

• solvable in polynomial time

• max-flow [Goldberg, 1984]

• LP relaxation [Charikar, 2000]

• simple linear-time greedy algorithm gives factor-2approximation [Charikar, 2000]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 221 / 277

Page 222: Amazing, tutorial

Greedy algorithm for densest subgraph

[Charikar, 2000]

input: undirected graph G = (V ,E )output: S , a dense sungraph of G1 set Gn ← G2 for k ← n downto 12.1 let v be the smallest degree vertex in Gk

2.2 Gk−1 ← Gk \ {v}3 output the densest subgraph among Gn,Gn−1, . . . ,G1

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 222 / 277

Page 223: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 223 / 277

Page 224: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 224 / 277

Page 225: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 225 / 277

Page 226: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 226 / 277

Page 227: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 227 / 277

Page 228: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 228 / 277

Page 229: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 229 / 277

Page 230: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 230 / 277

Page 231: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 231 / 277

Page 232: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 232 / 277

Page 233: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 233 / 277

Page 234: Amazing, tutorial

Greedy algorithm for densest subgraph — example

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 234 / 277

Page 235: Amazing, tutorial

Other notions and generalizations

• k-core: every vertex in S is connected to at least k othervertices in S

• α-quasiclique: the set S has at least α|S |(|S | − 1)/2edges

• enumerate all α-quasicliques [Uno, 2010]

• dense subgraphs of directed graphs: find sets S ,T ⊆ Vto maximize

d(S ,T ) =e[S ,T ]√|S | |T |

[Charikar, 2000, Khuller and Saha, 2009]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 235 / 277

Page 236: Amazing, tutorial

Edge-surplus framework

• for a set of vertices S define edge surplus

f (S) = g(e[S ])− h(|S |)

where g and h are both strictly increasing

• Optimal (g , h)-edge-surplus problem:

find S∗ such that

f (S∗) ≥ f (S), for all sets S ⊆ S∗

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 236 / 277

Page 237: Amazing, tutorial

Edge-surplus framework

• edge surplus f (S) = g(e[S ])− h(|S |)

• example 1g(x) = h(x) = log x

find S that maximizes log e[S]|S |

densest-subgraph problem

• example 2

g(x) = x , h(x) =

{0 if x = k+∞ otherwise

k-densest-subgraph problem

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 237 / 277

Page 238: Amazing, tutorial

The optimal quasiclique problem

• edge surplus f (S) = g(e[S ])− h(|S |)

• consider

g(x) = x , h(x) = αx(x − 1)

2

find S that maximizes e[S ]− α(|S|

2

)optimal quasiclique problem [Tsourakakis et al., 2013]

• theorem: let g(x) = x and h(x) concave.Then the optimal (g , h)-edge-surplus problem ispolynomially-time solvable

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 238 / 277

Page 239: Amazing, tutorial

The optimal quasiclique problem

theorem: let g(x) = x and h(x) concave.Then the optimal (g , h)-edge-surplus problem ispolynomially-time solvable

proof

g(x) = x is supermodular

if h(x) concave h(x) is submodular

−h(x) is supermodular

g(x)− h(x) is supermodular

maximizing supermodular functions is solvable inpolynomial time

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 239 / 277

Page 240: Amazing, tutorial

Optimal quasicliques in practice

densest subgraph vs. optimal quasiclique

fined as 2e[S]|S| The densest-subgraph problem is to find a set

S that maximizes the average degree. The densest subgraphcan be identified in polynomial time by solving a parametricmaximum-flow problem [17, 19]. Charikar [10] shows thatthe greedy algorithm proposed by Asashiro et al. [6] pro-duces a 1

2-approximation of the densest subgraph in linear

time.In the classic definition of densest subgraph there is no

size restriction of the output. When restrictions on the size|S| are imposed, the problem becomes NP-hard. Specifi-cally, the DkS problem of finding the densest subgraph of kvertices is known to be NP-hard [5]. For general k, Feigeet al. [14] provide an approximation guarantee of O(n↵),where ↵ < 1

3. The greedy algorithm by Asahiro et al. [6]

gives instead an approximation factor of O(nk). Better ap-

proximation factors for specific values of k are provided byalgorithms based on semidefinite programming [15]. Fromthe perspective of (in)approximability, Khot [22] shows thatthere cannot exist any PTAS for the DkS problem under areasonable complexity assumption. Arora et al. [4] proposea PTAS for the special case k = ⌦(n) and m = ⌦(n2). Fi-nally, two variants of the DkS problem are introduced byAndersen and Chellapilla [2]. The two problems ask for theset S that maximizes the average degree subject to |S| k(DamkS) and |S| � k (DalkS), respectively. They provideconstant factor approximation algorithms for DalkS and ev-idence that DamkS is hard. The latter was verified by [23].

Quasi-cliques. A set of vertices S is an ↵-quasi-clique ife[S] � ↵

�|S|2

�, i.e., if the edge density of the induced sub-

graph G[S] exceeds a threshold parameter ↵ 2 (0, 1). Simi-larly to cliques, maximum quasi-cliques and maximal quasi-cliques [8] are quasi-cliques of maximum size and quasi-cliques not contained into any other quasi-clique, respec-tively. Abello et al. [1] propose an algorithm for finding asingle maximal ↵-quasi-clique, while Uno [31] introduces analgorithm to enumerate all ↵-quasi-cliques.

1.2 ContributionsExtracting the densest subgraph (i.e., finding the sub-

graph that maximizes the average degree) is particularlyattractive as it can be solved exactly in polynomial timeor approximated within a factor of 2 in linear time. Indeedit is a popular choice in many applications. However, as wewill see in detail next, maximizing the average degree tendsto favor large subgraphs with not very large edge density�. The prototypical dense graph is the clique, but, as dis-cussed above, finding the largest clique is inapproximable.Also, the clique definition is too strict in practice, as noteven a single edge can be missed from an otherwise densesubgraph. This observation leads to the definition of quasi-clique, whose underlying intuition is the following: assumingthat each edge in a subgraph G[S] exists with probability ↵,

then the expected number of edges in G[S] is ↵�|S|

2

�. Thus,

the condition of the ↵-quasi-clique expresses the fact thatthe subgraph G[S] has more edges than those expected bythis binomial model.

Motivated by this definition, we turn the quasi-clique con-dition into an objective function. In particular, we define thedensity function f↵(S) = e[S]� ↵

�|S|2

�, which expresses the

edge surplus of a set S over the expected number of edgesunder the random-graph model. We consider the problem offinding the best ↵-quasi-clique, i.e., a set of vertices S thatmaximizes the function f↵(S). We refer to the subgraphs

Table 1: Di↵erence between densest subgraph andoptimal quasi-clique on some popular graphs. � =e[S]/

�|S|2

�is the edge density of the extracted sub-

graph, D is the diameter, and ⌧ = t[S]/�|S|

3

�is the

triangle density.densest subgraph optimal quasi-clique

|S||V | � D ⌧

|S||V | � D ⌧

Dolphins 0.32 0.33 3 0.04 0.12 0.68 2 0.32Football 1 0.09 4 0.03 0.10 0.73 2 0.34

Jazz 0.50 0.34 3 0.08 0.15 1 1 1Celeg. N. 0.46 0.13 3 0.05 0.07 0.61 2 0.26

that maximize f↵(S) as optimal quasi-cliques. To the bestof our knowledge, the problem of extracting optimal quasi-cliques from a graph has never been studied before. Weshow that optimal quasi-cliques are subgraphs of high qual-ity, with edge density � much larger than densest subgraphsand with smaller diameter. We also show that our novel den-sity function comes indeed from a more general frameworkwhich subsumes other well-known density functions and hasappreciable theoretical properties.

Our contributions are summarized as follows.

• We introduce a general framework for finding dense sub-graphs, which subsumes popular density functions. Weprovide theoretical insights into our framework: show-ing that a large family of objectives are e�ciently solv-able while other subcases are NP-hard.

• As a special instance of our framework, we introducethe novel problem of extracting optimal quasi-cliques.

• We design two e�cient algorithms for extracting opti-mal quasi-cliques. The first one is a greedy algorithmwhere the smallest-degree vertex is repeatedly removedfrom the graph, and achieves an additive approximationguarantee. The second algorithm is a heuristic based onthe local-search paradigm.

• Motivated by real-world scenarios, we define interestingvariants of our original problem definition: (i) findingthe top-k optimal quasi-cliques, and (ii) finding optimalquasi-cliques that contain a given set of vertices.

• We extensively evaluate our algorithms and problemvariants on numerous datasets, both synthetic andreal, showing that they produce high-quality dense sub-graphs, which clearly outperform densest subgraphs. Wealso present applications of our problem in data-miningand bioinformatics tasks, such as forming a successfulteam of domain experts and finding highly-correlatedgenes from a microarray dataset.

1.3 A preview of the resultsTable 1 compares our optimal quasi-cliques with densest

subgraphs on some popular graphs.1 The results in the tableclearly show that optimal quasi-cliques have much larger edgedensity than densest subgraphs, smaller diameters and largertriangle densities. Moreover, densest subgraphs are usuallyquite large-sized: in the graphs we report in Table 1, thedensest subgraphs contain always more than the 30% of thevertices in the input graph. For instance, in the Football

1Densest subgraphs are extracted here with the exact Goldberg’s algo-

rithm [19]. As far as optimal quasi-cliques, we optimize f↵ with ↵ = 13

and use our local-search algorithm.

[Tsourakakis et al., 2013]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 240 / 277

Page 241: Amazing, tutorial

Finding and optimal quasiclique

adaptation of the greedy algorithm of [Charikar, 2000]

input: undirected graph G = (V ,E )output: a quasiclique S1 set Gn ← G2 for k ← n downto 12.1 let v be the smallest degree vertex in Gk

2.2 Gk−1 ← Gk \ {v}3 output the subgraph in Gn, . . . ,G1 that maximizes f (S)

additive approximation guarantee [Tsourakakis et al., 2013]

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 241 / 277

Page 242: Amazing, tutorial

top-k densest subgraphs and quasicliques

Table 3: Densest subgraphs extracted with Charikar’s method vs. optimal quasi-cliques extracted with the pro-posed GreedyOQC algorithm (greedy) and LocalSearchOQC algorithm (ls). � = e[S]/

�|S|2

�is the edge density

of the extracted subgraph S, D is the diameter, and ⌧ = t[S]/�|S|

3

�is the triangle density.

|S| � D ⌧densest opt. quasi-clique densest opt. quasi-clique densest opt. quasi-clique densest opt. quasi-clique

subgraph greedy ls subgraph greedy ls subgraph greedy ls subgraph greedy lsDolphins 19 13 8 0.27 0.47 0.68 3 3 2 0.05 0.12 0.32Polbooks 53 13 16 0.18 0.67 0.61 6 2 2 0.02 0.28 0.24Adjnoun 45 16 15 0.20 0.48 0.60 3 3 2 0.01 0.10 0.12Football 115 10 12 0.09 0.89 0.73 4 2 2 0.03 0.67 0.34

Jazz 99 59 30 0.35 0.54 1 3 2 1 0.08 0.23 1Celeg. N. 126 27 21 0.14 0.55 0.61 3 2 2 0.07 0.20 0.26Celeg. M. 44 22 17 0.35 0.61 0.67 3 2 2 0.07 0.26 0.33

Email 289 12 8 0.05 1 0.71 4 1 2 0.01 1 0.30AS-22july06 204 73 12 0.40 0.53 0.58 3 2 2 0.09 0.19 0.20Web-Google 230 46 20 0.22 1 0.98 3 2 2 0.03 0.99 0.95

Youtube 1874 124 119 0.05 0.46 0.49 4 2 2 0.02 0.12 0.14AS-Skitter 433 319 96 0.41 0.53 0.49 2 2 2 0.10 0.19 0.13

Wiki ’05 24555 451 321 0.26 0.43 0.48 3 3 2 0.02 0.06 0.10Wiki ’06/9 1594 526 376 0.17 0.43 0.49 3 3 2 0.10 0.06 0.11

Wiki ’06/11 1638 527 46 0.17 0.43 0.56 3 3 2 0.31 0.06 0.35

Our main goal is to compare our optimal quasi-cliques withdensest subgraphs. For extracting optimal quasi-cliques, weinvolve both our proposed algorithms, i.e., GreedyOQCand LocalSearchOQC, which, following the discussion inSection 3.1, we run with ↵ = 1

3(for LocalSearchOQC, we

also set Tmax = 50). For finding densest subgraphs, we usethe Goldberg’s exact algorithm [19] for small graphs, whilefor graphs whose size does not allow the Goldberg’s algo-rithm to terminate in reasonable time we use the Charikar’s12-approximation algorithm [10].All algorithms are implemented in java, and all experi-

ments are performed on a single machine with Intel Xeoncpu at 2.83GHz and 50GB ram.

5.1 Real-world graphsResults on real graphs are shown in Table 3. We compare

optimal quasi-cliques outputted by the proposed Greedy-OQC and LocalSearchOQC algorithms with densest sub-graphs extracted with the Charikar’s algorithm. Particu-larly, we use the Charikar’s method to be able to handlethe largest graphs. For consistency, Table 3 reports on re-sults achieved by Charikar’s method also for the smallestgraphs. We recall that the results in Table 1 in the Intro-duction refer instead to the exact Goldberg’s method. How-ever, a comparison of the two tables on their common rowsshows that the Charikar’s algorithm, even though it is ap-proximate, produces almost identical results with the resultsproduced by the Goldberg’s algorithm.

Table 3 clearly confirms the preliminary results reportedin the Introduction: optimal quasi-cliques have larger edgeand triangle densities, and smaller diameter than densestsubgraphs. Particularly, the edge density of optimal quasi-cliques is evidently larger on all graphs. For instance, onFootball and Youtube, the edge density of optimal quasi-cliques (for both the GreedyOQC and LocalSearchOQCalgorithms) is about 9 times larger than the edge den-sity of densest subgraphs, while on Email the di↵erence in-creases up to 20 times (GreedyOQC) and 14 times (Local-SearchOQC). Still, the triangle density of the optimalquasi-cliques outputted by both GreedyOQC and Local-SearchOQC is one order of magnitude larger than the tri-angle density of densest subgraphs on 11 out of 15 graphs.

Figure 1: Edge density and diameter of the top-10 subgraphs found by our GreedyOQC and Local-SearchOQC methods, and Charikar’s algorithm, onthe AS-skitter graph (top) and the Wikipedia 2006/11graph (bottom).

Comparing our two algorithms to each other, we cansee that LocalSearchOQC performs generally better thanGreedyOQC. Indeed, the edge density achieved by Local-SearchOQC is higher than that of GreedyOQC on 10 outof 15 graphs, while the diameter of the LocalSearchOQCoptimal quasi-cliques is never larger than the diameter of theGreedyOQC optimal quasi-cliques.

Concerning e�ciency, all algorithms are linear in the num-ber of edges of the graph. Charikar’s and GreedyOQCalgorithm are somewhat slower than LocalSearchOQC,but mainly due to bookkeeping. LocalSearchOQC algo-rithm’s running times vary from milliseconds for the smallgraphs (e.g., 0.004s for Dolphins, 0.002s for Celegans N.), fewseconds for the larger graphs (e.g., 7.94s for Web-Google and3.52s for Youtube) and less than one minute for the largestgraphs (e.g., 59.27s for Wikipedia 2006/11).

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 242 / 277

Page 243: Amazing, tutorial

The community-search problem

• a dense subgraph that contains a given subsetof vertices Q ⊆ V (the query vertices)

• the center-piece subgraph problem

• the team formation problem

• the cocktail party problem

applications

• find the community of a given set of users• a meaningful way to address the issue of

overlapping communities

• find a set of proteins related to a given set

• form a team to solve a problem

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 243 / 277

Page 244: Amazing, tutorial

Center-piece subgraph

[Tong and Faloutsos, 2006]

• given: graph G = (V ,E ) and set of query vertices Q ⊆ V

• find: a connected subgraph H that

(a) contains Q(b) optimizes a goodness function g(H)

• main concepts:

• k softAND: a node in H should be well connected to atleast k vertices of Q

• r(i , j) goodness score of j wrt qi ∈ Q

• r(Q, j) goodness score of j wrt Q

• g(H) goodness score of a candidate subgraph H

• H∗ = arg maxH g(H)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 244 / 277

Page 245: Amazing, tutorial

Center-piece subgraph

[Tong and Faloutsos, 2006]

• r(i , j) goodness score of j wrt qi ∈ Q

probability to meet j in a random walk with restart to qi

• r(Q, j) goodness score of j wrt Q

probability to meet j in a random walk with restart to kvertices of Q

• proposed algorithm:

1. greedy: find a good destination vertex j ito add in H

2. add a path from each of top-k vertices of Q path to j

3. stop when H becomes large enough

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 245 / 277

Page 246: Amazing, tutorial

Center-piece subgraph — example results

(a) “K softANDquery”: k = 2

(b) “AND query”

Figure 1: Center-piece subgraph among Rakesh Agrawal, Jiawei Han, Michael I. Jordan and Vladimir Vapnik.

Thus, we define the center-piece subgraph problem, asfollows:

Problem 1. Center-Piece Subgraph Discovery(CEPS)

Given: an edge-weighted undirected graph W, Q nodes assource queries Q = {qi} (i = 1, ..., Q), the softANDcoe!cient k and an integer budget b

Find: a suitably connected subgraph H that (a) contains allquery nodes qi (b) at most b other vertices and (c) itmaximizes a “goodness” function g(H).

Allowing Q query nodes creates a subtle problem: do wewant the qualifying nodes to have strong ties to all the querynodes? to at least one? to at least a few? We handle allof the above cases with our proposed K softAND queries.Figure 1(a) illustrates the case where we want intermediatenodes with good connections to at least k = 2 of the querynodes. Notice that the resulting subgraph is much di!erentnow: there are two disconnected components, reflecting thetwo sub-communities (databases/statistics).

The contributions of this work are the following

• The problem definition, for arbitrary number Q ofquery nodes, with careful handling of a lot of the sub-tleties.

• The introduction and handling of K softAND queries.

• EXTRACT, a novel subgraph extraction algorithm.

• The design of a fast, approximate method, which pro-vides a 6 : 1 speedup with little loss of accuracy.

The system is operational, with careful design and nu-merous optimizations, like alternative normalizations of theadjacency matrix, a fast algorithm to compute the scores forK softAND queries.

Our experiments on a large real dataset (DBLP) show thatour method returns results that agree with our intuition, andthat it can be made fast (a few seconds response time), whileretaining most of the accuracy (about 90%).

The rest of the paper is organized as follows: in Section 2,we review some related work; Section 3 provides an overviewof the proposed method: CEPS. The goodness score calcu-lation is proposed Section 4 and its variants are presented inthe Appendix. The “EXTRACT” algorithm and the speed-ing up strategy are provided in Section 5 and Section 6,respectively. We present experimental results in Section 7;and conclude the paper in Section 8.

2. RELATED WORKIn recent years, there is increasing research interest in

large graph mining, such as pattern and law mining [2][5][7][20],frequent substructure discovery [27], influence propagation [18],community mining [9][11][12] and so on. Here, we make abrief review of the related work, which can be categorizedinto four groups: 1) measuring the goodness of connection;2) community mining; 3) random walk and electricity re-lated methods; 4) graph partition.

The goodness of connection. Defining a goodness cri-terion is the core for center-piece subgraph discovery. Thetwo most natural measures for “good” paths are shortest dis-tance and maximum flow. However, as pointed out in [6],both measurements might fail to capture some preferredcharacteristics for social network. The goodness function forsurvivable network [13], which is the count of edge-disjointor vertex-disjoint paths from source to destination, also failsto adequately model social relationship. A more related dis-tance function is proposed in [19] [23]. However, It can-not describe the multi-faceted relationship in social networksince center-piece subgraph aims to discover collection ofpaths rather than a single path.

In [6], the authors propose an delivered current basedmethod. By interpreting the graph as an electric network,applying +1 voltage to one query node and setting the otherquery node 0 voltage, their method proposes to choose thesubgraph which delivers maximum current between the querynodes. In [25], the authors further apply the delivered cur-rent based method to multi-relational graph. However, thedelivered current criterion can only deal with pairwise source

405

Research Track Paper

[Tong and Faloutsos, 2006]Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 246 / 277

Page 247: Amazing, tutorial

The community-search problem[Sozio and Gionis, 2010]

• given: graph G = (V ,E ) and set of query vertices Q ⊆ V

• find: a connected subgraph H that

(a) contains Q(b) vertices of H are close to Q(c) optimizes a density function d(H)

• distance constraint (b):

d(Q, j) =∑q∈Q

d2(qi , j) ≤ B

• density function (c):

average degree, minimum degree, quasiclique, measuredon the induced subgraph H

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 247 / 277

Page 248: Amazing, tutorial

The community-search problem

both the distance constraint and the minimum-degree densityhelp addressing the problem of free riders

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 248 / 277

Page 249: Amazing, tutorial

The community-search problem

algorithm proposed by [Sozio and Gionis, 2010]

adaptation of the greedy algorithm of [Charikar, 2000]

input: undirected graph G = (V ,E ), query vertices Q ⊆ Voutput: connected, dense subgraph H1 set Gn ← G2 for k ← n downto 12.1 remove all vertices violating distance constraints2.2 let v be the smallest degree vertex in Gk

among all vertices not in Q2.3 Gk−1 ← Gk \ {v}2.4 if left only with vertices in Q or disconnected graph, stop3 output the subgraph in Gn, . . . ,G1 that maximizes f (H)

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 249 / 277

Page 250: Amazing, tutorial

Properties of the greedy algorithm

• returns optimal solution if no size constraints orlower-bound constraints

• heuristic variants proposed when upper-bound constraints

• generalized for monotone constraints and monotoneobjective functions

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 250 / 277

Page 251: Amazing, tutorial

The community-search problem — example results

Kanellakis

Papadimitriou

Abiteboul

Buneman

VianuVardi

Hull

Delobel

Ioannidis

Hellerstein

Ross

Ullman

Bernstein

(a) Database theory

Fortnow

Babai

Nisan

Wigderson

Zuckerman

Safra

Saks

Papadimitriou

Karp

Itai

Lipton

Goldreich

(b) Complexity theory

Karp

Blum

Papadimitriou

Afrati

Johnson

Goldman

Piccolboni

Yannakakis

Crescenzi

TarjanUllman

Sagiv

(c) Algorithms I

Kleinberg

Raghavan

Rajagopalan

Tomkins

Hirsch

Dantsin

Kannan

Goerdt

Papadimitriou

Chakrabarti

Gibson

Kumar

Dom

Schoning

(d) Algorithms II

Figure 4: Di!erent communities of Christos Papadimitriou. Rectangular nodes indicate the query nodes, and elliptical

nodes indicate nodes discover by our algorithm.

[10] C. Faloutsos, K. McCurley, and A. Tomkins. Fast discoveryof connection subgraphs. In KDD, 2004.

[11] U. Feige, G. Kortsarz, and D. Peleg. The dense k-subgraphproblem. Algorithmica, 29:2001, 1999.

[12] G. W. Flake, S. Lawrence, and C. L. Giles. E!cientidentification of web communities. In KDD, 2000.

[13] G. W. Flake, S. Lawrence, C. L. Giles, and F. M. Coetzee.Self-organization and identification of web communities.Computer, 35(3):66–71, 2002.

[14] S. Fortunato and M. Barthelemy. Resolution limit incommunity detection. PNAS, 104(1), 2007.

[15] D. Gibson, R. Kumar, and A. Tomkins. Discovering largedense subgraphs in massive graphs. In VLDB, 2005.

[16] M. Girvan and M. E. J. Newman. Community structure insocial and biological networks. Proceedings of the NationalAcademy of Sciences of the USA, 99(12):7821–7826, 2002.

[17] J. Hastad. Clique is hard to approximate within n1!!.Electronic Colloquium on Computational Complexity(ECCC), 4(38), 1997.

[18] G. Karypis and V. Kumar. A fast and high qualitymultilevel scheme for partitioning irregular graphs. JSC,20(1), 1998.

[19] G. Kasneci, S. Elbassuoni, and G. Weikum. Ming: mininginformative entity relationship subgraphs. In CIKM, 2009.

[20] S. Khuller and B. Saha. On finding dense subgraphs. InICALP, 2009.

[21] Y. Koren, S. C. North, and C. Volinsky. Measuring andextracting proximity graphs in networks. TKDD, 1(3),2007.

[22] B. Korte and J. Vygen. Combinatorial Optimization:Theory and Algorithms (Algorithms and Combinatorics).Springer, 2007.

[23] L. Kou, G. Markowsky, and L. Berman. A fast algorithmfor steiner trees. Acta Informatica, 15(2):141–145, 1981.

[24] T. Lappas, K. Liu, and E. Terzi. Finding a team of expertsin social networks. In KDD, 2009.

[25] J. Leskovec, K. J. Lang, A. Dasgupta, and M. W. Mahoney.Statistical properties of community structure in large socialand information networks. In WWW, 2008.

[26] M. Newman. Fast algorithm for detecting communitystructure in networks. Physical Review E, 69, 2003.

[27] P. Sevon, L. Eronen, P. Hintsanen, K. Kulovesi, andH. Toivonen. Link discovery in graphs derived frombiological databases. In DILS, 2006.

[28] H. Tong and C. Faloutsos. Center-piece subgraphs:problem definition and fast solutions. In KDD, 2006.

[29] S. White and P. Smyth. A spectral clustering approach tofinding communities in graph. In SDM, 2005.

948

(from [Sozio and Gionis, 2010])

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 251 / 277

Page 252: Amazing, tutorial

Conclusions (dense subgraphs)

summary

• discussed a number of different density measures

• discussed a number of diiferent problem formulations

• polynomial-time solvable or NP-hard problems

• global dense subgraphs or relative to query vertices

promising future directions

• explore further the concept of α-quasiclique

• better algorithms for upper-bound constraints

• top-k versions of dense subgraphs

• adapt concepts for labeled graphs

• local algorithms

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 252 / 277

Page 253: Amazing, tutorial

thank you!

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 253 / 277

Page 254: Amazing, tutorial

references I

Agarwal, G. and Kempe, D. (2008).

Modularity-maximizing graph communities via mathematicalprogramming.

The European Physical Journal B, 66(3).

Ailon, N., Charikar, M., and Newman, A. (2008).

Aggregating inconsistent information: ranking and clustering.

Journal of the ACM (JACM), 55(5).

Albert, R., Jeong, H., and Barabasi, A.-L. (2000).

Error and attack tolerance of complex networks.

Nature, 406(6794):378–382.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 254 / 277

Page 255: Amazing, tutorial

references II

Alvarez-Hamelin, J. I., Dall’Asta, L., Barrat, A., and Vespignani, A.(2005).

Large scale networks fingerprinting and visualization using the k-coredecomposition.

In NIPS.

Angel, A., Koudas, N., Sarkas, N., and Srivastava, D. (2012).

Dense Subgraph Maintenance under Streaming Edge WeightUpdates for Real-time Story Identification.

arXiv.org.

Arora, S., Rao, S., and Vazirani, U. (2009).

Expander flows, geometric embeddings and graph partitioning.

Journal of the ACM (JACM), 56(2).

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 255 / 277

Page 256: Amazing, tutorial

references III

Bollobas, B. and Chung, F. R. K. (1988).

The diameter of a cycle plus a random matching.

SIAM Journal on discrete mathematics, 1(3):328–333.

Bollobas, B. and Riordan, O. (2003).

Mathematical results on scale-free random graphs.

Handbook of graphs and networks, 1:34.

Bollobas, B. and Riordan, O. (2004).

Robustness and vulnerability of scale-free random graphs.

Internet Mathematics, 1(1):1–35.

Borgs, C., Chayes, J. T., Ding, J., and Lucier, B. (2011).

The hitchhiker’s guide to affiliation networks: A game-theoreticapproach.

In ICS.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 256 / 277

Page 257: Amazing, tutorial

references IV

Brandes, U., Delling, D., Gaertler, M., Gorke, R., Hofer, M.,Nikoloski, Z., and Wagner, D. (2006).

Maximizing modularity is hard.

Technical report, DELIS – Dynamically Evolving, Large-ScaleInformation Systems.

Broder, A., Kumar, R., Maghoul, F., Raghavan, P., Rajagopalan, S.,Stata, R., Tomkins, A., and Wiener, J. (2000).

Graph structure in the web: Experiments and models.

In Proceedings of the Ninth Conference on World Wide Web, pages309–320, Amsterdam, Netherlands. ACM Press.

Brummitt, C. D., DSouza, R. M., and Leicht, E. (2012).

Suppressing cascades of load in interdependent networks.

Proceedings of the National Academy of Sciences,109(12):E680–E689.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 257 / 277

Page 258: Amazing, tutorial

references V

Buckley, P. G. and Osthus, D. (2004).

Popularity based random graph models leading to a scale-free degreesequence.

Discrete Mathematics, 282(1):53–68.

Callaway, D. S., Hopcroft, J. E., Kleinberg, J. M., Newman, M. E.,and Strogatz, S. H. (2001).

Are randomly grown graphs really random?

Physical Review E, 64(4):041902.

Chakrabarti, D., Zhan, Y., and Faloutsos, C. (2004).

R-mat: A recursive model for graph mining.

Computer Science Department, page 541.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 258 / 277

Page 259: Amazing, tutorial

references VI

Chakrabarti, S., Frieze, A., and Vera, J. (2005).

The influence of search engines on preferential attachment.

In Proceedings of the sixteenth annual ACM-SIAM symposium onDiscrete algorithms, pages 293–300. Society for Industrial andApplied Mathematics.

Charikar, M. (2000).

Greedy approximation algorithms for finding dense components in agraph.

In APPROX.

Cho, J. and Roy, S. (2004).

Impact of search engines on page popularity.

In Proceedings of the 13th international conference on World WideWeb, pages 20–29. ACM.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 259 / 277

Page 260: Amazing, tutorial

references VII

Clauset, A., Newman, M., and Moore, C. (2004).

Finding community structure in very large networks.

arXiv.org.

Clauset, A., Shalizi, C. R., and Newman, M. E. (2009).

Power-law distributions in empirical data.

SIAM review, 51(4):661–703.

Cooper, C. and Frieze, A. (2003).

A general model of web graphs.

Random Structures & Algorithms, 22(3):311–335.

Cooper, C. and Frieze, A. (2004).

Crawling on simple models of web graphs.

Internet Mathematics, 1(1):57–90.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 260 / 277

Page 261: Amazing, tutorial

references VIIIDorogovtsev, S. N. and Mendes, J. F. (2002).

Evolution of networks.

Advances in physics, 51(4):1079–1187.

Doyle, J. and Carlson, J. M. (2000).

Power laws, highly optimized tolerance, and generalized sourcecoding.

Physical Review Letters, 84(24):5656.

Dutta, B. and Jackson, M. O. (2003).

Networks and Groups: Models of Strategic Formation.

Springer Heidelberg.

Fabrikant, A., Koutsoupias, E., and Papadimitriou, C. H. (2002).

Heuristically optimized trade-offs: A new paradigm for power laws inthe internet.

In Automata, languages and programming, pages 110–122. Springer.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 261 / 277

Page 262: Amazing, tutorial

references IX

Fabrikant, A., Luthra, A., Maneva, E., Papadimitriou, C. H., andShenker, S. (2003).

On a network creation game.

In Proceedings of the twenty-second annual symposium on Principlesof distributed computing, PODC ’03, pages 347–351, New York,NY, USA. ACM.

Faloutsos, M., Faloutsos, P., and Faloutsos, C. (1999).

On power-law relationships of the internet topology.

In SIGCOMM.

Flaxman, A. D., Frieze, A. M., and Vera, J. (2006).

A geometric preferential attachment model of networks.

Internet Mathematics, 3(2):187–205.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 262 / 277

Page 263: Amazing, tutorial

references XFratkin, E., Naughton, B. T., Brutlag, D. L., and Batzoglou, S.(2006).

MotifCut: regulatory motifs finding with maximum densitysubgraphs.

Bioinformatics, 22(14).

Frieze, A., Kleinberg, J., Ravi, R., and Debany, W. (2009).

Line-of-sight networks.

Combinatorics, Probability and Computing, 18(1-2):145–163.

Frieze, A. and Tsourakakis, C. E. (2012).

Rainbow connection of sparse random graphs.

the electronic journal of combinatorics, 19(4):P5.

Frieze, A. and Tsourakakis, C. E. (2013).

Some properties of random apollonian networks.

Internet Mathematics.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 263 / 277

Page 264: Amazing, tutorial

references XI

Gleich, D. F. and Owen, A. B. (2012).

Moment-based estimation of stochastic kronecker graph parameters.

Internet Mathematics, 8(3):232–256.

Goldberg, A. V. (1984).

Finding a maximum density subgraph.

Technical report.

Gugelmann, L., Panagiotou, K., and Peter, U. (2012).

Random hyperbolic graphs: degree sequence and clustering.

In Automata, Languages, and Programming, pages 573–585.Springer.

Hastad, J. (1997).

Clique is hard to approximate within n1−ε.

In Electronic Colloquium on Computational Complexity (ECCC).

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 264 / 277

Page 265: Amazing, tutorial

references XIIHolme, P. and Kim, B. J. (2002).

Growing scale-free networks with tunable clustering.

Physical Review E, 65(2):026107.

Hopcroft, J. and Kannan, R. (2012).

Computer science theory for the information age.

Iasemidis, L. D., Shiau, D.-S., Chaovalitwongse, W. A., Sackellares,J. C., Pardalos, P. M., Principe, J. C., Carney, P. R., Prasad, A.,Veeramani, B., and Tsakalis, K. (2003).

Adaptive epileptic seizure prediction system.

IEEE Transactions on Biomedical Engineering, 50(5).

Karypis, G. and Kumar, V. (1998).

A fast and high quality multilevel scheme for partitioning irregulargraphs.

SIAM J. Sci. Comput., 20(1):359–392.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 265 / 277

Page 266: Amazing, tutorial

references XIII

Khuller, S. and Saha, B. (2009).

On finding dense subgraphs.

In ICALP.

Kleinberg, J. M. (2000).

Navigation in a small world.

Nature, 406(6798):845–845.

Kleinberg, J. M., Kumar, R., Raghavan, P., Rajagopalan, S., andTomkins, A. S. (1999a).

The web as a graph: Measurements, models, and methods.

In Computing and combinatorics, pages 1–17. Springer.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 266 / 277

Page 267: Amazing, tutorial

references XIV

Kleinberg, J. M., Kumar, R., Raghavan, P., Rajagopalan, S., andTomkins, A. S. (1999b).

The Web as a graph: measurements, models and methods.

In Proceedings of the 5th Annual International Computing andCombinatorics Conference (COCOON), volume 1627 of LectureNotes in Computer Science, pages 1–18, Tokyo, Japan. Springer.

Krauthgamer, R., Naor, J. S., and Schwartz, R. (2009).

Partitioning graphs into balanced components.

In SODA.

Krivelevich, M. and Sudakov, B. (2013).

The phase transition in random graphs - a simple proof.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 267 / 277

Page 268: Amazing, tutorial

references XV

Kumar, R., Raghavan, P., Rajagopalan, S., Sivakumar, D., Tomkins,A., and Upfal, E. (2000).

Stochastic models for the web graph.

In Proceedings of the 41st Annual Symposium on Foundations ofComputer Science (FOCS), pages 57–65, Redondo Beach, CA, USA.IEEE CS Press.

Kumar, R., Raghavan, P., Rajagopalan, S., and Tomkins, A. (1999).

Trawling the Web for emerging cyber-communities.

Computer Networks, 31(11–16):1481–1493.

Lakhina, A., Byers, J. W., Crovella, M., and Xie, P. (2003).

Sampling biases in ip topology measurements.

In INFOCOM 2003. Twenty-Second Annual Joint Conference of theIEEE Computer and Communications. IEEE Societies, volume 1,pages 332–341. IEEE.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 268 / 277

Page 269: Amazing, tutorial

references XVI

Lattanzi, S. and Sivakumar, D. (2009).

Affiliation networks.

In Proceedings of the 41st annual ACM symposium on Theory ofcomputing, pages 427–434. ACM.

Leskovec, J., Chakrabarti, D., Kleinberg, J., and Faloutsos, C.(2005a).

Realistic, mathematically tractable graph generation and evolution,using kronecker multiplication.

In Knowledge Discovery in Databases: PKDD 2005, pages 133–145.Springer.

Leskovec, J., Chakrabarti, D., Kleinberg, J., Faloutsos, C., andGhahramani, Z. (2010).

Kronecker graphs: An approach to modeling networks.

The Journal of Machine Learning Research, 11:985–1042.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 269 / 277

Page 270: Amazing, tutorial

references XVII

Leskovec, J. and Faloutsos, C. (2007).

Scalable modeling of real graphs using kronecker multiplication.

In Proceedings of the 24th international conference on Machinelearning, pages 497–504. ACM.

Leskovec, J., Kleinberg, J., and Faloutsos, C. (2005b).

Graphs over time: densification laws, shrinking diameters andpossible explanations.

In KDD ’05: Proceeding of the eleventh ACM SIGKDD internationalconference on Knowledge discovery in data mining, pages 177–187,New York, NY, USA. ACM Press.

Leskovec, J., Kleinberg, J., and Faloutsos, C. (2007).

Graph evolution: Densification and shrinking diameters.

ACM Transactions on Knowledge Discovery from Data (TKDD),1(1):2.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 270 / 277

Page 271: Amazing, tutorial

references XVIII

Leskovec, J., Lang, K. J., Dasgupta, A., and Mahoney, M. W.(2009).

Community structure in large networks: Natural cluster sizes and theabsence of large well-defined clusters.

Internet Mathematics, 6(1):29–123.

Li, L., Alderson, D., Doyle, J. C., and Willinger, W. (2005).

Towards a theory of scale-free graphs: Definition, properties, andimplications.

Internet Mathematics, 2(4):431–523.

Luczak, T. and Pra lat, P. (2006).

Protean graphs.

Internet Mathematics, 3(1):21–40.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 271 / 277

Page 272: Amazing, tutorial

references XIX

Mahdian, M. and Xu, Y. (2007).

Stochastic kronecker graphs.

In Algorithms and models for the web-graph, pages 179–186.Springer.

McKay, B. D. and Wormald, N. C. (1997).

The degree sequence of a random graph. i. the models.

Random Structures and Algorithms, 11(2):97–117.

Newman, M. (2004).

Fast algorithm for detecting community structure in networks.

Physical review E, 69(6).

Newman, M. E. J. (2003).

The structure and function of complex networks.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 272 / 277

Page 273: Amazing, tutorial

references XX

Newman, M. E. J. and Girvan, M. (2004).

Finding and evaluating community structure in networks.

Physical Review E, 69(2).

Ng, A., Jordan, M., and Weiss, Y. (2001).

On spectral clustering: Analysis and an algorithm.

NIPS.

Ostroumova, L., Ryabchenko, A., and Samosvat, E. (2012).

Generalized preferential attachment: tunable power-law degreedistribution and clustering coefficient.

arXiv preprint arXiv:1205.3015.

Penrose, M. (2003).

Random geometric graphs, volume 5.

Oxford University Press Oxford.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 273 / 277

Page 274: Amazing, tutorial

references XXI

Pinar, A., Seshadhri, C., and Kolda, T. G. (2011).

The similarity between stochastic kronecker and chung-lu graphmodels.

arXiv preprint arXiv:1110.4925.

Shi, J. and Malik, J. (2000).

Normalized cuts and image segmentation.

IEEE transactions on Pattern Analysis and Machine Intelligence,22(8).

Smyth, P. and White, S. (2005).

A spectral clustering approach to finding communities in graphs.

SDM.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 274 / 277

Page 275: Amazing, tutorial

references XXII

Sozio, M. and Gionis, A. (2010).

The community-search problem and how to plan a successfulcocktail party.

In KDD.

Stanton, I. and Kliot, G. (2012).

Streaming graph partitioning for large distributed graphs.

In KDD.

Tong, H. and Faloutsos, C. (2006).

Center-piece subgraphs: problem definition and fast solutions.

In KDD.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 275 / 277

Page 276: Amazing, tutorial

references XXIII

Tsourakakis, C., Bonchi, F., Gionis, A., Gullo, F., and Tsiarli, M.(2013).

Denser than the densest subgraph: extracting optimal quasi-cliqueswith quality guarantees.

In KDD.

Tsourakakis, C. E. (2008).

Fast counting of triangles in large real networks without counting:Algorithms and laws.

In ICDM.

Tsourakakis, C. E., Gkantsidis, C., Radunovic, B., and Vojnovic, M.(2012).

FENNEL: Streaming graph partitioning for massive scale graphs.

Technical report.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 276 / 277

Page 277: Amazing, tutorial

references XXIVUno, T. (2010).

An efficient algorithm for solving pseudo clique enumerationproblem.

Algorithmica, 56(1).

Valiant, L. G. (2005).

Memorization and association on a realistic neural model.

Neural computation, 17(3):527–555.

von Luxburg, U. (2007).

A Tutorial on Spectral Clustering.

arXiv.org.

Zhang, B. and Horvath, S. (2005).

A general framework for weighted gene co-expression networkanalysis.

Statistical applications in genetics and molecular biology, 4(1):1128.

Frieze, Gionis, Tsourakakis Algorithmic Techniques for Modeling and Mining Large Graphs 277 / 277