• No results found

Graph theory

N/A
N/A
Protected

Academic year: 2022

Share "Graph theory"

Copied!
52
0
0

Loading.... (view fulltext now)

Full text

(1)

Graph theory

Bipartite characterization, representation of graphs, graph isomorphism

Lecture 16 Mar 14 2018

(2)

Topics covered

I Eulerian graphs and a characterization

I Characterization of bipartite graphs using odd cycles.

Today

I Graph representation as a matrix.

I Comparing graphs: isomorphism

(3)

Definition

A graph is calledbipartite, if the vertices of the graph can be partitioned intoV =X∪Y,X∩Y =∅ s.t., ∀e= (u, v)∈E,

I either u∈X and v∈Y

I orv∈X and u∈Y

Example: m jobs andnpeople, kcourses and `students.

I How can we check if a graph is bipartite?

I Can we characterize bipartite graphs?

(4)

Recall: A path or a cycle has length nif the number of edges in it is n.

I A path (or cycle) is call odd/even if its length is odd/even.

Lemma

Every closed odd walkcontains an odd cycle.

Proof: By induction on the length of the given closed odd walk.

(5)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

(6)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I ( =⇒) direction is easy.

(7)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I ( =⇒) direction is easy.

I Let Gbe bipartite with (V =X∪Y). Then, every walk in G alternates betweenX, Y.

(8)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I ( =⇒) direction is easy.

I Let Gbe bipartite with (V =X∪Y). Then, every walk in G alternates betweenX, Y.

=⇒ if we start fromX, each return to X can only happen after an even number of steps.

=⇒ G has no odd cycles.

(9)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I (⇐=) Suppose Ghas no odd cycle, then let us construct the bipartition. Wlog assumeG is connected.

(10)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I (⇐=) Suppose Ghas no odd cycle, then let us construct the bipartition. Wlog assumeG is connected.

I Let u∈V. BreakV into

X ={vV | length of shortest pathPuv fromuto vis even}, Y ={vV | length of shortest pathPuv fromuto vis odd},

(11)

Lemma

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I (⇐=) Suppose Ghas no odd cycle, then let us construct the bipartition. Wlog assumeG is connected.

I Let u∈V. BreakV into

X ={vV | length of shortest pathPuv fromuto vis even}, Y ={vV | length of shortest pathPuv fromuto vis odd},

I If there is an edge vv0 between two vertices ofX or two vertices of Y, this creates a closed odd walk: uPuvvv0Pv0uu.

(12)

Every closed odd walkcontains an odd cycle.

Theorem, Konig, 1936

A graph is bipartite iff it has no odd cycle.

Proof:

I (⇐=) Suppose Ghas no odd cycle, then let us construct the bipartition. Wlog assumeG is connected.

I Let u∈V. BreakV into

X ={vV | length of shortest pathPuv fromuto vis even}, Y ={vV | length of shortest pathPuv fromuto vis odd},

I If there is an edge vv0 between two vertices ofX or two vertices of Y, this creates a closed odd walk: uPuvvv0Pv0uu.

I By Lemma, it must contain an odd cycle: contradiction.

I This along with X∩Y =∅ andX∪Y =V, impliesX, Y is a bipartition.

(13)

To represent it, we need to name the vertices...

(14)

v1

v2 v3

v4

To represent it, we need to name the vertices...

I As an adjacency list:

v1 v2, v4

v2 v1, v3

v3 v2, v4

v4 v1, v3

(15)

v1

v2 v3

v4

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

(16)

v1

v2 v3

v4

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

I But we want to study properties that are independent of the naming, e.g., connectivity.

I Are two given graphs the “same”, wrt these properties?

(17)

v1

v2 v3

v4a

b c

d

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

I But we want to study properties that are independent of the naming, e.g., connectivity.

I Are two given graphs the “same”, wrt these properties?

(18)

v1

v2 v3

v4a

b c

d

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

a b c d a 0 0 1 1 b 0 0 1 1 c 1 1 0 0 d 1 1 0 0

I But we want to study properties that are independent of the naming, e.g., connectivity.

I Are two given graphs the “same”, wrt these properties?

(19)

v1

v2 v3

v4a

b c

d

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

v1 v3 v2 v4

v1 0 0 1 1

v3 0 0 1 1

v2 1 1 0 0

v4 1 1 0 0

a b c d a 0 0 1 1 b 0 0 1 1 c 1 1 0 0 d 1 1 0 0

I But we want to study properties that are independent of the naming, e.g., connectivity.

I Are two given graphs the “same”, wrt these properties?

(20)

v1

v2 v3

v4a

b c

d

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

v1 v3 v2 v4

v1 0 0 1 1

v3 0 0 1 1

v2 1 1 0 0

v4 1 1 0 0

a b c d a 0 0 1 1 b 0 0 1 1 c 1 1 0 0 d 1 1 0 0

I Reordering of vertices is same as applying apermutationto rows and colums of A(G).

I So, it seems two graphs are “same” if by reordering and renaming the vertices we get the same graph/matrix.

(21)

v1

v2 v3

v4a

b c

d

To represent it, we need to name the vertices...

I As an adjacency matrix:

v1 v2 v3 v4

v1 0 1 0 1

v2 1 0 1 0

v3 0 1 0 1

v4 1 0 1 0

v1 v3 v2 v4

v1 0 0 1 1

v3 0 0 1 1

v2 1 1 0 0

v4 1 1 0 0

a b c d a 0 0 1 1 b 0 0 1 1 c 1 1 0 0 d 1 1 0 0

I Reordering of vertices is same as applying apermutationto rows and colums of A(G).

I So, it seems two graphs are “same” if by reordering and renaming the vertices we get the same graph/matrix.

I How do we formalize this?

(22)

Isomorphism

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

reordering/renaming.

I What are the properties of this function/relation: R={(G, H)| ∃ an isomorphism fromGtoH}.

Proposition

The isomorphism relation is an equivalence relation.

I The equivalence classes are called isomorphism classes.

I When we talked about an “unlabeled” graph till now, we actually meant the isomorphism class of that graph!

(23)

Isomorphism

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

I Thus, it is a bijection that “preserves” the edge relation.

I Can be checked using adjacency matrix by reordering/renaming.

I What are the properties of this function/relation:

R={(G, H)| ∃ an isomorphism fromGtoH}.

I The equivalence classes are called isomorphism classes.

I When we talked about an “unlabeled” graph till now, we actually meant the isomorphism class of that graph!

(24)

Isomorphism

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

I Thus, it is a bijection that “preserves” the edge relation.

I Can be checked using adjacency matrix by reordering/renaming.

I What are the properties of this function/relation:

R={(G, H)| ∃ an isomorphism fromGtoH}.

Proposition

The isomorphism relation is an equivalence relation.

actually meant the isomorphism class of that graph!

(25)

Isomorphism

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

I Thus, it is a bijection that “preserves” the edge relation.

I Can be checked using adjacency matrix by reordering/renaming.

I What are the properties of this function/relation:

R={(G, H)| ∃ an isomorphism fromGtoH}.

Proposition

The isomorphism relation is an equivalence relation.

I The equivalence classes are called isomorphism classes.

(26)

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

I Thus, it is a bijection that “preserves” the edge relation.

I Can be checked using adjacency matrix by reordering/renaming.

I What are the properties of this function/relation:

R={(G, H)| ∃ an isomorphism fromGtoH}.

Proposition

The isomorphism relation is an equivalence relation.

I The equivalence classes are called isomorphism classes.

I When we talked about an “unlabeled” graph till now, we actually meant the isomorphism class of that graph!

(27)

Graph isomorphism

3. check that it preserves the adjacency relation

I To show that two graphs arenon-isomorphic, find a structural property that is different.

(28)

I To show that two graphs are isomorphic, you have to 1. give names to vertices

2. specify a bijection

3. check that it preserves the adjacency relation

I To show that two graphs arenon-isomorphic, find a structural property that is different.

(29)

Is checking graph isomorphism easy?

I Qn: Which of these graphs are isomorphic?

I vertices are 2-element subsets of 5-element set and edges are pairs of disjoint 2-element subsets.

I 2 vertices that do not share an edge, have exactly 1 common nbr.

Further reading: Graph and sub-graph isomorphism problems.

(30)

Is checking graph isomorphism easy?

I Qn: Which of these graphs are isomorphic?

I A: All of them!

pairs of disjoint 2-element subsets.

I 2 vertices that do not share an edge, have exactly 1 common nbr.

Further reading: Graph and sub-graph isomorphism problems.

(31)

Is checking graph isomorphism easy?

I Qn: Which of these graphs are isomorphic?

I A: All of them!

I This graph is called the Petersen graph and has some very interesting propreties.

common nbr.

Further reading: Graph and sub-graph isomorphism problems.

(32)

Is checking graph isomorphism easy?

I Qn: Which of these graphs are isomorphic?

I A: All of them!

I This graph is called the Petersen graph and has some very interesting propreties.

I vertices are 2-element subsets of 5-element set and edges are pairs of disjoint 2-element subsets.

Further reading: Graph and sub-graph isomorphism problems.

(33)

Is checking graph isomorphism easy?

I Qn: Which of these graphs are isomorphic?

I A: All of them!

I This graph is called the Petersen graph and has some very interesting propreties.

I vertices are 2-element subsets of 5-element set and edges are pairs of disjoint 2-element subsets.

I 2 vertices that do not share an edge, have exactly 1 common nbr.

(34)

I Qn: Which of these graphs are isomorphic?

I A: All of them!

I This graph is called the Petersen graph and has some very interesting propreties.

I vertices are 2-element subsets of 5-element set and edges are pairs of disjoint 2-element subsets.

I 2 vertices that do not share an edge, have exactly 1 common nbr.

Further reading: Graph and sub-graph isomorphism problems.

(35)

Some special graphs and notations

I Complete graphs Kn

I Complete bipartite graphs Ki,j

I PathsPn I Cycles Cn

(36)

Figure:A whole graph zoo!

(37)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

(38)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

Theorem

IfGis isomorphic to H, then the following properties are preserved:

1. G,H have same # vertices.

2. G,H have same # edges.

(39)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

I Are C5 and P5∪ {e} isomorphic?

Theorem

IfGis isomorphic to H, then the following properties are preserved:

1. G,H have same # vertices.

2. G,H have same # edges.

(40)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

Theorem

IfGis isomorphic to H, then the following properties are preserved:

1. G,H have same # vertices.

2. G,H have same # edges.

3. G,H have the same # vertices of degree k,∀k∈N.

(41)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

(42)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

Theorem

IfGis isomorphic to H, then the following properties are preserved:

1. G,H have same # vertices.

2. G,H have same # edges.

3. G,H have the same # vertices of degree k,∀k∈N.

(43)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

Theorem

IfGis isomorphic to H, then the following properties are preserved:

1. G,H have same # vertices.

2. G,H have same # edges.

3. G,H have the same # vertices of degree k,∀k∈N.

4. Ghask paths/cycles of lengthr iffH hask paths/cycles of lengthr.

(44)

properties, i.e., properties that do not depend on the naming of vertices are preserved.

Theorem

IfGis isomorphic to H, then the following properties are preserved:

1. G,H have same # vertices.

2. G,H have same # edges.

3. G,H have the same # vertices of degree k,∀k∈N.

4. Ghask paths/cycles of lengthr iffH hask paths/cycles of lengthr.

5. G is bipartite iffH is bipartite.

6. . . .

(45)

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

(46)

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

What ifG=H?

(47)

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

What ifG=H?

Definition

AnautomorphismofGis an isomorphism fromGto itself, i.e. a bijectionf :V(G)→V(G) s.t. uv ∈E(G) ifff(u)f(v)∈E(G).

(48)

Definition

Anisomorphism from simple graphGtoH is abijection f :V(G)→V(H) such thatuv∈E(G) ifff(u)f(v)∈E(H).

What ifG=H?

Definition

AnautomorphismofGis an isomorphism fromGto itself, i.e. a bijectionf :V(G)→V(G) s.t. uv ∈E(G) ifff(u)f(v)∈E(G).

I What are the automorphisms of P4?

(49)

Definition

AnautomorphismofGis an isomorphism fromGto itself, i.e. a bijectionf :V(G)→V(G) s.t. uv ∈E(G) ifff(u)f(v)∈E(G).

I What are the automorphisms of P4?

I How many automorphisms does Kn have?

(50)

Definition

AnautomorphismofGis an isomorphism fromGto itself, i.e. a bijectionf :V(G)→V(G) s.t. uv ∈E(G) ifff(u)f(v)∈E(G).

I What are the automorphisms of P4?

I How many automorphisms does Kn have?

I How many automorphisms does Kr,s have?

(51)

Practical applications in graph drawing, visualization, molecular symmetry, structured boolean satisfiability, formal verification, linear programming...

(52)

Practical applications in graph drawing, visualization, molecular symmetry, structured boolean satisfiability, formal verification, linear programming...

References

Related documents

The P3 intersection graph of G, P3(G) has the induced paths on three vertices in G as its vertices and two distinct vertices in P3(G) are adjacent if the corresponding induced

In the third chapter, we derive expressions for the triangle number of a vertex in a graph, for vertices and edges under some graph operations and introduce

second crack depth and crack position are derived from theoretical, finite element analysis and experimental test corresponding to relative 1 st , 2 nd & 3 rd

Graph 4.21: FOS Vs Total displacements curve for retaining wall inclined with 80 0 and layers extended like geogrids with geocell element and with surface load of 100kN/m 2.

The cliques of ∆(G) are induced by the vertices corresponding to the edges of G incident on a vertex of degree at least 3 whose other end vertices induce a complete graph and by

The following conclusions can be made from the present investigations of the composite beam finite element having transverse non-propagating one-edge open crack. This element

For static analysis of hybrid beams under electromechanical loads, a finite element model (FEM) is developed for the zigzag theory model 2 using cubic Hermite interpolation

This proximity data of all app users are used to build a temporal contact graph, where vertices are devices, and edges indicate proximity between devices for a certain time