Introduction to Graphs and Traversal
Tyler Moore
CSE 3353, SMU, Dallas, TX
March 7, 2013
Portions of these slides have been adapted from the slides written by Prof. Steven Skiena at SUNY Stony Brook, author
- f Algorithm Design Manual. For more information see http://www.cs.sunysb.edu/~skiena/
Introduction to Graphs
Many problems can be represented using graphs Once we reduce a problem to a graph, we can often use standard graph algorithms to navigate the graph A graph G = (V , E) is defined by a set of vertices V , and a set of edges E consisting of ordered or unordered pairs of vertices from V Reading for today’s lecture: ADM 145-152 AND Python Algorithms Ch 2. pp. 23–31 and Ch. 5 pp. 101–107, availble from http://lyle.smu.edu/~tylerm/courses/cse3353/pyalg.html Shameless plug: Jailbreaking Information: The Legacy of Hacktivist Aaron Swartz, Fondren Library Mezzanine, TONIGHT 6:30pm-8pm
2 / 28
Social Network as a Graph
Alice Bob Charlie Dawn Eve Fred George Nodes: people Edges: friendship
3 / 28
Road Network as a Graph
Main St 1st Ave 2nd Ave 3rd Ave Main St Elm St Aspen Ave 5th Ave Park St Main St 5th Ave
Nodes: intersections Edges: roads
4 / 28