public static int getNumOfQuadrangles(GraphModel graph) {
        int quadrangles = 0;
        for (Vertex i : graph)
            for (Vertex j : AlgorithmUtils.getNeighbors(graph, i))
                for (Vertex k : AlgorithmUtils.getNeighbors(graph, j))
                    for (Vertex l : AlgorithmUtils.getNeighbors(graph, k))
                        if (l != j &&
                                l != i &&
                                k != i &&
                                graph.isEdge(i, l)) quadrangles++;

        return quadrangles / 8;
    }