Program.cs
/// <summary>
/// Given a distance matrix, find the max distance for each node
/// </summary>
/// <param name="distanceMatrix"></param>
/// <returns></returns>
Given a distance matrix, find the max distance for each node
Given a distance matrix find the max distance for each node
static int[] GetEccentricityByNode(int[,] distanceMatrix)
        {
            var size = vertices.Length;
            var e = new int[size];
            for (var i = 0; i < size; i++)
                for (var j = 0; j < size; j++)
                    e[i] = Math.Max(e[i], distanceMatrix[i, j]);
            return e;
        }
static int [ ] GetEccentricityByNode ( int [ , ] distanceMatrix ) { var size = vertices . Length ; var e = new int [ size ] ; for ( var i = 0 ; i < size ; i ++ ) for ( var j = 0 ; j < size ; j ++ ) e [ i ] = Math . Max ( e [ i ] , distanceMatrix [ i , j ] ) ; return e ; }
Given a distance matrix, find the max distance for each node
Given a distance matrix find the max distance for each node
// for each node (i), walk through all the destinations (j) and find the max // TODO: What happens when e[i] is zero due to a destination node with no egress?
None
distanceMatrix
int[,]
None