private static int bfs(int start, double mat[][], int cc, int girth) {
        int baba[] = new int[cc];
        int dist[] = new int[cc];
        for (int i = 0; i < cc; i++) {
            baba[i] = AlgorithmUtils.Max_Int;
            dist[i] = AlgorithmUtils.Max_Int;
        }

        dist[start] = 0;
        baba[start] = -1;
        List<Integer> ll = new ArrayList<Integer>();
        ll.add(start);
        while (ll.size() > 0) {
            int currentNode = ll.remove(0);
            for (int j = 0; j < cc; j++)
                if (mat[currentNode][j] == 1)
                    if (dist[j] == AlgorithmUtils.Max_Int) {
                        dist[j] = dist[currentNode] + 1;
                        baba[j] = currentNode;
                        if (2 * dist[j] < girth - 1)
                            ll.add(j);
                    } else if (dist[j] + dist[currentNode] < girth - 1 && baba[currentNode] != j)
                        girth = dist[j] + dist[currentNode] + 1;

        }
        return girth;
    }