1 / 27

Graph Theory

Graph Theory. Algorithms Breadth First Search (BFS) Depth First Search (DFS) Dijkstra’s Algorithm. Famous and Productive Problem of Graph Theory

vance
Download Presentation

Graph Theory

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. Graph Theory AlgorithmsBreadth First Search (BFS) Depth First Search (DFS) Dijkstra’s Algorithm

  2. Famous and Productive Problem of Graph Theory Four Color Problem: Is it true that any map drawn in the plane may have its regions colored with four colors in such a way that any two regions having a common border have different colors?

  3. Is there a way to color this map using four different colors and still ensure that bordering states all have different colors?

  4. What Is Graph Theory? The Study of Graphs • DEFN: Structures used to model relationships between objects • Often used to describe a collection of nodes (vertices) and edges

  5. Different Types of Graphs Graphs come in two distinct forms Undirected vs. Directed Graphs Although they are grouped under the umbrella term of graph, these graph have specific characteristics that distinguish them from each other

  6. Undirected Graph DEFN: Set of nodes connected by edges but there is no distinction between vertices associated with each edge EXPLANATION: In the eyes of the graph, there is no difference between the edges that connect nodes. Basically the edge that connects vertices (6,4) is the very same edge that connects vertices (5,2)

  7. Undirected Graphs

  8. Directed Graph DEFN: Set of nodes connected by edges, where the edges have a direction associated with them EXPLANATION: Major difference between edges. The edge that connects vertices (7,8) is DIFFERENT from the edge that connects vertices (3,10) MAJOR INDICATION: THE ARROWS!!

  9. Directed Graphs

  10. Applications Used to model many types of relationships Have use in many aspects of physical, biological, and social system • Many problems of practical interest can be represented by graphs

  11. Computer Science Applications Can be used to represent network of communication, data organization, flow of computation, and more Practical Example The links on a website can represented by a directed graph. The vertices are the web pages available at the website and a directed edge from page A to page B exists if and only if A contains a link to B.

  12. Other Applications Chemistry Math Sociology

  13. Algorithms What is an ALGORITHM? DEFN: Set of step by step procedure for calculation Output Input Set of Directions “Algorithm”

  14. Types of Algorithms Simplistic Algorithms Complex Algorithms Main purpose: Based on given problem, can you create step by step instructions to produce an appropriate solution?

  15. Breadth First Search Algorithm Algorithm used for searching a graph Starts at the root (top of the graph) and does a layer by layer search Moves left to right during its search

  16. BFS Does a layer by layer search

  17. Depth First Search Algorithm Another algorithm used for searching a graph Starts at the root (top of the graph) Moves left to right during its search Major Difference: Starts at the root and explores as far as possible along each branch before backtracking

  18. DFS Does a depth search before backtracking

  19. Dijkstra’s Algorithm Discovered by Dutch computer scientist EdsgerDijkstra in 1956 DEFN: Graph search algorithm that solves the shortest path problem with edge path cost to produce a shortest path tree SIMPLY: How can we get from the start position to the end position in the least amount of “steps”

  20. Dijkstra’s Algorithm The major thing to notice in this graph is that the edges have specific numbers given to them called “weights” Weights

  21. Remember? Undirected graph implementation of Dijkstra’s algorithm Directed graph implementation of Dijkstra’s algorithm The addition of the value of weights to the edges is the major difference between the normal implementation of undirected and directed graphs and Dijkstraimplementation of those graphs

  22. How To Tackle Dijkstra Problems The idea is to get from the start position to the end position You want to take the road that will give you the least value in the end End Start

  23. Example The best way to leave how to do this is to run through an example Dijkstra's Algorithm for Shortest Route Problems

  24. Famous and Productive Problem of Graph Theory Four Color Problem: Is it true that any map drawn in the plane may have its regions colored with four colors in such a way that any two regions having a common border have different colors?

  25. Solution to The Four Color Problem

  26. Four Color Problem

  27. Worksheet Time!!!!

More Related