CSC 172 DATA STRUCTURES - PowerPoint PPT Presentation

About This Presentation
Title:

CSC 172 DATA STRUCTURES

Description:

CSC 172 DATA STRUCTURES WORKSHOP LEADER INTEREST MEETING FRIDAY, APRIL 6th 12:30pm 601 CSB Good grades in CSC171 & CSC172 Good people skills Favorable approach to ... – PowerPoint PPT presentation

Number of Views:66
Avg rating:3.0/5.0
Slides: 11
Provided by: Thadd2
Category:
Tags: csc | data | structures | depth | first | search

less

Transcript and Presenter's Notes

Title: CSC 172 DATA STRUCTURES


1
CSC 172 DATA STRUCTURES
2
WORKSHOP LEADERINTEREST MEETINGFRIDAY, APRIL
6th1230pm 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)

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.
Write a Comment
User Comments (0)
About PowerShow.com