html5-img
1 / 13

Dijkstra’s Algorithm

Dijkstra’s Algorithm. Terminology. Graph (G) : A set of items connected by edges. Each item in a graph is called a vertex or edge. Vertex (V) : An item in a graph, sometimes referred to as a node. (A node is a unit of reference in a data structure.)

kerem
Télécharger la présentation

Dijkstra’s Algorithm

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. Dijkstra’s Algorithm

  2. Terminology • Graph (G) : A set of items connected by edges. Each item in a graph is called a vertex or edge. • Vertex (V) : An item in a graph, sometimes referred to as a node. (A node is a unit of reference in a data structure.) • Edge (E) : A connection between two vertices of a graph. • Weighted Graph : A graph which has a weight, or number, associated with each edge.

  3. Dijkstra’s Algorithm is… • Named after it’s creator E.W. Dijkstra. He is a Professor of Mathematic at the University of Amsterdam. • An algorithm for finding the shortest path between two vertices (or nodes). This algorithm has the added benefit of finding the shortest path from a given source to all points in the graph at the same time. Because of this it is sometimes referred to as the single-source shortest path algorithm • Requires all edged weights to be positive. • Its time efficiency is O (E log V).

  4. GRAPH

  5. Step 1 Dijkstra’s Algorithm A can see B and C B WINS WITH A COST OF 30!

  6. Step 2 Dijkstra’s Algorithm B can see C and D C WINS WITH A COST OF 40!

  7. Step 3 Dijkstra’s Algorithm C can see D and E E WINS WITH A COST OF 50!

  8. Step 4 Dijkstra’s Algorithm E sees nothing… However, other nodes are seen from previously seen vertices.

  9. Completed Dijkstra’s Algorithm

  10. Generates the following Arrays:

  11. Dijkstra’s Algorithm is GREEDY! • A Greedy Algorithm is defined as follows: • An algorithm that always takes the best immediate or local, solution while finding an answer. Greedy algorithms find the overall or globally optimal solution.

  12. Warshall’s Algorithm O (V3) Floyd’s Algorithm O (V3) Dijkstra’s Algorithm O (E Log V) Dijkstra WINS!!!

  13. Group D Presentation 1)Warshall’s Algorithm 2)Floyd’s Algorithm 3)Dijkstra’s Algorithm Prepared by: Michael Cicarella Gabriela Ruz Marius Janusaitis

More Related