32
Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Embed Size (px)

Citation preview

Page 1: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Lecture 4:

Mathematics of Networks (Cont)

CS 765: Complex Networks

Slides are modified from Networks: Theory and Application by Lada Adamic

Page 2: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Trees

Trees are undirected graphs that contain no cycles

For n nodes, number of edges m = n-1 A node can be dedicated as the root

Page 3: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

examples of trees

In nature trees river networks arteries (or veins, but not both)

Man made sewer system

Computer science binary search trees decision trees (AI)

Network analysis minimum spanning trees

from one node – how to reach all other nodes most quickly may not be unique, because shortest paths are not always unique depends on weight of edges

Page 4: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Planar graphs

A graph is planar if it can be drawn on a plane without any edges crossing

Page 5: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Cliques and complete graphs

Kn is the complete graph (clique) with K vertices each vertex is connected to every other vertex there are n*(n-1)/2 undirected edges

K5 K8K3

Page 6: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Kuratowski’s theorem

Every non-planar network contains at least one subgraph that is an expansion of K5 or K3,3.

K5 K3,3

Expansion: Addition of new node in the middle of edges.

Research challenge: Degree of planarity?

6

Page 7: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

#s of planar graphs of different sizes

1:1

2:2

3:4

4:11

Every planar graph

has a straight line

embedding

Page 8: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Edge contractions defined

A finite graph G is planar if and only if it has no subgraph that is homeomorphic or edge-contractible to the complete graph in five vertices (K5) or the complete bipartite graph K3, 3. (Kuratowski's Theorem)

Page 9: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Peterson graph

Example of using edge contractions to show a graph is not planar

Page 10: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Bi-cliques (cliques in bipartite graphs)

Km,n is the complete bipartite graph with m and n vertices of the two different types

K3,3 maps to the utility graph Is there a way to connect three utilities, e.g. gas, water, electricity to

three houses without having any of the pipes cross?

K3,3

Utility graph

Page 11: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Node degree

Outdegree =0 0 0 0 0

0 0 1 1 0

0 1 0 1 0

0 0 0 0 1

1 1 0 0 0

A =

n

jijA

1

example: outdegree for node 3 is 2, which we obtain by summing the number of non-zero entries in the 3rd row

Indegree =0 0 0 0 0

0 0 1 1 0

0 1 0 1 0

0 0 0 0 1

1 1 0 0 0

A =

n

iijA

1

example: the indegree for node 3 is 1, which we obtain by summing the number of non-zero entries in the 3rd column

n

iiA

13

n

jjA

13

1

2

3

45

11

Page 12: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Degree sequence and Degree distribution

Degree sequence: An ordered list of the (in,out) degree of each node

In-degree sequence: [2, 2, 2, 1, 1, 1, 1, 0]

Out-degree sequence: [2, 2, 2, 2, 1, 1, 1, 0]

(undirected) degree sequence: [3, 3, 3, 2, 2, 1, 1, 1]

Degree distribution: A frequency count of the occurrence of each degree

In-degree distribution:[(2,3) (1,4) (0,1)]

Out-degree distribution:[(2,4) (1,3) (0,1)]

(undirected) distribution:[(3,3) (2,2) (1,3)]

0 1 20

1

2

3

4

5

indegree

fre

qu

en

cy

12

Page 13: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Structural Metrics: Degree distribution

13

What if it is directed ?

Page 14: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Characterizing networks:How dense are they?

Page 15: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

network metrics: graph density

Of the connections that may exist between n nodes directed graph

emax = n*(n-1)

undirected graphemax = n*(n-1)/2

What fraction are present? density = e/ emax

For example, out of 12 possible connections,

this graph has 7, giving it a density of 7/12 = 0.583

15

Page 16: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Graph density

16

Would this measure be useful for comparing networks of different sizes (different numbers of nodes)?

As n → ∞, a graph whose density reaches 0 is a sparse graph

a constant is a dense graph

Page 17: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Characterizing networks:How far apart are things?

17

Page 18: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Network metrics: paths

A path is any sequence of vertices such that every consecutive pair of vertices in the sequence is connected by an edge in the network. For directed: traversed in the correct direction for the edges.

path can visit itself (vertex or edge) more than once Self-avoiding paths do not intersect themselves.

Path length r is the number of edges on the path Called hops

18

Page 19: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Network metrics: paths

19

Page 20: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Network metrics: shortest paths

A

B

C

DE

1

2

2

3

3

20

Page 21: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Structural metrics: Average path length

21

1 ≤ L ≤ D ≤ N-1

Page 22: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Eulerian Path

Euler’s Seven Bridges of Königsberg one of the first problems in graph theory

Is there a route that crosses each bridge only once and returns to the starting point?

Source: http://en.wikipedia.org/wiki/Seven_Bridges_of_Königsberg

Image 1 – GNU v1.2: Bogdan, Wikipedia; http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License

Image 2 – GNU v1.2: Booyabazooka, Wikipedia; http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License

Image 3 – GNU v1.2: Riojajar, Wikipedia; http://commons.wikimedia.org/wiki/Commons:GNU_Free_Documentation_License

Page 23: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Eulerian and Hamiltonian paths

Hamiltonian path is self avoiding

If starting point and end point are the same: only possible if no nodes have an odd degree as each path must visit and leave each shore

If don’t need to return to starting pointcan have 0 or 2 nodes with an odd degree

Eulerian path: traverse each

edge exactly once

Hamiltonian path: visit

each vertex exactly once

Page 24: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Characterizing networks:Is everything connected?

24

Page 25: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Network metrics: components

If there is a path from every vertex in a network to every other, the network is connected otherwise, it is disconnected

Component: A subset of vertices such that there exist at least one path from each member of the subset to others and there does not exist another vertex in the network which is connected to any vertex in the subset Maximal subset

A singeleton vertex that is not connected to any other forms a size one component

Every vertex belongs to exactly one component

25

Page 26: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

components in directed networks

A

B

C

DE

FG

H

Weakly connected componentsA B C D E

G H F

26

Strongly connected components Each node within the component can be reached from every

other node in the component by following directed links

Strongly connected componentsB C D E

A

G H

F

Weakly connected components: every node can be reached from every other node by following links in either direction

A

B

C

DE

FG

H

Page 27: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

components in directed networks

Every strongly connected component of more than one vertex has at least one cycle

Out-component: set of all vertices that are reachable via directed paths starting at a specific vertex v

Out-components of all members of a strongly connected component are identical

In-component: set of all vertices from which there is a direct path to a vertex v In-components of all members of a strongly connected

component are identical

27

A

B

C

DE

FG

H

Page 28: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

network metrics: size of giant component

if the largest component encompasses a significant fraction of the graph, it is called the giant component

28

Page 29: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

bowtie model of the web

The Web is a directed graph: webpages link to other webpages

The connected components tell us what set of pages can be reached from any other just by surfing no ‘jumping’ around by typing in a URL or using a search engine

Broder et al. 1999 – crawl of over 200 million pages and 1.5 billion links. SCC – 27.5% IN and OUT – 21.5% Tendrils and tubes – 21.5% Disconnected – 8%

29

Page 30: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Independent paths

Edge independent paths: if they share no common edge Vertex independent paths: if they share no common

vertex except start and end vertices Vertex-independent => Edge-independent

Also called disjoint paths These set of paths are not necessarily unique

Connectivity of vertices: the maximal number of independent paths between a pair of vertices Used to identify bottlenecks and resiliency to failures

30

Page 31: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Cut Sets and Maximum Flow

A minimum cut set is the smallest cut set that will disconnect a specified pair of vertices Need not to be unique

Menger’s theorem: If there is no cut set of size less than n between a pair of vertices, then there are at least n independent paths between the same vertices. Implies that the size of min cut set is equal to maximum number

of independent paths (for both edge and vertex independence)

Maximum Flow between a pair of vertices is the number of edge independent paths times the edge capacity.

31

Page 32: Lecture 4: Mathematics of Networks (Cont) CS 765: Complex Networks Slides are modified from Networks: Theory and Application by Lada Adamic

Graph Laplacian

32