Index: trunk/tools/HeuristicLab.FileShrinker/HeuristicLab.FileShrinker.csproj
===================================================================
--- trunk/tools/HeuristicLab.FileShrinker/HeuristicLab.FileShrinker.csproj	(revision 9497)
+++ trunk/tools/HeuristicLab.FileShrinker/HeuristicLab.FileShrinker.csproj	(revision 9497)
@@ -0,0 +1,87 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{9CF08DFF-A43E-4385-B5C7-818ECBEA98F1}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.FileShrinker</RootNamespace>
+    <AssemblyName>HeuristicLab.FileShrinker</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Collections-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4">
+      <HintPath>..\..\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="Program.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: trunk/tools/HeuristicLab.FileShrinker/HeuristicLab.FileShrinker.sln
===================================================================
--- trunk/tools/HeuristicLab.FileShrinker/HeuristicLab.FileShrinker.sln	(revision 9497)
+++ trunk/tools/HeuristicLab.FileShrinker/HeuristicLab.FileShrinker.sln	(revision 9497)
@@ -0,0 +1,20 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2012
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.FileShrinker", "HeuristicLab.FileShrinker.csproj", "{9CF08DFF-A43E-4385-B5C7-818ECBEA98F1}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{9CF08DFF-A43E-4385-B5C7-818ECBEA98F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{9CF08DFF-A43E-4385-B5C7-818ECBEA98F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{9CF08DFF-A43E-4385-B5C7-818ECBEA98F1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{9CF08DFF-A43E-4385-B5C7-818ECBEA98F1}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: trunk/tools/HeuristicLab.FileShrinker/Program.cs
===================================================================
--- trunk/tools/HeuristicLab.FileShrinker/Program.cs	(revision 9497)
+++ trunk/tools/HeuristicLab.FileShrinker/Program.cs	(revision 9497)
@@ -0,0 +1,79 @@
+﻿using System.Collections;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Core;
+using HeuristicLab.Persistence.Default.Xml;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.FileShrinker {
+  class Program {
+    private static void Main(string[] args) {
+      string directoryName = ".";
+
+      if (args.Length == 1) directoryName = args[0];
+      var variableValuesField = typeof(Dataset).GetField("variableValues", BindingFlags.NonPublic | BindingFlags.Instance);
+
+      foreach (var fileName in Directory.GetFiles(directoryName, "*.hl")) {
+        IStorableContent content;
+        try {
+          content = XmlParser.Deserialize<IStorableContent>(fileName);
+        }
+        catch (PersistenceException) {
+          continue;
+        }
+
+        var datasetCache = new Dictionary<string, List<Dataset>>();
+        foreach (var problemData in content.GetObjectGraphObjects().OfType<DataAnalysisProblemData>()) {
+          Dataset uniqueData = GetEqualDataset(problemData, datasetCache);
+          if (uniqueData == null) continue;
+
+          var uniqueValues = (Dictionary<string, IList>)variableValuesField.GetValue(uniqueData);
+          variableValuesField.SetValue(problemData.Dataset, new Dictionary<string, IList>(uniqueValues));
+        }
+
+        foreach (var run in content.GetObjectGraphObjects().OfType<IRun>()) {
+          var results = (Dictionary<string, IItem>)run.Results;
+          if (results.ContainsKey("ProblemData.Dataset"))
+            results.Remove("ProblemData.Dataset");
+        }
+
+        string directory = Path.GetDirectoryName(fileName);
+        string file = Path.GetFileName(fileName);
+        XmlGenerator.Serialize(content, directory + Path.DirectorySeparatorChar + "Shrinked " + file, 9);
+      }
+    }
+
+    private static Dataset GetEqualDataset(DataAnalysisProblemData problemData, Dictionary<string, List<Dataset>> datasetCache) {
+      if (!datasetCache.ContainsKey(problemData.Name)) {
+        datasetCache.Add(problemData.Name, new List<Dataset>() { problemData.Dataset });
+        return null;
+      }
+
+      foreach (var dataset in datasetCache[problemData.Name]) {
+        if (EqualDatasets(problemData.Dataset, dataset)) return dataset;
+      }
+
+      datasetCache[problemData.Name].Add(problemData.Dataset);
+      return null;
+    }
+
+    private static bool EqualDatasets(Dataset ds1, Dataset ds2) {
+      if (ds1.Rows != ds2.Rows) return false;
+      if (!ds1.VariableNames.SequenceEqual(ds2.VariableNames)) return false;
+
+      foreach (string variable in ds1.DoubleVariables) {
+        var values1 = ds1.GetDoubleValues(variable);
+        var values2 = ds2.GetDoubleValues(variable);
+        if (!values1.SequenceEqual(values2)) return false;
+      }
+
+      return true;
+    }
+  }
+
+}
Index: trunk/tools/HeuristicLab.FileShrinker/Properties/AssemblyInfo.cs
===================================================================
--- trunk/tools/HeuristicLab.FileShrinker/Properties/AssemblyInfo.cs	(revision 9497)
+++ trunk/tools/HeuristicLab.FileShrinker/Properties/AssemblyInfo.cs	(revision 9497)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.FileShrinker")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab.FileShrinker")]
+[assembly: AssemblyCopyright("Copyright ©  2013")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("465ed5c8-d934-402a-ae5a-a6c014d2f887")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
