graph: introduce GapState and GapMove