public int getDegree(final City city) {
        int index = getIndex(city);
        if (index < 0) {
            return -1;
        }
        int degree = 0;
        for (int[] edge : edges) {
            for (int x = 0; x < edge.length; x++) {
                if (x == index && edge[x] != 0) {
                    degree++;
                    /*if (i == index) {
                        ++degree;
                    }   */
                }
            }
        }
        return degree;
    }