@Override
	protected double calcFitness()
	{
		double invalidColoredEdges = 0;
		
		for(int i = 0; i<this.getGenotype().length; i++ )
		{
			int fromNode = phenotype.getEdges()[0][i] - 1;
			int toNode = phenotype.getEdges()[1][i] - 1;
			if( (this.getGenotype()[ fromNode ]).getValue() % this.maxColor == (this.getGenotype()[ toNode ]).getValue() % this.maxColor)
				invalidColoredEdges++;
		}
		
		if( invalidColoredEdges == 0 )
			isValidColoring = true;
		
		return (1 - ( this.maxColor / (double) phenotype.getNumNodes() ) - ( invalidColoredEdges / (double) this.getGenotype().length )) / 2.0;
	}