# Vb.NET algorithm Challenge

on
Hello EE!

I need hlep to create a little algorithm that would help to determine next location of a car.

Let's say I have Car 1 and Car 2.

If Car 1 Car and Car 2 leaves from point A and Car 1 goes to address 123 VB Street and Car 2 goes to 456 Csharp Road,

If there is one more address to go, I need a way to know wich car should go (less distance)
and it goes like this... if there were 2 more address... need to check again etc....

Can you help me??
Comment
Watch Question

Do more with

EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
I assume you want an algorithm in pseudo language? Should be something like:

Distance = 999999999999
CarToGo = 0
For Each Car
CarToGo = Car
End If
Loop
SendCar(CarToGo)
Loop

This should work for however many addresses and cars you wish.

Commented:
Well actually I am not sure how to detect address locations (lays say read google map maybe??) and by code detect distance from there etc... ?

Commented:
You would have to connect to the Google Maps API (check this page, for instance: http://www.phpclasses.org/package/3827-PHP-Get-coordinates-of-an-address-using-Google-Maps.html) and retrieve the coordinates for each address. Then you would have to calculate the distance between them. For that you would need to find out the distance between one point and another. After that, it's simply a question of triangulating to find out the real distance (in a straight line, anyway).

Commented:
Sounds interesting...
Only little problem is im not that great in .net, any possibility we can add some code (not pseudo) to the answer ? maybe you dont have time tho
Commented:
I have no knowledge of the google api, so I can't help you with that. Also, it would be dependent on how your addresses are stored and accessed (a listbox, a database, etc) and how you plan to store the car locations.

Best if someone that is more familiar with the google api helps you. I can't do more than help you in a theoretical sense in this.

Do more with