1 / 28

Graphs

Denver. Chicago. LA. Miami. Tampa. Graphs. A Graph G = (V, E) consists of V, a nonempty set of vertices (or nodes ) and E, a set of edges . Each edge has either one or two vertices associated with it, called its endpoints. An edge is said to connect its endpoints.

mariah
Download Presentation

Graphs

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Denver Chicago LA Miami Tampa Graphs A Graph G = (V, E) consists of V, a nonempty set of vertices (or nodes) and E, a set of edges. Each edge has either one or two vertices associated with it, called its endpoints. An edge is said to connect its endpoints. No two different edge connect the same pair of vertices A very simple Computer Network : An example of a simple graph It is also an undirected graph (edges have no direction).

  2. Denver Chicago LA Miami Tampa Now each edge has a direction associated to it. The edges are called directed edges and the graph is called a directed graph. A directed edge is associated with an ordered pair of vertices (u, v). The edge is said to start at u and end at v. Note that e = (u, v) and f = (v, u) are two different directed edges

  3. Denver Chicago LA Miami There are multiple edges (edges connecting the same pair of vertices). The graph is not simple and is called (undirected) multigraphs.

  4. Denver Chicago LA Miami Tampa There are loops in the graph, and the graph is sometimes called a pseudograph.

  5. Helen Doug Mary Charles John Example: Acquaintanceship Graph Use graph to represent various relationships between people. Edge connecting two people when they know each other. The graph is undirected with no multiple edges, or loops.

  6. 352-343-2563 352-343-1453 Vertices are phone numbers. 352-343-6745 Each directed edge (u, v) represents a call from u to v. A directed graph 352-343-3424 Example: Call Graphs Use graph to model telephone calls made in a network (say a long distance telephone network).

  7. Example: The Web Graph The World Wide Web can be modeled as a directed graph. A vertex represents a web page and a directed edge (u, v) represents a link on u pointing to v. Extra Credit Assignment Cot3100 Homepage Vertices are web pages. Slides Each directed edge (u, v) represents a link on u pointing to v. A directed graph WebCT

  8. Graph Terminology Two vertices u and v in an undirected graph G are called adjacent (or neighbors) in G if u and v are endpoints of an edge of G. If e is associated with { u, v }, the edge e is called incident with the vertices u and v. The edge e is also said to connect u and v, and u and v are endpoints of e. The degree of a vertex in an undirected graph is the number of edges incident with it (a loop contributes twice to the degree of that vertex).

  9. Helen Doug Mary Charles John deg ( Mary) = 3, deg(John) = 1, deg(Charles)=2, deg(Doug)= 2 and deg(Helen) = 2.

  10. The Handshaking Theorem Let G = (V, E) be an undirected graph with e edges. Then 2 e = Σv deg(v) If we add all the degrees (of vertices), each edge will be counted twice. Hence the result. Corollary: An undirected graph has an even number of vertices of odd degree. 2 e = Σv deg(v) = Σv:odddeg(v) + Σv:even deg(v)

  11. Helen Doug Mary Charles John deg ( Mary) = 3, deg(John) = 1, deg(Charles)=2, deg(Doug)= 2 and deg(Helen) = 2. The sum of all degrees is 10 There are 5 edges. There are two vertices with odd degree.

  12. 352-343-1453 In-degree=3 out-degree=2 352-343-2563 in-degree = 3, out-degree=1 352-343-6745 out-degree=4 352-343-3424 out-degree=1, in-dgree=2

  13. Cycles n vertices, v1, v2, ….., vn and edges { v1, v2 }, …, {vn-1, vn }

  14. b a c g f e d {a, b, d }, {c, e, f, g} K3, 4

  15. females, or suppliers Males, or warehouses

  16. If a is in V1, then, b, d, e must be in V2 (why?) Then, c is in V1 and there is no inconsistency. So we can rearrange the graph as follows:

More Related