Exemplo n.º 1
0
 public void ConstructPartitions(List <Problem <Hypergraph.EdgeAnnotation> > problems)
 {
     totalProblems += problems.Count;
     //
     // For each problem, add to the appropriate partition based on the query vector
     //
     foreach (Problem <Hypergraph.EdgeAnnotation> problem in problems)
     {
         bool added = false;
         foreach (ProblemEquivalenceClass partition in partitions)
         {
             if (partition.IsStrictlyIsomorphic(problem, query))
             {
                 partition.Add(problem);
                 added = true;
                 break; // If this problem is in several partitions, we should delete this; this is more applicable with non-strict isomorphism
             }
         }
         // If this problem was not added into a partition, create a new partition
         if (!added)
         {
             ProblemEquivalenceClass newPartition = new ProblemEquivalenceClass(graph);
             newPartition.Add(problem);
             partitions.Add(newPartition);
         }
     }
 }
Exemplo n.º 2
0
 public void ConstructPartitions(List<Problem<Hypergraph.EdgeAnnotation>> problems)
 {
     totalProblems += problems.Count;
     //
     // For each problem, add to the appropriate partition based on the query vector
     //
     foreach (Problem<Hypergraph.EdgeAnnotation> problem in problems)
     {
         bool added = false;
         foreach (ProblemEquivalenceClass partition in partitions)
         {
             if (partition.IsStrictlyIsomorphic(problem, query))
             {
                 partition.Add(problem);
                 added = true;
                 break; // If this problem is in several partitions, we should delete this; this is more applicable with non-strict isomorphism
             }
         }
         // If this problem was not added into a partition, create a new partition
         if (!added)
         {
             ProblemEquivalenceClass newPartition = new ProblemEquivalenceClass(graph);
             newPartition.Add(problem);
             partitions.Add(newPartition);
         }
     }
 }