Ejemplo n.º 1
0
        public int CountSupport(Graph pattern)
        {
            List <List <int> > cands = _niindex.GetCandidatesForeachVertex(pattern);

            if (cands.Exists(e => e.Count == 0))
            {
                return(0);
            }

            return(0);
        }
Ejemplo n.º 2
0
        public List <Tuple <IndexedGraph, double, double> > Mine(double minRecall, int maxSize, int[] interestedVertex)
        {
            int supp = (int)(Math.Ceiling(interestedVertex.Length * minRecall));

            if (supp < 2)
            {
                supp = 2;
            }
            List <Tuple <IndexedGraph, double, double> > ret = new List <Tuple <IndexedGraph, double, double> >();

            foreach (var tup in Mine(supp, maxSize, interestedVertex))
            {
                List <List <int> > ccands = _niindex.GetCandidatesForeachVertex(tup.Item1);

                if (ccands.Exists(e => e != null && e.Count == 0))
                {
                    continue;
                }

                _subGTester._cands = ccands;

                //int cnt = 0;
                //foreach (int i in ccands[0])
                //    if (_subGTester.MatchNeighborhood(tup.Item1, _g, i))
                //        cnt++;
                int cnt = 1;

                _subGTester._cands = null;

                ret.Add(new Tuple <IndexedGraph, double, double>(
                            tup.Item1,
                            tup.Item2 * 1.0 / interestedVertex.Length,
                            tup.Item2 * 1.0 / cnt));
            }
            return(ret);
        }