ruby - The shortest combination of paths that starts and ends with a single node and covers all points in an undirected graph -



ruby - The shortest combination of paths that starts and ends with a single node and covers all points in an undirected graph -

i need algorithm(k, s) where

k number of paths s starting , ending node

and given n number of nodes in undirected graph in nodes linked each other, returns k paths traverse nodes of sum of distances covered k paths shortest.

e.g. given n = 10, algorithm(2,5) might give me array of 2 arrays such sum of distances covered 2 paths shortest , nodes traversed.

[[5,1,2,3,10,5],[5,4,6,7,8,9,5]]

djikstra's algorithm finds shortest path 1 node another, not shortest combination of k paths.

yen's algorithm finds k number of shortest paths 1 node another, not shortest combination of k paths.

what algorithm can help me find shortest combination of k paths starts , end node s such n nodes covered?

what describing above, classical traveling sales man problem, many optimization techniques. 1 such ant colony optimization (http://en.wikipedia.org/wiki/ant_colony_optimization_algorithms)

there many libraries implement aco, find 1 riby, stands, there no easy solutions traveling salesman problem classical (mathematical) approach.

refer: http://en.wikipedia.org/wiki/travelling_salesman_problem

hope helps.

thanks

ruby algorithm graph combinations shortest-path

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -