Distance Routing Vector Implementation
<p>I am trying to implement Distance Vector Routing algorithm, using <a href="http://www.cs.bu.edu/fac/byers/courses/791/F99/scribe_notes/cs791-notes-990923.html" rel="nofollow">http://www.cs.bu.edu/fac/byers/courses/791/F99/scribe_notes/cs791-notes-990923.html</a><br>
(in  C++). </p>

<p>Here is what I have done so </p>

<p>far:</p>

<pre><code>i) Read no. of nodes.

ii) Implement the points 1 to 4 in the article as:

     for(i = 0; i &lt; nodes; i++) //nodes is the no. of nodes
     {
         for(j = 0; j &lt; nodes; j++)
         {
             if(distanceVector[i][j] != 0) //distanceVector holds the cost value between every pair of links, 0 if no link exists
             {
                  for(k = 0; k &lt; nodes; k++)
                  {
                       if((distanceVector[i][j] + distanceVector[j][k]) &lt; distanceVector[i][k])
                       {
                             distanceVector[i][k] = distanceVector[i][j] + distanceVector[j][k];
                             via[i][j] = i; // intermediate node, in case no link exists
                             via[j][i] = j;
                       }
                  }
              }
         }
     }
</code></pre>

<p>I get the same  array / matrix as it is. I have also tried juggling <strong>i, j, and k</strong>, but of no use.</p>

<p>Am I right in my implementation...???</p>
