graph - prince of songkla universitystaff.cs.psu.ac.th/iew/cs344-381/graph2.pdf · complete...

Post on 09-Aug-2020

2 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Graph (cont'd)

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

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

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

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).

Example

• C6 is bipartite ?1 2

3

45

6

V1 V2

v1

v3

v5

v2

v4

v6

C6 is bipartite

Example

• K3 is bipartite?

K3 is not bipartite.

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)

G :

H :

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.

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.

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.

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.

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.

Subgraph

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

Example

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

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.

Example

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

Solutiona b c

d e f

top related