Class RandomElementwiseSplit

  • All Implemented Interfaces:
    ISplitStrategy

    public class RandomElementwiseSplit
    extends Object
    implements ISplitStrategy
    A split strategy splitting a graph by keeping a specified problem part in both of the generated split parts. The solution part nodes are randomly distributed with respect to a user desired distribution ratio. Afterwards all solution edges are distributed favoring the split part where both source and target node are located. If both split parts contain the same number of edge nodes the edge is allocated randomly and, if appropriate, the winning split part is complemented with the missing edge node to prevent dangling edges. This may lead to split parts overlapping in their solutions nodes.

    Note: Every ModelGraphElement of the graphs handled by this strategy is expected to possess a non-null object reference.

    Author:
    S. John
    • Constructor Detail

      • RandomElementwiseSplit

        public RandomElementwiseSplit​(double nodeDistributionRatio,
                                      Set<org.eclipse.emf.ecore.EObject> problemParts)
      • RandomElementwiseSplit

        public RandomElementwiseSplit​(Random rng,
                                      double nodeDistribution,
                                      Set<org.eclipse.emf.ecore.EObject> problemParts)
    • Method Detail

      • split

        public CoSpan split​(ModelGraph graph)
        Splits each graph in the given list separately applying the strategy described in RandomElementwiseSplit. For each graph in the list a corresponding cospan is created. The order of cospans in the output matches the order of the corresponding graphs in the input.
        Specified by:
        split in interface ISplitStrategy
        Parameters:
        graph - graph to split
        Returns:
        cospan containing split parts and mappings