public Object calculate(GraphModel g) {
        SubGraph sg = new SubGraph();
        int limit=r2.nextInt(g.getEdgesCount());

        Vector<Integer> vi = new Vector<Integer>();
        HashMap<Vertex,Vertex> vv= new HashMap<Vertex, Vertex>();
        for(int i=0;i<g.getVerticesCount();i++) {
            vi.add(i);
        }

        Vertex[] varr = g.getVertexArray();
        Vertex[] rvarr = (Vertex[]) rotate(varr,r.nextInt(g.getVerticesCount()-2));


        for(Vertex v1 : rvarr) {
            if(vv.size() > limit) break;
            for(Vertex v2 : g.directNeighbors(v1)) {
                if(vi.contains(v1.getId()) && vi.contains(v2.getId())) {
                    vv.put(v1,v2);

                    vi.remove(vi.indexOf(v1.getId()));
                    vi.remove(vi.indexOf(v2.getId()));
                    break;
                }
            }
        }

        for(Vertex v : vv.keySet()) {
            sg.vertices.add(v);
            sg.vertices.add(vv.get(v));
        }

        for(Vertex v : vv.keySet()) {
            sg.edges.add(g.getEdge(v,vv.get(v)));
        }

        Vector ret = new Vector();
        ret.add("Number of Matching:" + sg.edges.size());
        ret.add(sg);

        return ret;
    }