Now, the important thing to understand to be able to figure this out here is that if the Boolean formula has a satisfying assignment then a shortest path from A to B that visits all vertices can visit each of these vertices by basically paying just one extra edge. 