Skip to content
CCC Python Course

Graphs I: modelling and adjacency lists

Stage
4
Module
M4.12
Lessons
1

In this module

  • Recognize when a problem has a graph structure (vertices and edges).
  • Represent a graph as an adjacency list and populate it from input.
  • Understand the tradeoff between adjacency lists and adjacency matrices.
  • Iterate over a vertex's neighbours and apply an algorithm to each.

Before this module

Lessons

  1. 1Graphs and adjacency lists

Practice

Try this on the judge. The link opens the problem on DMOJ.

  1. 2018 J5
    Choose your own path (opens on DMOJ in a new tab) DMOJ

    Model a choose-your-own-adventure book as a graph of pages and links.