graph theory and network measurment

37
Graph Theory and Network Measurment Social and Economic Networks Jafar Habibi MohammadAmin Fazli Social and Economic Networks 1

Upload: others

Post on 27-Nov-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Graph Theory and Network Measurment

Graph Theory and Network Measurment

Social and Economic Networks

Jafar Habibi

MohammadAmin Fazli

Social and Economic Networks 1

Page 2: Graph Theory and Network Measurment

ToC

β€’ Network Representation

β€’ Basic Graph Theory Definitions

β€’ (SE) Network Statistics and Characteristics

β€’ Some Graph Theory

β€’ Readings:β€’ Chapter 2 from the Jackson book

β€’ Chapter 2 from the Kleinberg book

Social and Economic Networks 2

Page 3: Graph Theory and Network Measurment

Network Representation

β€’ N = {1,2,…,n} is the set of nodes (vertices)

β€’ A graph (N,g) is a matrix [gij]nΓ—n where gij represents a link (relation, edge) between node i and node j

β€’ Weighted network: 𝑔𝑖𝑗 ∈ 𝑅

β€’ Unweighted network: 𝑔𝑖𝑗 ∈ {0,1}

β€’ Undirected network: 𝑔𝑖𝑗 = 𝑔𝑗𝑖

Social and Economic Networks 3

Page 4: Graph Theory and Network Measurment

Network Representation

β€’ Edge list representation: 𝑔 = 12, 23

β€’ Edge addition and deletion: g+ij, g-ij

β€’ Network isomorphism between (N, g) and (N’, g’): βˆƒπ‘“:𝑁→𝑁′𝑔𝑖𝑗

= 𝑔𝑓 𝑖 𝑓(𝑗)β€²

β€’ (N’,g’) is a subnetwork of g’ if 𝑁′ βŠ† 𝑁, π‘”β€²βŠ† 𝑔

β€’ Induced (restricted graphs): 𝑔 𝑆 𝑖𝑗 = 𝑔𝑖𝑗 𝑖𝑓 𝑖 ∈ 𝑆, 𝑗 ∈ 𝑆

0

Social and Economic Networks 4

Page 5: Graph Theory and Network Measurment

Path and Cycles

β€’ A Walk is a sequence of edges connecting a sequence of nodesπ‘Š = 𝑖1𝑖2, 𝑖2𝑖3, 𝑖3𝑖4, … , π‘–π‘›βˆ’1π‘–π‘˜

βˆ€π‘: 𝑖𝑝𝑖𝑝+1 ∈ 𝑔

β€’ A Path is a walk in which no node repeats

β€’ A Cycle is a path which starts and ends at the same nodeπ‘–π‘˜ = 𝑖1

β€’ The number of walks between two nodes:

Social and Economic Networks 5

Page 6: Graph Theory and Network Measurment

Components & Connectedness

β€’ (N,g) is connected if every two nodes in g are connected by some path.

β€’ A component of a network (N,g) is a non-empty subnetwork (N’,g’) which isβ€’ (N’,g’) is connectedβ€’ If 𝑖 ∈ 𝑁′ and 𝑖𝑗 ∈ 𝑔 then 𝑗 ∈ 𝑁′and 𝑖𝑗 ∈ 𝑔′

β€’ Strongly connectivity and strongly connected components for directed graphs.

β€’ C(N,g) = C(g) = set of g’s connected components

β€’ The link ij is a bridge iff g-ij has more components than g

β€’ Giant component is a component which contains a significant fraction of nodes.β€’ There is usually at most one giant component

Social and Economic Networks 6

Page 7: Graph Theory and Network Measurment

Special Kinds of Graphs

β€’ Star:

β€’ Complete Graph:

Social and Economic Networks 7

Page 8: Graph Theory and Network Measurment

Special Kinds of Graphs

β€’ Tree: a connected network with no cycle β€’ A connected network is a tree iff it has n-1 links

β€’ A tree has at least two leaves

β€’ In a tree, there is a unique path between any pair of nodes

β€’ Forest: a union of trees

β€’ Cycle: a connected graph with n edges in which the degree of every node is 2.

Social and Economic Networks 8

Page 9: Graph Theory and Network Measurment

Neighborhood

β€’ 𝑁𝑖 𝑔 = 𝑗: 𝑔𝑖𝑗 = 1

β€’ 𝑁𝑖2 𝑔 = 𝑁𝑖 𝑔 βˆͺ π‘—βˆˆπ‘π‘– 𝑔 𝑁𝑗 𝑔

β€’ π‘π‘–π‘˜ 𝑔 = 𝑁𝑖(𝑔) βˆͺ π‘—βˆˆπ‘π‘– 𝑔 𝑁𝑗

π‘˜βˆ’1 𝑔

β€’ π‘π‘†π‘˜ 𝑔 = π‘–βˆˆπ‘†π‘π‘–

π‘˜

β€’ Degree: 𝑑𝑖 𝑔 = #𝑁𝑖(𝑔)

β€’ For directed graphs out-degree and in-degree is defined

Social and Economic Networks 9

Page 10: Graph Theory and Network Measurment

Degree Distribution

β€’ Degree distribution of a network is a description of relative frequencies of nodes that have different degrees.

β€’ P(d) is the fraction of nodes that have degree d under the degree distribution P.

β€’ Most of social and economical networks have scale-free degree distribution

β€’ A scale-free (power-law) distribution P(d) satisfies:𝑃 𝑑 = cdβˆ’π›Ύ

β€’ Free of Scale: P(2) / P(1) = P(20)/P(10)

Social and Economic Networks 10

Page 11: Graph Theory and Network Measurment

Degree Distribution

Social and Economic Networks 11

Page 12: Graph Theory and Network Measurment

Degree Distribution

β€’ Scale-free distributions have fat-tailsβ€’ For large degrees the number of

nodes that degree is much more than the random graphs.

Social and Economic Networks 12

log 𝑃 𝑑 = log 𝑐 βˆ’ 𝛾log(𝑑)

Page 13: Graph Theory and Network Measurment

Diameter & Average Path Length

β€’ The distance between two nodes is the length of the shortest path between them.

β€’ The diameter of a network is the largest distance between any two nodes.

β€’ Diameter is not a good measure to path lengths, but it can work as an upper-bound

β€’ Average path length is a better measure.

Social and Economic Networks 13

Page 14: Graph Theory and Network Measurment

Diameter & Average Path Length

β€’ The tale of Six-degrees of Separationβ€’ The diameter of SENs is 6!!!

β€’ Based on Milgram’s Experiment

β€’ The true story:β€’ The diameter of SENs may be

high

β€’ The average path length is low [𝑂(log 𝑛 )]

Social and Economic Networks 14

Page 15: Graph Theory and Network Measurment

Diameter & Average Path Length

β€’ The distance distribution in graph of all active Microsoft Instant Messenger user accounts

Social and Economic Networks 15

Page 16: Graph Theory and Network Measurment

Cliquishness & Clustering

β€’ A clique is a maximal complete subgraph of a given network (𝑆 βŠ† 𝑁, 𝑔 𝑆 is a complete network and for any 𝑖 ∈ 𝑁 βˆ– 𝑆: 𝑔 𝑆βˆͺ 𝑖 is not complete.

β€’ Removing an edge from a network may destroy the whole clique structure (e.g. consider removing an edge from a complete graph).

β€’ An approximation: Clustering coefficient,

β€’ This is the overall clustering coefficient

Social and Economic Networks 16

Page 17: Graph Theory and Network Measurment

Cliquishness & Clustering

β€’ Individual Clustering Coefficient for node i:

β€’ Average Clustering Coefficient:

β€’ These values may differ

Social and Economic Networks 17

Page 18: Graph Theory and Network Measurment

Cliquishness & Clustering

Social and Economic Networks 18

Page 19: Graph Theory and Network Measurment

Cliquishness & Clustering

β€’ Average clustering goes to 1

β€’ Overall clustering goes to 0

Social and Economic Networks 19

Page 20: Graph Theory and Network Measurment

Transitivity

β€’ Consider a directed graph g, one can keep track of percentage of transitive triples:

Social and Economic Networks 20

Page 21: Graph Theory and Network Measurment

Centrality

β€’ Centrality measures show how much central a node is.

β€’ Different measures for centrality have been developed.

β€’ Four general categories:β€’ Degree: how connected a node is

β€’ Closeness: how easily a node can reach other nodes

β€’ Betweenness: how important a node is in terms of connecting other nodes

β€’ Neighbors’ characteristics: how important, central or influential a node’s neighbors are

Social and Economic Networks 21

Page 22: Graph Theory and Network Measurment

Degree Centrality

β€’ A simple measure:𝑑𝑖 𝑔

𝑛 βˆ’ 1

Social and Economic Networks 22

Page 23: Graph Theory and Network Measurment

Closeness Centrality

β€’ A simple measure:

𝑗≠𝑖 𝑙 𝑖, 𝑗

𝑛 βˆ’ 1

βˆ’1

β€’ Another measure (decay centrality)

𝑗≠𝑖

𝛿𝑙(𝑖,𝑗)

β€’ What does it measure for 𝛿 = 1?

Social and Economic Networks 23

Page 24: Graph Theory and Network Measurment

Betweenness Centrality

β€’ A simple measure:

Social and Economic Networks 24

Page 25: Graph Theory and Network Measurment

Neighbor-Related Measures

β€’ Katz prestige:

𝑃𝑖𝐾 𝑔 =

𝑗≠𝑖

𝑔𝑖𝑗𝑃𝑗𝐾(𝑔)

𝑑𝑗 𝑔

β€’ If we define 𝑔𝑖𝑗 =𝑔𝑖𝑗

𝑑𝑗 𝑔, we have

𝑃𝐾 𝑔 = 𝑔𝑃𝐾 𝑔

or

𝐼 βˆ’ 𝑔 𝑃𝐾 𝑔 = 0

β€’ Calculating Katz prestige reduces to finding the unit eigenvector.

Social and Economic Networks 25

Page 26: Graph Theory and Network Measurment

Eigenvectors & Eigenvalues

β€’ For an 𝑛 Γ— 𝑛 matrix T an eigenvector v is a 𝑛 Γ— 1 vector for which

βˆƒπœ† 𝑇𝑣 = πœ†π‘£

β€’ Left-hand eigenvector:𝑣𝑇 = πœ†π‘£

β€’ Perron-Ferobenius Theorem: if T is a non-negative column stochastic matrix (the sum of entries in each column is one), then there exists a right-hand eigenvector v and has a corresponding eigenvalue πœ† = 1.

β€’ The same is true for right-hand eigenvectors and row stochastic matrixes.

Social and Economic Networks 26

Page 27: Graph Theory and Network Measurment

Eigenvectors & Eigenvalues

β€’ How to calculate:𝑇 βˆ’ πœ†πΌ 𝑣 = 0

β€’ For this equation to have a non-zero solution v, T βˆ’ πœ†πΌ must be singular (non-invertible):

det 𝑇 βˆ’ πœ†πΌ = 0

Social and Economic Networks 27

Page 28: Graph Theory and Network Measurment

Neighbor-Related Measures

β€’ Computing Katz prestige for the following

β€’ Katz prestige β‰ˆ degree!

β€’ Not interesting on undirected networks, but interesting on directed networks.

Social and Economic Networks 28

Page 29: Graph Theory and Network Measurment

Neighbor-Related Measures

β€’ To solve the problem: Eigenvector Centrality: πœ†πΆπ‘–π‘’ 𝑔 = 𝑗 𝑔𝑖𝑗𝐢𝑗

𝑒 𝑔

πœ†πΆπ‘’ 𝑔 = 𝑔𝐢𝑒(𝑔)

β€’ Katz2: 𝑃𝐾2 𝑔, π‘Ž = π‘Žπ‘”πΌ + π‘Ž2𝑔2𝐼 + π‘Ž3𝑔3𝐼 + β‹―

𝑃𝐾2 𝑔, π‘Ž = 1 + π‘Žπ‘” + π‘Ž2𝑔2 +β‹― π‘Žπ‘”πΌ = 𝐼 βˆ’ π‘Žπ‘” βˆ’1π‘Žπ‘”πΌ

β€’ Bonacich: 𝐢𝑒𝐡 𝑔, π‘Ž, 𝑏 = 1 βˆ’ 𝑏𝑔 βˆ’1π‘Žπ‘”πΌ

Social and Economic Networks 29

Page 30: Graph Theory and Network Measurment

Final Discussion about Centrality Measures

Social and Economic Networks 30

Page 31: Graph Theory and Network Measurment

Matching

β€’ A matching is a subset of edges with no common end-point.

β€’ Finding the maximum matching is an interesting problem specially in bipartite graphs (recall Matching Markets)β€’ A bipartite network (N,g) is one for which N can be partitioned into two sets A

and B such that each edge in g resides between A and B.

β€’ A perfect matching infects all vertices.

β€’ Philip-Hall Theorem: For a bipartite graph (N,g), there exists a matching of a set 𝐢 βŠ† 𝐴, if and only if

βˆ€π‘†βŠ†πΆ 𝑁𝑆 𝑔 β‰₯ 𝑆

Proof: see the whiteboard.

Social and Economic Networks 31

Page 32: Graph Theory and Network Measurment

Set Covering and Independent Set

β€’ Independent Set: a subset of nodes 𝐴 βŠ† 𝑉 for which for each 𝑖, 𝑗 ∈ 𝐴, π‘–π‘—βˆ‰ 𝑔

β€’ Consider two graphs (N,g) and (N,g’) such that 𝑔 βŠ‚ 𝑔′. β€’ Any independent set of g’ is an independent set of g.

β€’ If 𝑔 β‰  𝑔′, there exists an independent sets of g that are not independent set of g’.

β€’ Free-rider game on networks: β€’ Each player buy the book or he can borrow the book freely from one of the book

owners in his neighborhood.

β€’ Indirect borrowing is not permitted.

β€’ Each player prefer paying for the book over not having it.

β€’ The equilibrium is where the nodes of a maximal independent set pays for the book.

Social and Economic Networks 32

Page 33: Graph Theory and Network Measurment

Coloring

β€’ Example: We have a network of researchers in which an edge between node i and j means i or j wants to attends the others presentation. How many time slots are needed to schedule all the presentations?

β€’ In each time slot, we should color the vertices in a way no two neighboring nodes get the same colors: The Coloring Problem.

β€’ The minimum number of colors needed colors: the chromatic number

β€’ Many number of results, most famous is the 4-color problem: Every planar graph can be colored with 4 colors.β€’ A planar graph is a graph which can be drawn in a way that no two edges

cross each other.

Social and Economic Networks 33

Page 34: Graph Theory and Network Measurment

Coloring

β€’ Intuition: The 6-color problem:β€’ Any planar graph can be colored with 6 colors.

β€’ Proof sktech:β€’ Euler formula: v+f = e+2β€’ 𝑒 ≀ 3𝑣 βˆ’ 6

β€’ 𝛿 ≀ 5

β€’ Recursive coloring

β€’ Four color is needed:

Social and Economic Networks 34

Page 35: Graph Theory and Network Measurment

Eulerian Tours & Hamilton Cycles

β€’ Euler Tour: a closed walk which pass through all edges

β€’ Euler theorem: A connected network g has a closed walk that involveseach link exactly once if and only if the degree of each node is even.

β€’ Proof sketch: β€’ Induction on the number of edges

Social and Economic Networks 35

Page 36: Graph Theory and Network Measurment

Eulerian Tours & Hamilton Cycles

β€’ Hamilton Cycle: a cycle that passes through all vertices

β€’ Dirac theorem: If a network has 𝑛 β‰₯ 3 nodes and each node has degree of at least n/2, then the network has a Hamilton cycle.

β€’ Proof sketch:β€’ Graph is connected

β€’ Consider the longest path and prove it is in fact a cycle

β€’ Consider a node outside this cycle

Social and Economic Networks 36

Page 37: Graph Theory and Network Measurment

Eulerian Tours and Hamilton Cycles

β€’ Chvatal Theorem: Order the nodes of a network of 𝑛 β‰₯ 3 nodes inincreasing order of their degrees, so that node 1 has the lowest degree and node n has the highest degree. If the degrees are such that 𝑑𝑖 ≀ 𝑖 for some 𝑖 < 𝑛/2 implies π‘‘π‘›βˆ’π‘– β‰₯ 𝑛 βˆ’ 𝑖, then the network has a Hamilton cycle.

Social and Economic Networks 37