Thread: Short

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    Short

    I am presently designing a simulator to find the shortest route between 2 noded say A and B. I have finished the interface and input interfacr from the user and i am using linked list... I am able to arrive at an array.. eg:-
    Code:
              A          B          C          D         E        
    
    A       0           2          -          1          2        
    
    B       2           0          1          -          1
    
    C       -            1          0          4         5
    
    D       1            -          4          0         2
    
    E       2            1          5          2        0

    now this matrix represents all the nodes and the distance between them... "-" eans that there is no direct route between the two.. Now i want to find the shortest route beween 2 nodes.. say for example between A to C. So any algorithm or help woul be appreciated....

    The network for the above matrix may look like this..
    Code:
                               A -'------2--------B
                               |      '2        1 '   |
                               1       '   E  '       1
                               |      2'        '5    |
                               D--'------4----'---C
    So the shortest route for the above is A to B to C that is 2 + 1 =3
    The above example and matrix for that was a simple one.. But i have to do this for say 1000 noes sometimes... with all possible routes.. with all kinds of distance....

    So any help,algorithms,links,code snipets etc etc would be appreciated..


    Thanx in Advance
    Last edited by vasanth; 12-13-2002 at 12:57 PM.

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    Last edited by Shiro; 12-13-2002 at 01:16 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Accessing Structures Inside Structures
    By Mellowz in forum C Programming
    Replies: 1
    Last Post: 01-13-2008, 03:55 AM
  2. Help calling function is asm
    By brietje698 in forum C++ Programming
    Replies: 24
    Last Post: 12-06-2007, 04:48 PM
  3. Say what? - Weird error.
    By Blackroot in forum C++ Programming
    Replies: 6
    Last Post: 08-15-2006, 11:54 PM
  4. Color Variety
    By Unregistered in forum C++ Programming
    Replies: 7
    Last Post: 10-23-2002, 09:17 AM
  5. My Allegro Program will not run...
    By Vicious in forum Game Programming
    Replies: 17
    Last Post: 06-14-2002, 12:49 AM