Support line graphs

This fixes #87.