bug: graphs can be empty