I would suggest taking a look at the python package networkx. It is a wonderfully created path optimization and presentation package which has a fair amount of extensabilty.
Basic lowest cost path solutions should be able to solve your algorithmic needs here in polynomial time (Typically N**P time.. compute time through path to the number of nodes power) which is typically adequate for most functional needs ( < 1 sec for 20 nodes) and presents a simple solution path unless the path you present has many loop options or path costs which are mal-formed. Good Luck, -- http://mail.python.org/mailman/listinfo/python-list