1 / 20

Graphs

Graphs. It's a world-wide webby wonderland. Why?. Graphs are often used to represent real-world information and real-world structures. Graph Theory was even invented to solve a real-world problem.

amelie
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. Graphs It's a world-wide webby wonderland.

  2. Why? • Graphs are often used to represent real-world information and real-world structures. • Graph Theory was even invented to solve a real-world problem. • The city of Kӧnigsbergwas located on the Pregel river in Prussia. The river divided the city into four separate landmasses, including the island of Kneiphopf. • These four regions were linked by seven bridges. Residents of the city wondered if it were possible to leave home, cross each of the seven bridges exactly once, and return home. • Leonhard Euler (a mathematician) and solved it by converting it into a graph

  3. Example

  4. Essential Information

  5. Example: Air routes

  6. Other examples Some courses have pre-requisites. Are there any courses at UW-L that can't be taken because they are pre-requisites to each other (even indirectly via a third course)? Construct a schedule for building a house. what are the most critical (in terms of time) parts of the construction? Send a signal from your cell phone to your friends cell phone in Taiwan. Download a web page from Russia. Whats the best NFL/MLB team?

  7. Graph Arc Vertex

  8. Basic terms • A vertex is a node in the graph • An arc is a an ordered pair of vertices • The arc might connect one vertex to itself. • The arc is one-way (FROM, TO) • When drawn, a vertex is usually a circle (dot) and an arc is a line between the circles where the directionality is given by an arrow. • A graph G consists of a set of vertices V and a set of arcs E. For example: • Let G = (V, E) • where V = {1,2,3,4,5,6} • and E = {{1,2}, {1,5}, {2,3}, {2,5}, {3, 4}, {4, 5}, {4, 6}}

  9. Models and Views • A model is an abstract description of a system. A graph is a mathematical model. • G = ({a,b,c,d,e}, {(a,c), (a,b), (c,b), (c,e), (d,b), (d,d), (e,d)}) • A view is a way to visualize a system or part of a system. A drawing of the model is a view. • For one model, there may be many views.

  10. Terminology G = ({a,b,c,d,e}, {(a,c), (a,b), (c,b), (c,e), (d,b), (d,d), (e,d)}) Vertex A is adjacent to vertex B iff(A,B)is in E. A loop is when a vertex is listed first and last in an arc. The in-degree of a vertex V is the count of arcs of the form (_, V). The number of arcs TO the vertex The out-degree of a vertex V is the count of arcs of the form (V, _). The number of arcs FROM the vertex The order of a graph is the number of vertices The size of a graph is the number of arcs

  11. Terminology (Paths) • A path is a sequence of vertices [V1, V2, V3, V3, …, Vn] such that • For every pair of adjacent vertices Vi and Vjin the path, there is an arc (Vi, Vj) in the graph. • The length of a path is the number of arcs in the path. The length can be zero for the case of a single vertex. • Vertex Vjis connected to vertex Vi iff there is at least one path that starts at Vi and ends at Vj • A cycle is a path where • length > 0 • It starts and ends with the same vertex • A graph with no cycles is acyclic.

  12. Example • Define G • Give the size and order of G. • Is [F, E, C, D] a path? • length? • weight? • What is the degree of E? Of A? • Is H connected to A? • Is A connected to H?

  13. Trees : a Special Kind of Graph • A tree is a graph such that • It has one vertex with in-degree 0. This vertex is known as the 'root'. • Each non-root vertex has an in-degree of 1 • There is a path from the root to every other vertex

  14. Trees : a Special Kind of Graph Some vertices have an out-degree of zero. These vertices are called leaves. There may be many leaves in the tree. A tree is an acyclic graph.

  15. Organizational Chart

  16. Taxonomies

  17. Decision trees

  18. File System

More Related