Top Banner
Young Won Lim 4/19/18 Graph (1A)
35

Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Apr 21, 2018

Download

Documents

duongtruc
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Young Won Lim4/19/18

Graph (1A)

Page 2: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Young Won Lim4/19/18

Copyright (c) 2015 – 2018 Young W. Lim.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".

Please send corrections (or suggestions) to [email protected].

This document was produced by using LibreOffice and Octave.

Page 3: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 3 Young Won Lim4/19/18

Some class of graphs (1)

https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)

Complete graphA complete graph is a graph in which each pair of vertices is joined by an edge. A complete graph contains all possible edges.

Connected graphIn an undirected graph, an unordered pair of vertices {x, y} is called connected if a path leads from x to y. Otherwise, the unordered pair is called disconnected.

Bipartite graphA bipartite graph is a graph in which the vertex set can be partitioned into two sets, W and X, so that no two vertices in W share a common edge and no two vertices in X share a common edge. Alternatively, it is a graph with a chromatic number of 2.

Page 4: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 4 Young Won Lim4/19/18

Complete Graphs

https://en.wikipedia.org/wiki/Complete_graph

Page 5: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 5 Young Won Lim4/19/18

Connected Graphs

https://en.wikipedia.org/wiki/Connectivity_(graph_theory)

This graph becomes disconnected when the right-most node in the gray area on the left is removed

This graph becomes disconnected when the dashed edge is removed.

With vertex 0 this graph is disconnected, the rest of the graph is connected.

Page 6: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 6 Young Won Lim4/19/18

Bipartite Graphs

https://en.wikipedia.org/wiki/Bipartite_graph

Example of a bipartite graph without cycles A complete bipartite graph

with m = 5 and n = 3

A graph with an odd cycle transversal of size 2: removing the two blue bottom vertices leaves a bipartite graph.

Page 7: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 7 Young Won Lim4/19/18

Complete Graphs

https://en.wikipedia.org/wiki/Gallery_of_named_graphs

Page 8: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 8 Young Won Lim4/19/18

Complete Bipartite Graphs

https://en.wikipedia.org/wiki/Gallery_of_named_graphs

Page 9: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 9 Young Won Lim4/19/18

Star Graphs

https://en.wikipedia.org/wiki/Gallery_of_named_graphs

Page 10: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 10 Young Won Lim4/19/18

Wheel Graphs

https://en.wikipedia.org/wiki/Gallery_of_named_graphs

Page 11: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 11 Young Won Lim4/19/18

Some class of graphs (2)

Planar graphA planar graph is a graph whose vertices and edges can be drawn in a plane such that no two of the edges intersect.

Cycle graphA cycle graph or circular graph of order n ≥ 3 is a graph in which the vertices can be listed in an order v1, v2, …, vn such that the edges are the {vi, vi+1} where i = 1, 2, …, n − 1, plus the edge {vn, v1}. Cycle graphs can be characterized as connected graphs in which the degree of all vertices is 2. If a cycle graph occurs as a subgraph of another graph, it is a cycle or circuit in that graph.

TreeA tree is a connected graph with no cycles.

https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)

Page 12: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 12 Young Won Lim4/19/18

Planar Graphs

https://en.wikipedia.org/wiki/Planar_graph

A planar graph and its dual

Page 13: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 13 Young Won Lim4/19/18

Cycle Graphs

https://en.wikipedia.org/wiki/Cycle_graphhttps://en.wikipedia.org/wiki/Gallery_of_named_graphs

Page 14: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 14 Young Won Lim4/19/18

Tree Graphs

https://en.wikipedia.org/wiki/Cycle_graph

Page 15: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 15 Young Won Lim4/19/18

Hypercube

https://en.wikipedia.org/wiki/Hypercube

A hypercube can be defined by increasing the numbers of dimensions of a shape:

0 – A point is a hypercube of dimension zero. 1 – If one moves this point one unit length, it will sweep out a line segment, which is a unit hypercube of dimension one. 2 – If one moves this line segment its length in a perpendicular direction from itself; it sweeps out a 2-dimensional square. 3 – If one moves the square one unit length in the direction perpendicular to the plane it lies on, it will generate a 3-dimensional cube. 4 – If one moves the cube one unit length into the fourth dimension, it generates a 4-dimensional unit hypercube (a unit tesseract).

Tesseract

Page 16: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 16 Young Won Lim4/19/18

Gray Code

https://en.wikipedia.org/wiki/Gray_code

Tesseract

Page 17: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 17 Young Won Lim4/19/18

Adjacency Lists

https://en.wikipedia.org/wiki/Adjacency_list

Page 18: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 18 Young Won Lim4/19/18

Incidence Matrix

https://en.wikipedia.org/wiki/Incidence_matrix

Page 19: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 19 Young Won Lim4/19/18

Adjacency Matrix

https://en.wikipedia.org/wiki/Adjacency_matrix

Page 20: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 20 Young Won Lim4/19/18

Hamiltonian Path

https://en.wikipedia.org/wiki/Path_(graph_theory)

Page 21: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 21 Young Won Lim4/19/18

Minimum Spanning Tree

https://en.wikipedia.org/wiki/Minimum_spanning_tree

Page 22: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 22 Young Won Lim4/19/18

Seven Bridges of Königsberg

https://en.wikipedia.org/wiki/Seven_Bridges_of_K%C3%B6nigsberg

The problem was to devise a walk through the city that would cross each of those bridges once and only once.

Page 23: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 23 Young Won Lim4/19/18

Shortest path problem

https://en.wikipedia.org/wiki/Shortest_path_problem

Page 24: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 24 Young Won Lim4/19/18

Traveling salesman problem

https://en.wikipedia.org/wiki/Travelling_salesman_problem

Page 25: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 25 Young Won Lim4/19/18

Euler Cycle

Johnsonbough, Discrete Mathematics

Any connected graph with even degree vertices

An Euler cycle

A proof by induction on the number of edges in G

A connected graph Gwith even degree vertices only and k edges (k < n)

A connected graph Gwith even degree vertices onlyand n edges

Assume this is trueAn Euler cycle

An Euler cycleThen this holds true

Page 26: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 26 Young Won Lim4/19/18

Euler Cycle

Johnsonbough, Discrete Mathematics

Any connected graph with even degree vertices which has n edge

Any connected graph with even degree vertices which has n-1 edge

Any connected graph with even degree vertices which has n-2 edge

Any connected graph with even degree vertices which has 2 edge

Any connected graph with even degree vertices which has 1 edge

An Euler cycle

An Euler cycle

An Euler cycle

An Euler cycle

An Euler cycle

Page 27: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 27 Young Won Lim4/19/18

Euler Cycle – Base Cases

Johnsonbough, Discrete Mathematics

all even degree vertices

n = 0 edge

n = 1 edge

n = 2 edge an Euler cycle

Page 28: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 28 Young Won Lim4/19/18

Euler Cycle – decrease the number of edges by one

Johnsonbough, Discrete Mathematics

A connected graph Gwith even degree vertices only and n edges (k < n)

A connected graph G'with even degree vertices only and n-1 edges (k < n)

v1 v2 v3

v1 v2 v3

all even degree vertices

all even degree vertices

P: a path from v to v1

P': a portion of the path P that are in G'

e1 e2

e

Page 29: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 29 Young Won Lim4/19/18

Euler Cycle – a path from v to v1

v1 v2 v3

v1 v2 v3

v1 v2 v3

v1 v2 v3

v1 v2 v3

v1 v2 v3

P P P

P ' P ' P '

Johnsonbough, Discrete Mathematics

Case 1: P ends at v1 Case 2: P ends at v

2 Case 3: P ends at v

3

v v v

v v v

Page 30: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 30 Young Won Lim4/19/18

Euler Cycle

en.wikipedia.org

K

J

G

H

F

B

E

D

A

C IABCDEFGHIJK

Page 31: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 31 Young Won Lim4/19/18

Euler Cycle

2 components

G G'

v1

v2

v3 v1

v2

v3

Page 32: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 32 Young Won Lim4/19/18

Euler Cycle

1 component

G G'

v1

v2

v3 v1

v2

v3

Page 33: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 33 Young Won Lim4/19/18

Euler Cycle

2 components

G G'

v1

v2

v3 v1

v2

v3

Page 34: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Graph (5A) 34 Young Won Lim4/19/18

Euler Cycle

1 component

G G'

v1

v2

v3 v1

v2

v3

Page 35: Graph (1A) · 19/04/2018 · discrete_mathematics) Complete graph A complete graph is a graph in which each pair of vertices is joined by an edge.

Young Won Lim4/19/18

References

[1] http://en.wikipedia.org/[2]