I studied Dijkstra's algorithm...but It seems a bit overkill (And if I'm not mistaken...somewhat inefficient) for what I have in mind.
I'm trying(well..tried a long time ago...and revisiting it now) to do a sort of network simulation and this is for the routing part.
If I can have the different 'devices' in the network running concurrently...but being able to send messages to only those to which it is connected by a wire...thus an edge; would the following simple algorithm be a good idea?
(Say...I have a structure 'path' that notes the address of the machine it is passed to into an array....and has a record of the destination(so that it knows when to stop))
The sender send out(broadcasts) such structures, and when the destination node gets it, it returns the traveler to the sender through the path recorded in it.
Whoever returns to the sender first is the winner. (A few other paths are noted ...so they can be used if the best one fails.)
The only problem I see with this is the wastage of bandwidth...
But that may not be a problem because breaking up the IP into 4(or 6) parts reduces the no. of unused broadcasts.
Also...This should be able to return a winner as fast as it takes to traverse the shortest path (x2 ). (...which, to my knowledge is better than the small no. of algorithms I read about)
Any suggestions ? advice ? or debunking ?