A company that builds gas pipelines has a project to refit a pipeline at a given site. The problem in question has several constraints that restrict the possibility of connecting sites. Given the prohibitive cost of installing new pipelines, the engineers wish to link two given sites by building the least number of connections possible.
The connections are obviously one way and are given by the source and destination sites. From the candidate connections, the goal is to build as few connections as possible to link the two sites.
Each location name may be up to 30 characters long and may not hold whitespace.
A B D E B C A D C D A E a b b c e f h i c e c f b d d g g i e h f h a i x y y z v w w z x w
1 2 No solution