1 / 10

CSC 172 DATA STRUCTURES

CSC 172 DATA STRUCTURES. WORKSHOP LEADER INTEREST MEETING FRIDAY, APRIL 6 th 12:30pm 601 CSB. Good grades in CSC171 & CSC172 Good people skills Favorable approach to workshops. GRAPHS. GRAPH G= (V,E) V : a set of vertices (nodes) E : a set of edges connecting vertices  V

russelljose
Download Presentation

CSC 172 DATA STRUCTURES

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. CSC 172 DATA STRUCTURES

  2. WORKSHOP LEADERINTEREST MEETINGFRIDAY, APRIL 6th12:30pm 601 CSB Good grades in CSC171 & CSC172 Good people skills Favorable approach to workshops

  3. GRAPHS GRAPH G= (V,E) V: a set of vertices (nodes) E: a set of edges connecting vertices  V An edge is a pair of nodes Example: V = {a,b,c,d,e,f,g} E = {(a,b),(a,c),(a,d),(b,e),(c,d),(c,e),(d,e),(e,f)} a b c d e f g

  4. PATHS ON GRAPHS Simple Euler Hamiltonian

  5. SIMPLE PATH Given two vertices is there a simple path that connects them?

  6. HAMILTONIAN PATH Given a starting vertex is there a path through the graph that visits each (and every) vertex exactly once? If the path finishes at the starting vertex, it is a Hamiltonian cycle (a.k.a. The Traveling Salesman Problem).

  7. EULER PATH Given a starting vertex is there a path through the graph that traverses each (and every) edge exactly once?

  8. SIMPLE PATH Given two vertices is there a simple path that connects them? We can find this path in linear O(V + e) time Sort of, recall that e is O(V2) Use Depth first search. How can we modify DFS to print the path?

  9. HAMILTONIAN PATH Given a starting vertex is there a path/cycle/tour through the graph that visits each (and every) vertex exactly once? In order to do this, we may need to consider every possible path. (How many are there?) We may need to consider (V-1)! paths in a complete graph.

  10. EULER PATH Given a starting vertex is there a path through the graph that traverses each (and every) edge exactly once? We can prove that an Euler cycle exists iff the graph is connected and all nodes have even degree. We can find the path in linear time.

More Related