Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search Path help

Status
Not open for further replies.

giahan

Programmer
Sep 1, 2000
139
US
Hi all,

I have a table like:

Origin Destination Connection Description
A B 20 A to B
C B 50 C to B
A D 12 A to D
C D 17 C to D
B D 20 B to D
...

I have to do some type of asp search page to find the path. If Origin A and Destination D are entered, I have to display all posibilities that I can get from A - D. For instance:

Path Connection Descript.
AD 12 A to D
ABD 20 + 20 = 40 A to B, B to D
ABCD 20+50+17= 87 A to B, B to C, C to D

I have thousands of Origin and Destination. There is connection if connection > 0

I have been thinking of it but I get stuck. Any help will be appricated.

Thnks





GH
 
How many pairs of Origin and Destination are we talking here? Are they vectors? In other words, do they always go from a smaller alphabet to a larger alphabet ie. A to B, A to D, and never D to B etc.

It looks like an assignment from a course to list out all IP address connections on the internet.

Regards
 
Probably the best bet here is to implement Dijkstra's Algorithm for shortest weighted path. Many Computer Science books give implementations for this. Usually they are written in C or C++, I have written an implementation for Java but never in VB. Do a search on the Web for Dijkstra and I am sure you will find some helpful resources. Wushutwist
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top