@Override
	double calcScore(ArrayList<Integer> parents) 
	{ //returns the maximum value over all parent configurations of SupMaxPair, unless size of parents is 0 or 1
		//when it is 0, the score is 0
		//when it is 1, the score is max over all genotypes of abs(frequency in cases minus frequency in controls)
		if(parents.size() == 0)
		{
			return 0;
		}
		if(parents.size() == 1)
		{
			return supMax1(parents);			
		}
		double bestSupMaxPair = Double.NEGATIVE_INFINITY;
		TreeNode parentConfigs = getParentConfigurations(parents);
		//traverse tree, keeping track of genotype, and at every leaf check whether the frequency of the genotype is highest in the cases or controls, then calculate SupMaxPair accordingly
		int[] genotype = new int[parents.size()];
		//use dfs
		ArrayList<TreeNode> toExplore = new ArrayList<TreeNode>();
		ArrayList<Integer> level = new ArrayList<Integer>(); //the level in the tree of the node at the same position in toExplore (this is the same as the index of the snp in the parent set)
		toExplore.add(parentConfigs);
		level.add(Integer.valueOf(-1)); //the head is level -1, the first snp is at level 0
		while(toExplore.size() != 0)
		{
			TreeNode current = toExplore.get(toExplore.size()-1); //get the most recently pushed node
			int currentLevel = level.get(level.size()-1).intValue();
			if(currentLevel != -1)
			{
				genotype[currentLevel] = current.value;
			}
			toExplore.remove(toExplore.size()-1);
			level.remove(level.size()-1);
			if(current.isLeaf)
			{
				int timesInControls = current.diseaseCounts[0];
				int timesInCases = current.diseaseCounts[1];
				double smp;
				if(timesInControls > timesInCases)
				{
					smp = supMaxPair(parents, genotype, 0, current);
				}
				else
				{
					smp = supMaxPair(parents, genotype, 1, current);
				}
				if(smp > bestSupMaxPair)
				{
					bestSupMaxPair = smp;
				}
			}
			else
			{
				for(int i=0; i < current.Children.length; i++)
				{
					if(current.Children[i] != null)
					{
						toExplore.add(current.Children[i]);
						level.add(Integer.valueOf(currentLevel)+1);
					}
				}
			}
		}
		return bestSupMaxPair;
	}