NavigationalGraph re-implemented and tested.