Various graph-theory stuff.