Directed and Undirected Graphs

Introduction

A graph is one of the most flexible data structures you will meet in this course: it is simply a set of vertices (nodes) plus a set of edges that connect pairs of them. That minimal definition is powerful because almost any relationship can be modeled with it — friendships, road networks, web links, course prerequisites, package dependencies, and task scheduling. Before you can store a graph or traverse it, you need to be fluent in the vocabulary (vertex, edge, degree, path, cycle, adjacency) and in the single most important modeling decision: whether the edges have direction.

In an undirected graph, an edge between A and B means the relationship runs both ways — if A is a Facebook friend of B, then B is a friend of A. In a directed graph (digraph), each edge points from a source to a target, so A following B on Twitter says nothing about B following A. That distinction changes how you count degree (in-degree and out-degree instead of a single degree), how you store the graph (one entry or two in an adjacency list), and what questions you can ask (reachability, cycles, topological order).

As you watch these videos, keep a running list of two things. First, the terminology: write down each term and a one-sentence definition in your own words, because the rest of the module assumes it. Second, the direction question: for every example shown, ask yourself whether the relationship is inherently symmetric (undirected) or asymmetric (directed), and how the answer would change the code you write later in the module.

Video 1: 0405: Basic types of graphs and select properties

cs128 · 7:00 · 4,485 views · 5y ago · captions — Watch on YouTube

About this video

A short survey of the basic categories of graphs and a few of their key properties, including how the notion of degree is defined differently depending on the kind of graph you are working with. Expect coverage of undirected versus directed graphs and related distinctions such as weighted versus unweighted or simple versus multi-edge graphs, with the properties that follow from each.

Why this video

At seven minutes it is an efficient orientation to the graph types you need to tell apart, and its explicit attention to how degree is defined per graph type directly supports the 'key differences' subtopic.

Video 2: Graph Terminology

Professor Kevin Wortman · 12:37 · 314 views · 4y ago · captions — Watch on YouTube

About this video

A lecture-style walkthrough of standard graph terminology, delivered with slides. It should establish the core vocabulary — vertices, edges, adjacency, degree, paths, cycles, connectivity — and the distinction between directed and undirected edges that the rest of this module builds on.

Why this video

It is the most thorough of the three on definitions, and a careful, slide-based university lecture is the right format for terminology you will be expected to use precisely in assignments and exams.

Video 3: Directed Graph ADT

Professor Kevin Wortman · 5:03 · 315 views · 4y ago · captions — Watch on YouTube

About this video

A focused look at the directed graph as an abstract data type: what a digraph is and what operations it is expected to support. Because it frames digraphs as an ADT, it is likely to separate the interface (adding edges, querying neighbors or successors) from any particular implementation.

Why this video

It gives directed graphs their own dedicated treatment rather than a footnote, and the ADT framing is a natural bridge to the representation and Graph-class work that comes later in this module.

How These Videos Support the Learning Outcomes

Together these three videos target MO1 most directly: the terminology and basic-types videos give you the precise definitions and property differences needed to distinguish directed from undirected graphs, and the directed-graph ADT video sharpens what is special about edges with direction so you can choose the right model for a real-world relationship. They also lay necessary groundwork for the rest of the module — the ADT framing in particular previews the interface your adjacency-list Graph class will implement (MO2, MO4), and a solid grasp of adjacency and reachability is what makes BFS and DFS traversals (MO3, MO5) tractable later. Use these as the vocabulary foundation, then move on to the representation and traversal materials.

About These Videos

These videos were chosen from YouTube on October 2, 2026. Each has captions; the player turns them on. Videos on YouTube can be changed or removed — if one no longer plays, tell your instructor. If a player does not appear, use its Watch on YouTube link.