Fix issue corresponding to moving on graph
The list of tokens has a higher priority than the list of sub-graphs and
when moving on a graph, even if there is a token in the sub-graphs, the
token on the edge is still selected to move. Also our priority is to
move on the edge or sub-graph instead of going back to the top graph.