graph function

Utilities to manipulate graphs