Implementation of Distance Vector not finding new paths
<p>I am trying to implement the distance vector routing protocol from a text file, and have hit a roadblock, in that my algorithm is not finding new connections between nodes.  My node structure is </p>

<pre><code>public class Node {

    int name;

    public int[][] connections, via;


    Node(int iName, int size) {
        name = iName;
        connections = new int[size][size];
        via = new int[size][size];
    }

}
</code></pre>

<p>and my search algorithm is</p>

<pre><code>for(int i = 0; i &lt; size; i++){
    for(int j = 0; j&lt;size; j++){

        if(node.connections[i][j]!=MAX){

            for(int k = 0; k &lt; size; k++){
                if((node.connections[i][j]+node.connections[j][k])&lt;node.connections[i][k]&amp;&amp;(node.connections[i][j]+node.connections[j][k])&gt;0){
                     node.connections[i][k] = node.connections[i][j] + node.connections[j][k];
                     node.via[i][k] = j;
                     node.via[k][i] = j;
                }
            }
        }
    }
}
</code></pre>

<p>If I play around with the parameters, I can get it to track connections between nodes, but only those that have initially defined connections.</p>
