all core algorithms on graphs defined (I think)
merged with Jakub