public Object calculate(GraphModel g) {
        ZagrebIndexFunctions zif = new ZagrebIndexFunctions(g);
        ZagrebIndexFunctions zifL = new ZagrebIndexFunctions(LineGraph.createLineGraph(g));

        RenderTable ret = new RenderTable();
        Vector<String> titles = new Vector<>();
        titles.add(" p ");

        double maxDeg = 0;
        double maxDeg2 = 0;
        double minDeg = Integer.MAX_VALUE;
        double minDeg2 = Utils.getMinNonPendentDegree(g); 

        ArrayList<Integer> al = AlgorithmUtils.getDegreesList(g);
        Collections.sort(al);
        maxDeg = al.get(al.size()-1);
        if(al.size()-2>=0) maxDeg2 = al.get(al.size()-2);
        else maxDeg2 = maxDeg;
        minDeg = al.get(0);
        if(maxDeg2 == 0) maxDeg2=maxDeg;

        double a=0;
        double b=0;
        double c=0;
        double d=0;
        int p = NumOfVerticesWithDegK.numOfVerticesWithDegK(g, 1);

        for(Vertex v : g) {
            if(g.getDegree(v)==maxDeg) a++;
            if(g.getDegree(v)==minDeg) b++;
            if(g.getDegree(v)==maxDeg2) c++;
            if(g.getDegree(v)==minDeg2) d++;
         }
        if(maxDeg==minDeg) b=0;
        if(maxDeg==maxDeg2) c=0;

        double m = g.getEdgesCount();
        double n = g.getVerticesCount();

        double M12=zif.getSecondZagreb(1);
        double M21=zif.getFirstZagreb(1);
        double M31=zif.getFirstZagreb(2);
        double M41=zif.getFirstZagreb(3);
        double M22=zif.getSecondZagreb(2);
        double Mm31=zif.getFirstZagreb(-4);
        double Mm11=zif.getFirstZagreb(-2);


        Vector<Object> v = new Vector<>();
        v.add(p);
        ret.add(v);


        //  v.add(2*M12+(a*maxDeg*maxDeg*maxDeg)+(c*maxDeg2*maxDeg2*maxDeg2)
        //	+((maxDeg+maxDeg2)*(M21-a*maxDeg*maxDeg-c*maxDeg2*maxDeg2))
        //		+((maxDeg-maxDeg2-1-maxDeg*maxDeg2)*(2*m-a*maxDeg-c*maxDeg2)));

        // v.add(zif.getFirstZagreb(1));

        // v.add((2*m*(maxDeg+minDeg))
        //       - (n*minDeg*maxDeg)
        //     - (n-a-b)*(maxDeg-minDeg-1));


        return ret;
    }