MTH 210 Adjacency Matrices and Page Rank Dr

  • Slides: 23
Download presentation
MTH 210 Adjacency Matrices and Page. Rank Dr. Anthony Bonato Ryerson University

MTH 210 Adjacency Matrices and Page. Rank Dr. Anthony Bonato Ryerson University

Adjacency matrix • given a simple graph of order n, with vertices 1, 2,

Adjacency matrix • given a simple graph of order n, with vertices 1, 2, 3, …, n-1, n, then: – place a 1 in the (i, j) entry if ij is an edge – place a 0 in the (i, j) entry if ij is a non-edge

Examples

Examples

Things to notice about the adjacency matrix • it is symmetric: interchange rows and

Things to notice about the adjacency matrix • it is symmetric: interchange rows and columns (ie transpose) remains the same • it is binary: every entry is 0 or 1 • diagonal (i, i) entries are all 0: no loops

Multi-graphs and loops • replace “ 1” by the number of parallel edges between

Multi-graphs and loops • replace “ 1” by the number of parallel edges between i and j • note: not necessarily a binary matrix • loops add +1 on diagonal

Directed graphs • no longer symmetric

Directed graphs • no longer symmetric

Key facts If G is a graph: • row or column sums are degrees.

Key facts If G is a graph: • row or column sums are degrees. If G is a digraph: • Row sum is out-degree. • Column sum is in-degree.

Page. Rank • Used by Google to rank pages • Idea: – When surfing

Page. Rank • Used by Google to rank pages • Idea: – When surfing the web, you typically follow links – You get bored occasionally and go to a random page

Page. Rank • Page. Rank is the probability a random web surfer lands on

Page. Rank • Page. Rank is the probability a random web surfer lands on your page • the higher the Page. Rank the more “popular” the web page

Page. Rank matrix • G connected graph of order n • C a real

Page. Rank matrix • G connected graph of order n • C a real number in (0, 1) • If ij is an edge, (i, j) entry is: C/deg(i) + (1 -C)/n • If ij is not an edge, then the (i, j) entry is (1 -C)/n

Notes on Page. Rank matrix • derived from an n x n matrix •

Notes on Page. Rank matrix • derived from an n x n matrix • the constant C is given beforehand • entries depend on C and n, but also on deg(i) • entries in matrix are rational numbers (not necessarily integers)

Exercises

Exercises

MTH 210 Isomorphisms Dr. Anthony Bonato Ryerson University

MTH 210 Isomorphisms Dr. Anthony Bonato Ryerson University

 • we’ll make precise: “these graphs are the same” • If they are

• we’ll make precise: “these graphs are the same” • If they are the same, they should share all the same properties/invariants. • same will be “isomorphic”

 • Informal ideas: – if graphs are isomorphic, you can redraw one to

• Informal ideas: – if graphs are isomorphic, you can redraw one to look like the other – if graphs are non-isomorphic, then there is some property holding in one but not the other

isomorphic graphs

isomorphic graphs

non-isomorphic graphs

non-isomorphic graphs

One-to-one functions • a function f: X → Y is one-to-one if distinct elements

One-to-one functions • a function f: X → Y is one-to-one if distinct elements of X map to distinct elements of Y • that is: – For all u, v in X, if u ≠ v, then f(u) ≠ f(v) • Idea: one-to-one functions “separate points” in X

Examples

Examples

Isomorphisms • let G and H be graphs, and let f: V(G)→V(H) be a

Isomorphisms • let G and H be graphs, and let f: V(G)→V(H) be a function • f is an isomorphism if: 1. G and H have the same order 2. f is one-to-one and for all vertices u and v in G: • uv is an edge in G if and only if f(u)f(v) is an edge in H

Note • my definition is a little different looking (but the equivalent!) to the

Note • my definition is a little different looking (but the equivalent!) to the book’s • in real “graph theory, ” you don’t define two mappings like the book does for an isomorphism. . .

Key fact • if G and H have different orders or sizes, they are

Key fact • if G and H have different orders or sizes, they are not isomorphic • Check their subgraphs, kinds and number of cycles, number of leaves, degrees of vertices … to see if they are the same • can you redraw G to look like H?

Exercises

Exercises