Graph for recognizing and routing cardinal direction swipes