Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete...

19
Graph (cont'd)

Transcript of Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete...

Page 1: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Graph (cont'd)

Page 2: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Some special simple graphsComplete Graphs• The complete graph on n vertices, denoted by Kn, is the simple graph that contains exactly one edge between each pair of distinct vertices.

• The graphs Kn, for n = 1, 2, 3, 4, 5, 6 are

Page 3: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Cycle

• The cycle Cn , n ≥ 3 consists of n vertices v1, v2, …, vn and edge {v1, v2}, {v2, v3}, …, { vn-1, vn} and { vn, v1}.

• The cycles C3, C4, C5 and C6 are

Page 4: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Wheels

• Wn when we add an additional vertex to the cycle Cn , for n ≥ 3, and connect this new vertex to each of the n vertices in Cn , by new edges. The wheels W3 , W4 ,W5 and W6 are

Page 5: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Bipartite Graph

Definition• A simple graph G is called bipartite if its vertex set V can be partitioned into two disjoint nonempty sets V1 and V2 such that every edge in the graph connects a vertex in V1 and vertex in V2.(so that no edge in G connects either two vertices in V1 or two vertices in V2).

Page 6: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Example

• C6 is bipartite ?1 2

3

45

6

V1 V2

v1

v3

v5

v2

v4

v6

C6 is bipartite

Page 7: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Example

• K3 is bipartite?

K3 is not bipartite.

Page 8: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Example

• Are the graphs G and H bipartite?

G is bipartite. (a,b,d),(c,e,f,g)

H is not bipartite. Consider a vs (b,f)

Page 9: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

G :

H :

Page 10: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Complete Bipartite Graphs

• Graph Km,n is the graph that has its vertex set partitioned into two subsets of m and n vertices, respectively. • There is an edge between two vertices if and only if one vertex is in the first subset and the other vertex is in the second subset.

Page 11: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Application

Local Area NetworksThe various computers in a building, such as minicomputers

and personal computers, as well as peripheral devices such asprinters and plotters, can be connected using a local areanetwork.

Page 12: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Star topology

• All devices are connected to a central control device.

• A local area network can be represented using a complete bipartite graph K1, n.

• Messages are sent from device to device through the central control device.

Page 13: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Ring topology

• each device is connected to exactly two others.

• Local area networks with a ring topology are modeled using n-cycles, Cn.

• Messages are sent from device to device around the cycle until the intended recipient of a message is reached.

Page 14: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Hybrid topology

• Messages may be sent around the ring, or through a central device.

• Makes the network more reliable.

• Local area networks with this redundancy can be modeled using wheels Wn.

Page 15: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two
Page 16: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Subgraph

Definition• A subgraph of a graph G = (V, E) is a graph H = (W, F) where W V and F E.

Page 17: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Example

• The graph G show in figure is a subgraph of K5

Page 18: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Union

Definition• The union of two simple graphs G1 = (V1, E1) and G2 = (V2, E2) is the simple graph with vertex set V1 V2 and edge set E1 U E2. The union of G1 and G2 is denoted by G1 G2.

Page 19: Graph - Prince of Songkla Universitystaff.cs.psu.ac.th/iew/cs344-381/Graph2.pdf · Complete Bipartite Graphs •Graph K m,n is the graph that has its vertex set partitioned into two

Example

• Find the union of the graphs G1 and G2 show in figure.

Solutiona b c

d e f