def get_minmax(dist):
    """
    Gets the minimum and maximum distances from each city to a specific
    city. Determines a and b (min/max) in histogram.
    :param dist: distances between nodes
    :type dist: array (nested list)
    :return: min/max distances, and their corresponding cities
    :rtype: list
    """
    min, max = dist[0][1], dist[0][2]
    mini, minj, maxi, maxj = 0, 1, 0, 2
    for i in range(len(dist)):
        for j in range(len(dist[i])):
            cur = dist[i][j]
            if cur != 0:
                if cur > max:
                    max = cur
                    maxi, maxj = i, j
                if cur < min:
                    min = cur
                    mini, minj = i, j

    return [min, max, maxi, maxj, mini, minj]