CS 2223 Dec 01 2015
Expected reading: 515-527
Daily Exercise:
Yoda: No more training do you require. Already know you, that which you need.
Luke: Then I am a Jedi.Yoda: No. Not yet. One thing remains. Vader. You must confront Vader. Then, only then, a Jedi will you be. And confront him you will.
Star Wars: Episode VI
1 Quiz and Final Preparation
1.1 Quiz 1 starts
12 minutes to complete. I will handout starting exactly at 1:59 PM and will pick up at 2:12 PM.
Lecture will resume at 2:15
1.2 HW4 Question 2
What does it mean for individual elements being inspected. Clarifications.
1.3 Graphs
We are now studying a new domain in computer science called Graphs. A graph represents not just a set of items but the relationships between those items, which may be dynamically changed.
Start with some definitions:
A graph is a set of vertices and a collection of edges that each connect a pair of vertices.
Note that the graph is defined by a set of vertices; each vertex is therefore unique. Each vertex may have any number of edges (zero or more). However, it is common to avoid the following situations:
Self-loops: when a vertex has edge back to itself
parallel edges: when a vertex has multiple edges to the same paired vertex.
For our purposes, we will focus on simple graphs that avoid these two anomalies.
In this first lecture we are going to cover a number of new terms that are necessary to understand within the domain of graphs.
Vertex u is adjacent to vertex v if there exists an edge (u,v) in the graph.
A subgraph is a subset of a graph’s edges and the vertices that are connected to those edges.
A path is a sequence of vertices connected by edges.
A cycle is a path with at lease one edge whose first and last vertices are the same.
The length of a path or a cycle is the number of edges in the path.
A graph is connected if there is a path from every vertex to every other vertex in the graph.
1.4 Trees
We have covered the Binary Tree structure in the context of Binary Search Trees, but when we come to graphs, the term Tree is a more generalized term.
A Tree is a graph that is fully connected and contains no cycles.
1.5 Code Example
The bulk of this lecture is to understand the code handout. This implementation is just one of three possible ways to structure the data for a graph.
1.6 Webinar today
I will be presenting a webinar at 4PM today on the Bloom Filter and its use. Find here if you want. It will be archived for viewing in about 2 days if you can’t make it live.
1.7 Version : 2015/12/03
(c) 2015, George Heineman