java - Finding inexpensive path that visits all nodes -


i in process of going through old programming olympiad questions, , found question 5 rather difficult. problem based in category of graph theory , involves computing inexpensive path , visiting nodes. full details can found here: problem

would suitable use a* search algorithm? kind of algorithm use solve problem, fast implement , can solve problem in given time period?

as @kiheru stated, a* won't work.

this traveling salesman problem, , it's np complete problem. replace tolls distance traveled, , same problem. traveling salesman link has several of such algorithms.

traveling salesman

you'll find different algorithms depending on number of cities, gets more computationally expensive add cities computer isn't best choice exact solution. there many different techniques getting approximation, it's not solvable problem.

if code it, i'd use called linguistic geometry (something learned in grad school). treat nodes game board, , take 1 step @ time towards answer want , evaluate it. won't solve it, give approximation in short amount of time.


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -