530 likes | 746 Views
Graphs Undirected Graphs Some Basic Definitions Pictorial Representation Directed Graphs Labelled and Unlabelled Graphs Simple Graphs Complete Graphs Bipartite Graphs Subgraph Degree of a Vertex/Graph. Main Menu (Click on the topics below). Graphs. Sanjay Jain, Lecturer,
E N D
Graphs Undirected Graphs Some Basic Definitions Pictorial Representation Directed Graphs Labelled and Unlabelled Graphs Simple Graphs Complete Graphs Bipartite Graphs Subgraph Degree of a Vertex/Graph Main Menu (Click on the topics below)
Graphs Sanjay Jain, Lecturer, School of Computing
What is a graph? Introduction f(x) x
. Singapore . New York . KL . . Jakarta London Graphs: Connectivity
Graphs: Games GP1 GP2 GP3 GP6 GP5 GP4
Sentence Noun phrase Verb Phrase Noun phrase Article Adjective Noun Verb Noun Article young man The caught the ball Graphs: Sentence Structure
. Singapore . New York . KL . . Jakarta London Definition Vertices Edges
An undirected graph, G, consists of two sets a set of vertices called V(G) a set of edges called E(G) Where for each edge we associate a set of one or two vertices from V(G), called the end-points of the edge. The correspondence from edges to end-points is called edge-endpoint function. Undirected Graphs
v3 e3 e1 v2 v1 e2 Undirected Graphs V(G)= {V1, V2 , V3} E(G)= {e1, e2 , e3} e1: {V1, V3}; e2: {V1, V2}; e3: {V2, V3};
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Undirected Graphs V(G)={v1, v2, v3, v4, v5, v6} E(G)={e1, e2, e3, e4, e5, e6, e7}
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Undirected Graphs
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions Edge is said to connectits endpoints. e6 connects v4 and v5.
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions Edge is said to be incident on each of its endpoints. e2 is incident on v1 and v2.
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions Two edges with same endpoints are said to be paralleledges. e3 ande4 are parallel edges.
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions An edge with only one endpoint is called a loop. e5 ande7 are loop.
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions Two vertices connected by an edge are said to be adjacent to each other. v1 andv2 are adjacent to each other.
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions Two edges having a common end point are said to be adjacent to each other. e1 ande2 are adjacent to each other.
e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Some Basic Definitions If no edge is incident on a vertex, then we say that the vertex is an isolatedvertex. v6 is an isolated vertex.
A graph with no vertices is called an empty graph. A graph with at least one vertex is nonempty. Some Basic Definitions
V(G)={v1, v2, v3, v4} E(G)={e1, e2} e1 --- {v1, v2} ; e2 --- {v3, v4} .v1 .v3 .v3 v1. .v2 e1 e1 e2 e2 .v4 .v4 .v2 Pictorial Representation
. . e1 V2 V1 . V3 Directed Graphs e3 e2
Directed Graphs GP1 GP2 GP3 m6 m1 m2 m4 m5 GP6 m3 GP5 GP4
A directed graph (or digraph),G, consists of V(G), the set of vertices D(G) (or E(G)), the set of edges, where each edge is associated with an ordered pair of vertices called its endpoints. If edge e is associated with the pair (u,v), then we say that e is a (directed) edge from uto v. Directed Graphs
. . V1 e1 V2 . e3 e4 e2 V3 Directed Graphs V(G)= {V1, V2 , V3} E(G)= {e1, e2 , e3 , e4 } e1: (V1, V2); e2: (V1, V3); e3: (V2, V3); e4: (V3, V2);
. Quite often, in pictorial representation, we do not label the vertices and edges. . . . Labeled and Unlabeled Graphs Such graphs are called unlabeled graphs. This is often done in the case when the names of vertices/edges are not important.
. . . A graph with no loops or parallel edges is called a simple graph. . . . . G3 G2 G1 Simple graphs
For a simple graph we often identify an edge with its end points. For example in the following graph {v1,v2} is often used to refer to the edge e1 with end points {v1,v2}. .v1 e1 .v2 Simple graphs This normally allows us to ignore the naming of the edges for simple graphs.
G is a complete graph if G is simple and for all distinct vertices v1 and v2 in V(G), there is an edge in E(G) with endpoints {v1 ,v2}. By Kn we denote a complete graph with n vertices. Complete Graphs
K1 K2 K3 K4
Suppose G is a simple graph. If there exists a partition V1 and V2 of V(G) such that for all e E(G), one of the endpoints of e is from V1 and the other is from V2 Bipartite Graphs then the graph G is called a bipartite graph.
Suppose G is a simple graph. If there exists a partition V1 and V2 of V(G) such that for all e E(G), one of the endpoints of e is from V1 and the other is from V2 then the graph G is called a bipartite graph. Bipartite Graphs
Suppose G is a simple graph. If there exists a partition V1 and V2 of V(G) such that for all e E(G), one of the endpoints of e is from V1 and the other is from V2 , and for all u V1 and v V2 there exists an edge in E(G) with endpoint {u,v} Then G is called a complete bipartite graph. By Km,n we denote the complete bipartite graph where V1 and V2 as above have m and n vertices respectively. Complete Bipartite Graphs
K3,2
G1 is a subgraph of G2 iff V(G1) V(G2 ), E(G1) E(G2 ), and for each e E(G1) , endpoints of e in G1 and G2 are the same. We use the notation G1G2 to denote that G1 is a subgraph of G2. Subgraphs
e2 v1 v2 e1 v1 e1 v2 v3 G1 G2 e1 v1 v2 e1 v1 v2 e4 e2 e2 e3 v4 e3 v3 v3 G3 G4 G1 G3 G1 G4 G4 G3 G1 G2
Deg(v)= number of edges incident on v, where we count the loops incident on v twice. Total degree of G = v V(G) deg(v) e7 v3 e4 e5 e6 e1 v5 e3 v6 v4 e2 v1 v2 Degree of a Vertex/Graph
Suppose G is a graph. Then total degree of G =deg(v1)+ deg(v2)+……+ deg(vn) =2 (the number of edges in G) Theorem: Total Degree of a Graph