views:

610

answers:

6

I have a sea of weighted nodes with edges linking clusters of nodes together. This graph follows the typical small world layout.

I wish to find a path finding algorithm, which isn't costly on processor power, to find a path along the best possible path where the nodes are the most favorably weighted, the fastest route is not the most important factor. This algorithm, also takes into consideration load bearing, and traffic rerouting.

(sidenote: could neural networks be used here?)

Thanks


I'm looking at ACO. Is there anything better than ACO for this kind of problem?


Right the A* algorithm finds the least cost or fastest route, without load balancing.

Lets say that the fastest or shortest route is not the most important route, what is more important is following a path where the weighted nodes have a certain value. no1.

no2. If using A* the traffic on that route gets overloaded then suddenly that path is redundant. So as cool as A* is, it doesnt have certain features that ACO ie inherent load balancing.

-- unless im mistaken and misunderstood A*

Then what beats ACO?


It really looks like a show down between ACO and A* , there has been so much positive talk about A* , I will certainly look deeper into it.

Firstly in response to David; I can run ACO simulation in the back ground and come up with the best path, so yes there is an initial startup cost but the startup luckily isnt essential. So i can afford to run a simulation multiple times. The one real trouble is finding connected source and destination nodes. Whereas it seems A* will be able to do this quite easily. Now what happens when this network get dreadfully large like in millions of nodes. Will A* be able to scale easily?

I will research A* further. But I leave you with a last question!

Will A* be able to scale as well as Antnet (ACO)?

+5  A: 

The most commonly used algorithm for this problem is A* (A Star), which is a generalized Dijkstra's algorithm search with added heuristics - the purpose of the heuristics is to direct the search towards the search goal so that typical searches finish faster.

This algorithm has many variants, derived versions and improvements, Google search or the Wikipedia page should be a good starting point.

Suma
A: 

Would a common Dijkstra's not be sufficient?

http://www.improve.dk/blog/2008/05/12/generic-dijkstras-algorithm

Mark S. Rasmussen
+1  A: 
Mecki
+4  A: 

With A*, the path cost does not need to be constant, so you could start with the following graph:

A---1---B---1---C
|               |
\-------1-------/

where we want to go from A to C. Initially, the path finding algorithm will choose the A-C path since A-B-C is 2 whereas A-C is 1. We can add an extra term to the paths:

A---r---B---r---C
|               |
\-------r-------/

with

r(NM) = k(NM) + users(NM) / 10

where

r(NM) is the cost for a connection between N and M,
k(NM) is the constant cost for a connection between N and M,
users(NM) is the number of objects using the connection

As users are added to the system, the route A-C will become more expensive than A-B-C at twenty users (1 + 20/10) = 3, A-B-C is 2. As users are removed from the system, the A-C route will become the best option again.

The real power of the A* is the heuristic you use to calculate the cost of each connection.

Skizz

Skizz
brilliant, you have given me food for thought!
Setori
+4  A: 

General notes

Dijkstra's algorithm and it optimised variant A* find the path with "the" minimal cost through your graph. The important things are a) defining your graph correctly and b) defining an appropriate cost function.

In the face of a changing cost function Dijksta requires one to re-calculate the solution.

For load-balancing I would extend Dikstra to not only calculate the optimal path, but use some kind of flood-fill behaviour to create a set of possible paths (sorted by cost) to find alternatives. Only knowledge about the specific problem and cost function can answer whether and how this might work.

Ant Colony Optimisation on the other hand seems to be much more flexible in adapting to a changing cost function, by continuing the iteration after/while the cost function changes.

Efficiency

This depends very much on your problem domain. If you have a good heuristic (see the Complexity section of the A* article) and seldom cost changes then A*'s polynomial runtime might favour repeated re-calculations. ACO on the other hand has to iterate over and over again before converging on an approximate solution. If cost changes occur very frequently, continuing the iteration at a constant rate might be more efficient than updating the A*-solution, since information is retained within the state of the algorithm. ACO doesn't promise the optimal solution, though and probably has higher start-up costs before converging onto a "good" solution. Again that very much depends on your specific domain, graph and cost function as well as your requirements on optimality.

David Schmitt
It was difficult, choosing who to give the right answer to. We will choose A* to lessen the weakness of Antnet, in determining if the source and dest node are connected. If they are then start Antnet with an A* pheromone trail. We really need Antnet for its flexibility.5 sources 1 destination
Setori
As we have previous pheromone history that would be foolish to neglect as those paths proved reliable. So we can overlay the history pheromone data along with the new sought out A* artificial pheromone. Then let the ants run with this information.
Setori
Thank you everyone.
Setori
fyi http://www.boost.org/doc/libs/1_36_0/libs/graph/doc/astar_search.html
Setori
A: 

I have heard of a NN implementation to handle this kind of problem as well. So if you want to use NNs you will eventually find your way ;-) but they must be inferior in comparison to "genetic algorithms".

If the computational/time consumption is an issue, I would highly suggest using genetic algorithms. This is excactly the type of problems they are exceptional at.

GAs are based on a function that describes your satisfaction for any given solution. You can modify this function to suit your needs (ie. you can include not only path cost but any factor you wish).

Wartin