• 240 likes • 314 Views
Section 8.2. Graph Terminology. Terms related to undirected graphs. Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in G if there is an edge {u,v} Incident, connect: if edge e = {u,v}, e is incident with vertices u & v, and e connects u and v
E N D
Section 8.2 Graph Terminology
Terms related to undirected graphs • Adjacent: 2 vertices u & v in an undirected graph G are adjacent (neighbors) in G if there is an edge {u,v} • Incident, connect: if edge e = {u,v}, e is incident with vertices u & v, and e connects u and v • Endpoints: vertices u & v are endpoints of edge e
Terms related to undirected graphs • Degree of vertex in an undirected graph is the number of edges incident with it • loops count twice • degree of vertex v is denoted deg(v) • Example: what are the degrees of the vertices in this graph?
Terms related to undirected graphs • Isolated vertex (like e in previous example) has degree 0, not adjacent to any other vertex • Pendant vertex (like d in previous example) - adjacent to exactly one vertex • The sum of the degrees of all vertices in a graph is exactly twice the number of edges in the graph
Handshaking Theorem • Let G=(V,E) be an undirected graph with e edges; then 2e = • Note that sum of degrees of vertices is • always even; this leads to the theorem: An undirected graph has an even number of vertices of odd degree
Terminology related to directed graphs • Let G be a directed graph, with an edge e=(u,v): • u is initial vertex • v is terminal, or end vertex • u is adjacent TO v • v is adjacent FROM u • initial & terminal vertex of a loop are the same
Terminology related to digraphs • In-degree of vertex v, denoted deg-(v), is the number of edges with v as the terminal vertex • Out-degree of vertex v, denoted deg+(v), is the number of edges with v as the initial vertex • A loop has one of each
Terminology related to digraphs • The sum of in-degrees is equal to the sum of out-degrees • Both are equal to the number of edges in the graph: • Let G=(V,E) be a directed graph; then • The undirected graph that results from ignoring • arrows in a directed graph is called the underlying • undirected graph
Classes of simple graphs • Complete graphs: complete graph on n vertices, denoted Kn, is the simple graph that contains exactly one edge between each pair of distinct vertices; Examples:
Classes of Simple Graphs • Cycle: Cn, where n 3, consists of n vertices v1, v2, … , vn and edges {v1, v2}, {v2, v3}, … , {vn-1, vn} Examples:
Classes of Simple Graphs • Wheel: a cycle with an additional vertex, which is adjacent to all other vertices; example:
Classes of Simple Graphs • n-Cube: denoted Qn, is a graph representing the 2n bit strings of length n: • 2 vertices are adjacent if and only if the bit strings they represent differ in exactly one position. Examples:
Bipartite Graphs • A simple graph G is called bipartite if its vertex set V can be partitioned into 2 disjoint non-empty sets V1 and V2 such that: • every edge connects a vertex in V1 with a vertex in V2 • no edge connects 2 vertices in V1 or in V2
Example: lining up 1st graders Cate John Mary Mark Mary Ann Terry Mary Pat Tim Marie Jimmy
Example - cycle • C6 is bipartite; can partition its vertex set into 2 distinct sets: • V1 = {v1, v3, v5) • V2 = {v2, v4, v6} • with every edge connecting a vertex in V1 with one in V2
Examples Graph at left is not bipartite; to divide into 2 sets, one set must include 2 vertices and to be bipartite, those vertices must not be connected But every vertex in this graph is connected to 2 others This graph, on the other hand, is bipartite; the two sets are V1 = {v1, v3, v5} and V2 = {v2, v4, v6} Note that the definition doesn’t say a vertex in one set can’t connect to more than one vertex in the other - only that each in one must connect to one in the other, and no vertex in a set can connect to a vertex in the same set
Complete Bipartite Graphs • Denoted Km,n is the graph that has its vertex set partitioned into 2 subsets of m vertices and n vertices • There is an edge between 2 vertices if and only if one vertex is in the first subset and the other is in the second subset
Applications of Special Types of Graphs: LAN topology • A star is a complete bipartite K1,n graph: • A ring is an n-cycle: • A redundant network may have both a central hub and a ring, forming a wheel:
Subgraph • Graph obtained by removing vertices and their associated edges from a larger graph; more formally: • Subgraph of G=(V,E) is H=(W,F) where WV and FE
Can combine graphs, forming a union • Let G1 = (V1, E1) and G2 = (V2, E2) • The union, G1 G2 = (V1 V2, E1 E2)
Section 8.2 Graph Terminology