Graphs

Graphs: Who Knows Whom? When Anything Can Connect: Graphs, Are These Two Friends? Adjacency Lists and Grids.

Updated

  1. Who Knows Whom? When Anything Can Connect: Graphs (Journeyman): Find a person's friends in one step, in a network where anyone can know anyone and friendships loop back around: why a list of pairs and a tree both fall short, and the structure that fits, the graph, with one-way and two-way connections and weights.
  2. Are These Two Friends? Adjacency Lists and Grids (Journeyman): Answer "are these two already friends?" in one step without running out of memory, before every Add friend button: why reading a friend list and a box for every pair both fall short at a million people, and how to choose between an adjacency list, a set per person and an adjacency matrix.