don't check for shortcut optimization if the graph has teleports