Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 51s1 days 16 hours 1 minutes 51 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 1d 16h 01m 51s1 days 16 hours 1 minutes 51 seconds.

Sign in to watch this lesson
Algorithms - Graphs I · 3:52
Before you can search a graph you have to store it, and the layout decides both the memory and the speed. One six-vertex graph goes through an adjacency matrix (36 cells for 7 edges), adjacency lists (each undirected edge stored twice), an edge list and CSR (two flat arrays built by counting sort), with lists and CSR measured on a million vertices on this Mac. Then we meet graphs that are never stored at all: maze cells numbered r * W + c with neighbours from direction arrays, and state graphs whose vertices are (cell, keys) pairs.