Tools for working with connectivity matrices