Shortest route through a one-way system
Haskell, 223 207 characters

main=interact$unlines.f.break null.map words.lines
s%[f,t]=[[f]]#t where[]#_="";x#t|y@(_:_)&lt;-[z|z&lt;-x,last z==t]=unwords$minimum y|1&lt;3=s&amp;x#t
s&amp;z=[x++[b]|x&lt;-z,[a,b]&lt;-s,last x==a,notElem b x];f(s,_:q)=map(s%)q