01Chapter 1: What a graph is: vertices and edgesThis chapter assumes you can write basic Python with lists, dictionaries, and sets. It also assumes you know introductory Big-O notation. You do not need to know any graph theory.3 min read
02Chapter 2: Directed and undirected edgesThis chapter assumes you know Python lists, dictionaries, and sets, and that you can read introductory Big-O notation. It covers how an edge's direction changes what the edge means and how you store it.3 min read
03Chapter 3: Weighted and unweighted graphsThis chapter assumes you know Python lists, dictionaries, and sets, and that you have met Big-O notation. It builds on the earlier chapters on vertices, edges, and directed and undirected edges.3 min read
04Chapter 4: Vocabulary: degree, path, cycle, connectivityThis chapter assumes you know what vertices and edges are, and the difference between directed and undirected edges. It also assumes you can read basic Python. The terms below appear in every later chapter, so the goal is to use each one precisely.2 min read
05Chapter 5: Common graph families: trees, DAGs, bipartite, completeThis chapter assumes you know what vertices, edges, direction, degree, paths, cycles, and connectivity mean. It also assumes basic Python and introductory Big-O. A graph family is a set of graphs that share a structural rule. Knowing the family tells you which algorithms and shortcuts are safe to us3 min read
06Chapter 6: Self-loops and parallel edgesThis chapter assumes you know what a graph is, the difference between directed and undirected edges, and the definition of degree. It also assumes you can read basic Python.3 min read
07Chapter 7: Representation 1: the edge listThis chapter covers the simplest way to store a graph, the edge list. It assumes you know Python lists, tuples, and sets, and introductory Big-O notation. It also assumes you know what vertices, edges, direction, and weight mean from the earlier chapters.3 min read
08Chapter 8: Representation 2: the adjacency matrixThis chapter assumes you know Python lists and dictionaries, introductory Big-O notation, and how a graph is described with vertices and edges. The previous chapter stored a graph as an edge list. Here you store the same graph as a table.3 min read
09Chapter 9: Representation 3: the adjacency listThis chapter assumes you know Python lists, dictionaries, and sets, introductory Big-O, and the edge list and adjacency matrix from the earlier chapters. By the end you will build an adjacency list, read its costs, and avoid its common errors.2 min read
10Chapter 10: Storing weights and direction in each representationThis chapter assumes you know what a graph is, the difference between directed and undirected edges, what a weight is, and the three basic structures: edge list, adjacency matrix, and adjacency list. Here you learn how each structure records direction and weight, and the mistakes that come with each2 min read
11Chapter 11: Space and time trade-offs: choosing a representationThis chapter assumes you know the edge list, adjacency matrix, and adjacency list from the earlier chapters. It also assumes introductory Big-O and basic Python. Throughout, V is the number of vertices and E is the number of edges.2 min read
12Chapter 12: Putting a representation to work: breadth-first traversalThis chapter assumes you can read Python, know that a queue is first-in, first-out, and know that a set gives constant-time average membership checks. It also assumes you have seen the adjacency list from the previous chapter.3 min read
13Chapter 13: Implicit graphs: grids and computed neighborsThis chapter assumes you can write a breadth-first search over an adjacency list, as in the previous chapter. It also assumes you are comfortable with tuples, dictionaries, sets, and Python generators.3 min read
14Chapter 14: The incidence matrixThis chapter assumes you know the edge list, the adjacency matrix, and the adjacency list from the earlier chapters. It also assumes you can read nested Python lists and use introductory Big-O notation.3 min read