graph: Refactored, since edges store all information we need.
Invert is deprecated
slicing: use an edge as a slice criterion