graph: implement fastpath routines