On 25 May 2016 at 16:27, sk <
6b65...@gmail.com> wrote:
> This will be for small graphs, probably less than 2000 nodes, with less than
> 100 selected nodes so it should remain in the realms of the possible to
> brute force (and I can probably optimise by ignoring unchanged parts).
100! ~= 10^158 I'd say a more reasonable limit for brute forcing is 10
nodes. There are better algorithms, still exact, that scale better
than brute force [1], but if you can live with a near optimal
solution, I think some of the heuristics will be much easier to
implement and faster to run [2]. Simulated annealing is probably the
easiest, and has the advantage that you can run it for an arbitrary
amount of time (tradeoff patience-shortness). It is also easy to
launch several parallel instances, and pick the best one.
> I was thinking that the travelling salesman issue was 'simplified' because I knew the shortest path between all of the node pairs already and the nodes will always form a simple 'path' - happy for the confirmation that the assumption was wrong.
Computing all the shortest pairs is just N^2, so comparably cheap. It
is the global ordering that matters.
[1]
https://en.wikipedia.org/wiki/Held%E2%80%93Karp_algorithm
[2]
https://en.wikipedia.org/wiki/Travelling_salesman_problem#Heuristic_and_approximation_algorithms