Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithm.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithm.cs	(revision 8515)
+++ 	(revision )
@@ -1,105 +1,0 @@
-﻿
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class AStarAlgorithm : IRouter {
-    private OsmGraph graph;
-
-    private Dictionary<long, float> distances;
-    private Dictionary<long, long> predecessors;
-    private List<long> closedList;
-    private HashSet<long> closedListLookup;
-    //private PriorityQueueOld<float, long> openList;
-    private PriorityQueue<float, long> openList;
-
-    public AStarAlgorithm(OsmGraph graph) {
-      this.graph = graph;
-    }
-
-    #region IRouter Members
-
-    public long[] Calculate(long sourceNodeId, long targetNodeId) {
-      distances = new Dictionary<long, float>();
-      predecessors = new Dictionary<long, long>();
-      closedList = new List<long>();
-      closedListLookup = new HashSet<long>();
-
-      //openList = new PriorityQueueOld<float, long>();
-      openList = new PriorityQueue<float, long>(new Comparer());
-
-      long currentNode = sourceNodeId;
-
-      //openList.Enqueue(currentNode, 0);
-      openList.Enqueue(0, currentNode);
-      distances.Add(currentNode, 0);
-
-      while (openList.Count > 0) {
-        //currentNode = openList.Dequeue();
-        currentNode = openList.DequeueValue();
-        if (currentNode == targetNodeId) {
-          return ReconstructPath(currentNode).ToArray();
-        }
-
-        Dictionary<long, float> currentNeighbors = graph.GetNeighbors(currentNode);
-        foreach (KeyValuePair<long, float> neighbor in currentNeighbors) {
-          //if (closedList.Contains(neighbor.Key))
-          //  continue;
-          if (closedListLookup.Contains(neighbor.Key))
-            continue;
-
-          float costsFromStart = GetDistance(currentNode) + neighbor.Value;
-
-          if (openList.Contains(neighbor.Key) && costsFromStart > GetDistance(neighbor.Key))
-            continue;
-
-          distances[neighbor.Key] = costsFromStart;
-          predecessors[neighbor.Key] = currentNode;
-
-          float f = costsFromStart + graph.EstimatedCosts(neighbor.Key, targetNodeId);
-          if (openList.Contains(neighbor.Key)) {
-            openList.Remove(neighbor.Key);
-          }
-          //openList.Enqueue(neighbor.Key, f);
-          openList.Enqueue(f, neighbor.Key);
-        }
-        closedList.Add(currentNode);
-        closedListLookup.Add(currentNode);
-      }
-      throw new Exception(string.Format("No route found from {0} to {1}", sourceNodeId, targetNodeId));
-    }
-
-    #endregion
-
-    private float GetDistance(long id) {
-      float d;
-      if (distances.TryGetValue(id, out d)) {
-        return d;
-      } else { return float.MaxValue; }
-
-    }
-
-    private List<long> ReconstructPath(long nodeId) {
-      List<long> route = new List<long>();
-      long current = nodeId;
-      long next;
-
-      if (!predecessors.TryGetValue(current, out next)) {
-        return null;
-      }
-      route.Add(current);
-      while (predecessors.TryGetValue(current, out next)) {
-        current = predecessors[current];
-        route.Add(current);
-      }
-      route.Reverse();
-      return route;
-    }
-  }
-
-  class Comparer : IComparer<float> {
-    public int Compare(float item1, float item2) {
-      return item1 > item2 ? 1 : item1 < item2 ? -1 : 0;
-    }
-  }
-}
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithmV2.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithmV2.cs	(revision 8515)
+++ 	(revision )
@@ -1,120 +1,0 @@
-﻿
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class AStarAlgorithmV2 : IRouter {
-    private OsmGraph graph;
-
-    private Dictionary<long, float> distances;
-    private Dictionary<long, long> predecessors;
-    private List<long> closedList;
-    private HashSet<long> closedListLookup;
-    private SortedSet<NodeData> openList;
-    private Dictionary<long, NodeData> openListLookup;
-
-    public AStarAlgorithmV2(OsmGraph graph) {
-      this.graph = graph;
-    }
-
-    #region IRouter Members
-
-    public long[] Calculate(long sourceNodeId, long targetNodeId) {
-      distances = new Dictionary<long, float>();
-      predecessors = new Dictionary<long, long>();
-      closedList = new List<long>();
-      closedListLookup = new HashSet<long>();
-      openList = new SortedSet<NodeData>();
-      openListLookup = new Dictionary<long, NodeData>();
-
-      long currentNode = sourceNodeId;
-
-      NodeData nd = new NodeData(currentNode, 0);
-      openList.Add(nd);
-      openListLookup.Add(currentNode, nd);
-      distances.Add(currentNode, 0);
-
-      while (openList.Count > 0) {
-        NodeData data = openList.Min;
-        openList.Remove(data);
-        openListLookup.Remove(data.Node);
-        currentNode = data.Node;
-        if (currentNode == targetNodeId) {
-          return ReconstructPath(currentNode).ToArray();
-        }
-
-        Dictionary<long, float> currentNeighbors = graph.GetNeighbors(currentNode);
-        foreach (KeyValuePair<long, float> neighbor in currentNeighbors) {
-          if (closedListLookup.Contains(neighbor.Key))
-            continue;
-
-          float costsFromStart = GetDistance(currentNode) + neighbor.Value;
-
-          if (openListLookup.ContainsKey(neighbor.Key) && costsFromStart > GetDistance(neighbor.Key))
-            continue;
-
-          distances[neighbor.Key] = costsFromStart;
-          predecessors[neighbor.Key] = currentNode;
-
-          float f = costsFromStart + graph.EstimatedCosts(neighbor.Key, targetNodeId);
-
-          if (openListLookup.ContainsKey(neighbor.Key)) {
-            openList.Remove(openListLookup[neighbor.Key]);
-            openListLookup.Remove(neighbor.Key);
-          }
-
-          NodeData newNode = new NodeData(neighbor.Key, f);
-          openList.Add(newNode);
-          openListLookup.Add(newNode.Node, newNode);
-        }
-        closedList.Add(currentNode);
-        closedListLookup.Add(currentNode);
-      }
-      throw new Exception(string.Format("No route found from {0} to {1}", sourceNodeId, targetNodeId));
-    }
-
-    #endregion
-
-    private float GetDistance(long id) {
-      float d;
-      if (distances.TryGetValue(id, out d)) {
-        return d;
-      } else { return float.MaxValue; }
-    }
-
-    private List<long> ReconstructPath(long nodeId) {
-      List<long> route = new List<long>();
-      long current = nodeId;
-      long next;
-
-      if (!predecessors.TryGetValue(current, out next)) {
-        return null;
-      }
-      route.Add(current);
-      while (predecessors.TryGetValue(current, out next)) {
-        current = predecessors[current];
-        route.Add(current);
-      }
-      route.Reverse();
-      return route;
-    }
-
-    private class NodeData : IComparable<NodeData> {
-      public long Node { get; set; }
-      public float Costs { get; set; }
-
-      public NodeData(long nodeId, float f) {
-        Node = nodeId;
-        Costs = f;
-      }
-
-      #region IComparable<NodeData> Members
-
-      public int CompareTo(NodeData other) {
-        return this.Costs > other.Costs ? 1 : this.Costs < other.Costs ? -1 : 0;
-      }
-
-      #endregion
-    }
-  }
-}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithmV3.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithmV3.cs	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/AStarAlgorithmV3.cs	(revision 8516)
@@ -2,5 +2,6 @@
 using System;
 using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
+using HeuristicLab.Algorithms.GraphRouting.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
 namespace HeuristicLab.Algorithms.GraphRouting {
   public class AStarAlgorithmV3 : IRouter {
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/BidirectionalDijkstraAlgorithm.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/BidirectionalDijkstraAlgorithm.cs	(revision 8515)
+++ 	(revision )
@@ -1,149 +1,0 @@
-﻿
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class BidrectionalDijkstraAlgorithm : IRouter {
-    private OsmGraph graph;
-
-    private HashSet<long> visitedNodesForward;
-    private HashSet<long> visitedNodesBackward;
-    private HashSet<long> unvisitedNodesForward;
-    private HashSet<long> unvisitedNodesBackward;
-    private Dictionary<long, float> distancesForward;
-    private Dictionary<long, long> predecessorsForward;
-    private Dictionary<long, float> distancesBackward;
-    private Dictionary<long, long> predecessorsBackward;
-
-    public BidrectionalDijkstraAlgorithm(OsmGraph graph) {
-      this.graph = graph;
-    }
-
-    #region IRouter Members
-
-    public long[] Calculate(long sourceNodeId, long targetNodeId) {
-      visitedNodesForward = new HashSet<long>();
-      visitedNodesBackward = new HashSet<long>();
-
-      unvisitedNodesForward = new HashSet<long>();
-      unvisitedNodesBackward = new HashSet<long>();
-
-      distancesForward = new Dictionary<long, float>();
-      predecessorsForward = new Dictionary<long, long>();
-
-      distancesBackward = new Dictionary<long, float>();
-      predecessorsBackward = new Dictionary<long, long>();
-
-      List<long> resultRouteForward = new List<long>();
-      List<long> resultRouteBackward = new List<long>();
-
-      if (sourceNodeId == targetNodeId) {
-        resultRouteForward.Add(sourceNodeId);
-        return resultRouteForward.ToArray();
-      }
-
-      long currentNodeForward = sourceNodeId;
-      distancesForward.Add(currentNodeForward, 0);
-      unvisitedNodesForward.Add(currentNodeForward);
-
-      long currentNodeBackward = targetNodeId;
-      distancesBackward.Add(currentNodeBackward, 0);
-      unvisitedNodesBackward.Add(currentNodeBackward);
-
-      while (unvisitedNodesForward.Count > 0 && unvisitedNodesBackward.Count > 0) {
-        currentNodeForward = GetMinimumDistance(distancesForward, unvisitedNodesForward);
-        visitedNodesForward.Add(currentNodeForward);
-        unvisitedNodesForward.Remove(currentNodeForward);
-
-        currentNodeBackward = GetMinimumDistance(distancesBackward, unvisitedNodesBackward);
-        visitedNodesBackward.Add(currentNodeBackward);
-        unvisitedNodesBackward.Remove(currentNodeBackward);
-
-        if (visitedNodesForward.Contains(currentNodeBackward)) {
-          return GetRoute(currentNodeBackward).ToArray();
-        }
-
-        if (visitedNodesBackward.Contains(currentNodeForward)) {
-          return GetRoute(currentNodeForward).ToArray();
-        }
-
-        FindMinimalWeightForward(currentNodeForward);
-        FindMinimalWeightBackward(currentNodeBackward);
-      }
-
-      throw new Exception(string.Format("No route found from {0} to {1}", sourceNodeId, targetNodeId));
-    }
-
-    #endregion
-
-    private long GetMinimumDistance(Dictionary<long, float> distances, HashSet<long> nodeIds) {
-      long minimum = -1;
-      foreach (long id in nodeIds) {
-        if (minimum == -1) minimum = id;
-        else {
-          if (GetDistance(distances, id) < GetDistance(distances, minimum)) {
-            minimum = id;
-          }
-        }
-      }
-      return minimum;
-    }
-
-    private float GetDistance(Dictionary<long, float> distances, long id) {
-      float d;
-      if (distances.TryGetValue(id, out d)) {
-        return d;
-      } else { return float.MaxValue; }
-    }
-
-    private void FindMinimalWeightForward(long nodeId) {
-      Dictionary<long, float> currentNeighbors = graph.GetNeighbors(nodeId);
-      foreach (KeyValuePair<long, float> neighbor in currentNeighbors) {
-        // update relax
-        float totalWeight = GetDistance(distancesForward, nodeId) + neighbor.Value;
-        if (GetDistance(distancesForward, neighbor.Key) > totalWeight) {
-          distancesForward[neighbor.Key] = totalWeight;
-          predecessorsForward[neighbor.Key] = nodeId;
-          unvisitedNodesForward.Add(neighbor.Key);
-        }
-      }
-    }
-
-    private void FindMinimalWeightBackward(long nodeId) {
-      Dictionary<long, float> currentNeighbors = graph.GetNeighborsReversed(nodeId);
-      foreach (KeyValuePair<long, float> neighbor in currentNeighbors) {
-        // update relax
-        float totalWeight = GetDistance(distancesBackward, nodeId) + neighbor.Value;
-        if (GetDistance(distancesBackward, neighbor.Key) > totalWeight) {
-          distancesBackward[neighbor.Key] = totalWeight;
-          predecessorsBackward[neighbor.Key] = nodeId;
-          unvisitedNodesBackward.Add(neighbor.Key);
-        }
-      }
-    }
-
-    private List<long> GetRoute(long nodeId) {
-      List<long> route = new List<long>();
-      long current = nodeId;
-      long next;
-
-      if (!predecessorsForward.TryGetValue(current, out next)) {
-        return null;
-      }
-      route.Add(current);
-      while (predecessorsForward.TryGetValue(current, out next)) {
-        current = predecessorsForward[current];
-        route.Add(current);
-      }
-      route.Reverse();
-
-      current = nodeId;
-      while (predecessorsBackward.TryGetValue(current, out next)) {
-        current = predecessorsBackward[current];
-        route.Add(current);
-      }
-
-      return route;
-    }
-  }
-}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/BidirectionalDijkstraAlgorithmV2.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/BidirectionalDijkstraAlgorithmV2.cs	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/BidirectionalDijkstraAlgorithmV2.cs	(revision 8516)
@@ -2,5 +2,6 @@
 using System;
 using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
+using HeuristicLab.Algorithms.GraphRouting.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
 namespace HeuristicLab.Algorithms.GraphRouting {
   public class BidrectionalDijkstraAlgorithmV2 : IRouter {
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/DijkstraAlgorithm.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/DijkstraAlgorithm.cs	(revision 8515)
+++ 	(revision )
@@ -1,107 +1,0 @@
-﻿
-using System;
-using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class DijkstraAlgorithm : IRouter {
-    private OsmGraph graph;
-
-    private HashSet<long> visitedNodes;
-    private HashSet<long> unvisitedNodes;
-    private Dictionary<long, float> distances;
-    private Dictionary<long, long> predecessors;
-
-    public DijkstraAlgorithm(OsmGraph graph) {
-      this.graph = graph;
-    }
-
-    #region IRouter Members
-
-    public long[] Calculate(long sourceNodeId, long targetNodeId) {
-      visitedNodes = new HashSet<long>();        // visited
-      unvisitedNodes = new HashSet<long>();      // unvisited
-      distances = new Dictionary<long, float>();
-      predecessors = new Dictionary<long, long>();
-
-      List<long> resultRoute = new List<long>();
-      if (sourceNodeId == targetNodeId) {
-        resultRoute.Add(sourceNodeId);
-        return resultRoute.ToArray();
-      }
-
-      long currentNode = sourceNodeId;
-      distances.Add(currentNode, 0);
-      unvisitedNodes.Add(currentNode);
-
-      while (unvisitedNodes.Count > 0) {
-        currentNode = GetMinimumDistance(unvisitedNodes);
-        visitedNodes.Add(currentNode);
-        unvisitedNodes.Remove(currentNode);
-        if (currentNode == targetNodeId) {
-          break;
-        }
-        FindMinimalWeight(currentNode);
-      }
-
-      if (currentNode != targetNodeId) {
-        // target was not found
-        // maybe throw exception
-        throw new Exception(string.Format("No route found from {0} to {1}", sourceNodeId, targetNodeId));
-      }
-      return GetRoute(targetNodeId).ToArray();
-    }
-
-    #endregion
-
-    private long GetMinimumDistance(HashSet<long> nodeIds) {
-      long minimum = -1;
-      foreach (long id in nodeIds) {
-        if (minimum == -1) minimum = id;
-        else {
-          if (GetDistance(id) < GetDistance(minimum)) {
-            minimum = id;
-          }
-        }
-      }
-      return minimum;
-    }
-
-    private float GetDistance(long id) {
-      float d;
-      if (distances.TryGetValue(id, out d)) {
-        return d;
-      } else { return float.MaxValue; }
-
-    }
-
-    private void FindMinimalWeight(long nodeId) {
-      Dictionary<long, float> currentNeighbors = graph.GetNeighbors(nodeId);
-      foreach (KeyValuePair<long, float> neighbor in currentNeighbors) {
-        // update relax
-        float totalWeight = GetDistance(nodeId) + neighbor.Value;
-        if (GetDistance(neighbor.Key) > totalWeight) {
-          distances[neighbor.Key] = totalWeight;
-          predecessors[neighbor.Key] = nodeId;
-          unvisitedNodes.Add(neighbor.Key);
-        }
-      }
-    }
-
-    private List<long> GetRoute(long nodeId) {
-      List<long> route = new List<long>();
-      long current = nodeId;
-      long next;
-
-      if (!predecessors.TryGetValue(current, out next)) {
-        return null;
-      }
-      route.Add(current);
-      while (predecessors.TryGetValue(current, out next)) {
-        current = predecessors[current];
-        route.Add(current);
-      }
-      route.Reverse();
-      return route;
-    }
-  }
-}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/DijkstraAlgorithmV2.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/DijkstraAlgorithmV2.cs	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/DijkstraAlgorithmV2.cs	(revision 8516)
@@ -2,5 +2,6 @@
 using System;
 using System.Collections.Generic;
-using HeuristicLab.Problems.RoutePlanning.Graph;
+using HeuristicLab.Algorithms.GraphRouting.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
 namespace HeuristicLab.Algorithms.GraphRouting {
   public class DijkstraAlgorithmV2 : IRouter {
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/HeuristicLab.Algorithms.GraphRouting.csproj
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/HeuristicLab.Algorithms.GraphRouting.csproj	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/HeuristicLab.Algorithms.GraphRouting.csproj	(revision 8516)
@@ -57,17 +57,13 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="AStarAlgorithm.cs" />
-    <Compile Include="AStarAlgorithmV2.cs" />
-    <Compile Include="BidirectionalDijkstraAlgorithm.cs" />
     <Compile Include="AStarAlgorithmV3.cs" />
     <Compile Include="BidirectionalDijkstraAlgorithmV2.cs" />
     <Compile Include="DijkstraAlgorithmV2.cs" />
-    <Compile Include="DijkstraAlgorithm.cs" />
     <Compile Include="GraphRoutingAlgorithm.cs" />
-    <Compile Include="IRouter.cs" />
-    <Compile Include="Pair.cs" />
+    <Compile Include="Interfaces\IRouter.cs" />
+    <Compile Include="Utilities\Pair.cs" />
     <Compile Include="Plugin.cs" />
-    <Compile Include="PriorityQueue.cs" />
-    <Compile Include="PriorityQueueOld.cs" />
+    <Compile Include="Utilities\PriorityQueue.cs" />
+    <Compile Include="Utilities\PriorityQueueOld.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/IRouter.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/IRouter.cs	(revision 8515)
+++ 	(revision )
@@ -1,6 +1,0 @@
-﻿
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public interface IRouter {
-    long[] Calculate(long sourceNodeId, long targetNodeId);
-  }
-}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Interfaces/IRouter.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Interfaces/IRouter.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Interfaces/IRouter.cs	(revision 8516)
@@ -0,0 +1,6 @@
+﻿
+namespace HeuristicLab.Algorithms.GraphRouting.Interfaces {
+  public interface IRouter {
+    long[] Calculate(long sourceNodeId, long targetNodeId);
+  }
+}
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Pair.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Pair.cs	(revision 8515)
+++ 	(revision )
@@ -1,38 +1,0 @@
-﻿
-using System;
-using System.Collections.Generic;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class Pair<T> {
-    public T First { get; private set; }
-    public T Second { get; private set; }
-
-    public Pair(T first, T second) {
-      First = first;
-      Second = second;
-    }
-
-    public override int GetHashCode() {
-      return First.GetHashCode() ^ Second.GetHashCode();
-    }
-
-    public override bool Equals(object other) {
-      Pair<T> pair = other as Pair<T>;
-      if (pair == null) {
-        return false;
-      }
-      return (this.First.Equals(pair.First) && this.Second.Equals(pair.Second));
-    }
-  }
-
-  class PairComparer<T> : IComparer<Pair<T>> where T : IComparable {
-    public int Compare(Pair<T> x, Pair<T> y) {
-      if (x.First.CompareTo(y.First) < 0) {
-        return -1;
-      } else if (x.First.CompareTo(y.First) > 0) {
-        return 1;
-      } else {
-        return x.Second.CompareTo(y.Second);
-      }
-    }
-  }
-}
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/PriorityQueue.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/PriorityQueue.cs	(revision 8515)
+++ 	(revision )
@@ -1,181 +1,0 @@
-﻿
-using System;
-using System.Collections;
-using System.Collections.Generic;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class PriorityQueue<TPriority, TValue> : ICollection<KeyValuePair<TPriority, TValue>> {
-    private List<KeyValuePair<TPriority, TValue>> heap;
-    private Dictionary<TValue, KeyValuePair<TPriority, TValue>> values;
-    private IComparer<TPriority> comparer;
-
-    #region Constructors
-
-    public PriorityQueue(IComparer<TPriority> comparer) {
-      if (comparer == null)
-        throw new ArgumentNullException();
-
-      heap = new List<KeyValuePair<TPriority, TValue>>();
-      values = new Dictionary<TValue, KeyValuePair<TPriority, TValue>>();
-      this.comparer = comparer;
-    }
-
-    #endregion
-
-    #region Priority queue methods
-
-    public void Enqueue(TPriority priority, TValue value) {
-      Insert(priority, value);
-    }
-
-    public KeyValuePair<TPriority, TValue> Dequeue() {
-      if (Count != 0) {
-        KeyValuePair<TPriority, TValue> item = heap[0];
-        RemoveRoot();
-        return item;
-      } else {
-        throw new InvalidOperationException("Priority queue is empty");
-      }
-    }
-
-    public TValue DequeueValue() {
-      return Dequeue().Value;
-    }
-
-    #endregion
-
-    #region ICollection members
-
-    public void Add(KeyValuePair<TPriority, TValue> item) {
-      Enqueue(item.Key, item.Value);
-    }
-
-    public void Clear() {
-      heap.Clear();
-      values.Clear();
-    }
-
-    public bool Contains(KeyValuePair<TPriority, TValue> item) {
-      return heap.Contains(item);
-    }
-
-    public bool Contains(TValue value) {
-      return values.ContainsKey(value);
-    }
-
-    public void CopyTo(KeyValuePair<TPriority, TValue>[] array, int arrayIndex) {
-      heap.CopyTo(array, arrayIndex);
-    }
-
-    public int Count {
-      get { return heap.Count; }
-    }
-
-    public bool IsReadOnly {
-      get { return false; }
-    }
-
-    public bool Remove(KeyValuePair<TPriority, TValue> item) {
-      int idx = heap.IndexOf(item);
-      if (idx < 0) {
-        return false;
-      }
-
-      values.Remove(item.Value);
-
-      heap[idx] = heap[heap.Count - 1];
-      heap.RemoveAt(heap.Count - 1);
-
-      HeapUp(idx);
-      HeapDown(idx);
-
-      return true;
-    }
-
-    public bool Remove(TValue value) {
-      KeyValuePair<TPriority, TValue> item = values[value];
-      return Remove(item);
-    }
-
-    #endregion
-
-    #region IEnumerable Members
-
-    public IEnumerator<KeyValuePair<TPriority, TValue>> GetEnumerator() {
-      return heap.GetEnumerator();
-    }
-
-    IEnumerator IEnumerable.GetEnumerator() {
-      return this.GetEnumerator();
-    }
-
-    #endregion
-
-    #region Private methods
-
-    private void SwapElements(int pos1, int pos2) {
-      KeyValuePair<TPriority, TValue> element = heap[pos1];
-      heap[pos1] = heap[pos2];
-      heap[pos2] = element;
-    }
-
-    private void Insert(TPriority priority, TValue value) {
-      KeyValuePair<TPriority, TValue> element = new KeyValuePair<TPriority, TValue>(priority, value);
-      heap.Add(element);
-      values.Add(value, element);
-
-      HeapUp(heap.Count - 1);
-    }
-
-    private void RemoveRoot() {
-      if (heap.Count <= 1) {
-        heap.Clear();
-        values.Clear();
-      } else {
-        KeyValuePair<TPriority, TValue> item = heap[0];
-        values.Remove(item.Value);
-
-        heap[0] = heap[heap.Count - 1];
-        heap.RemoveAt(heap.Count - 1);
-
-        HeapDown(0);
-      }
-    }
-
-    private void HeapUp(int pos) {
-      if (pos < heap.Count) {
-        while (pos > 0) {
-          int parent = (pos - 1) / 2;
-          if (comparer.Compare(heap[parent].Key, heap[pos].Key) > 0) {
-            SwapElements(parent, pos);
-            pos = parent;
-          } else {
-            break;
-          }
-        }
-      }
-    }
-
-    private void HeapDown(int pos) {
-      while (true) {
-        int smallest = pos;
-        int left = 2 * pos + 1;
-        int right = 2 * pos + 2;
-        if (left < heap.Count && comparer.Compare(heap[smallest].Key, heap[left].Key) > 0) {
-          smallest = left;
-        }
-        if (right < heap.Count && comparer.Compare(heap[smallest].Key, heap[right].Key) > 0) {
-          smallest = right;
-        }
-
-        if (smallest != pos) {
-          SwapElements(smallest, pos);
-          pos = smallest;
-        } else {
-          break;
-        }
-      }
-    }
-
-    #endregion
-  }
-}
Index: anches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/PriorityQueueOld.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/PriorityQueueOld.cs	(revision 8515)
+++ 	(revision )
@@ -1,48 +1,0 @@
-﻿
-using System;
-using System.Collections.Generic;
-namespace HeuristicLab.Algorithms.GraphRouting {
-  public class PriorityQueueOld<P, T> where P : IComparable {
-    SortedList<Pair<P>, T> list;
-    P dummy;
-
-    public PriorityQueueOld() {
-      list = new SortedList<Pair<P>, T>(new PairComparer<P>());
-    }
-
-    public int Count {
-      get { return list.Count; }
-    }
-
-    public void Enqueue(T item, P priority) {
-      list.Add(new Pair<P>(priority, dummy), item);
-      //count++;
-    }
-
-    public T Dequeue() {
-      T item = list[list.Keys[0]];
-      list.RemoveAt(0);
-      return item;
-    }
-
-    public bool Contains(T item) {
-      return list.ContainsValue(item);
-    }
-
-    public bool Remove(T item) {
-      bool delete = false;
-      KeyValuePair<Pair<P>, T> toDelete = new KeyValuePair<Pair<P>, T>();
-      foreach (var pair in list) {
-        if (pair.Value.Equals(item)) {
-          delete = true;
-          toDelete = pair;
-        }
-      }
-      if (delete) {
-        return list.Remove(toDelete.Key);
-      }
-      return false;
-    }
-
-  }
-}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/Pair.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/Pair.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/Pair.cs	(revision 8516)
@@ -0,0 +1,38 @@
+﻿
+using System;
+using System.Collections.Generic;
+namespace HeuristicLab.Algorithms.GraphRouting.Utilities {
+  public class Pair<T> {
+    public T First { get; private set; }
+    public T Second { get; private set; }
+
+    public Pair(T first, T second) {
+      First = first;
+      Second = second;
+    }
+
+    public override int GetHashCode() {
+      return First.GetHashCode() ^ Second.GetHashCode();
+    }
+
+    public override bool Equals(object other) {
+      Pair<T> pair = other as Pair<T>;
+      if (pair == null) {
+        return false;
+      }
+      return (this.First.Equals(pair.First) && this.Second.Equals(pair.Second));
+    }
+  }
+
+  class PairComparer<T> : IComparer<Pair<T>> where T : IComparable {
+    public int Compare(Pair<T> x, Pair<T> y) {
+      if (x.First.CompareTo(y.First) < 0) {
+        return -1;
+      } else if (x.First.CompareTo(y.First) > 0) {
+        return 1;
+      } else {
+        return x.Second.CompareTo(y.Second);
+      }
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/PriorityQueue.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/PriorityQueue.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/PriorityQueue.cs	(revision 8516)
@@ -0,0 +1,181 @@
+﻿
+using System;
+using System.Collections;
+using System.Collections.Generic;
+namespace HeuristicLab.Algorithms.GraphRouting.Utilities {
+  public class PriorityQueue<TPriority, TValue> : ICollection<KeyValuePair<TPriority, TValue>> {
+    private List<KeyValuePair<TPriority, TValue>> heap;
+    private Dictionary<TValue, KeyValuePair<TPriority, TValue>> values;
+    private IComparer<TPriority> comparer;
+
+    #region Constructors
+
+    public PriorityQueue(IComparer<TPriority> comparer) {
+      if (comparer == null)
+        throw new ArgumentNullException();
+
+      heap = new List<KeyValuePair<TPriority, TValue>>();
+      values = new Dictionary<TValue, KeyValuePair<TPriority, TValue>>();
+      this.comparer = comparer;
+    }
+
+    #endregion
+
+    #region Priority queue methods
+
+    public void Enqueue(TPriority priority, TValue value) {
+      Insert(priority, value);
+    }
+
+    public KeyValuePair<TPriority, TValue> Dequeue() {
+      if (Count != 0) {
+        KeyValuePair<TPriority, TValue> item = heap[0];
+        RemoveRoot();
+        return item;
+      } else {
+        throw new InvalidOperationException("Priority queue is empty");
+      }
+    }
+
+    public TValue DequeueValue() {
+      return Dequeue().Value;
+    }
+
+    #endregion
+
+    #region ICollection members
+
+    public void Add(KeyValuePair<TPriority, TValue> item) {
+      Enqueue(item.Key, item.Value);
+    }
+
+    public void Clear() {
+      heap.Clear();
+      values.Clear();
+    }
+
+    public bool Contains(KeyValuePair<TPriority, TValue> item) {
+      return heap.Contains(item);
+    }
+
+    public bool Contains(TValue value) {
+      return values.ContainsKey(value);
+    }
+
+    public void CopyTo(KeyValuePair<TPriority, TValue>[] array, int arrayIndex) {
+      heap.CopyTo(array, arrayIndex);
+    }
+
+    public int Count {
+      get { return heap.Count; }
+    }
+
+    public bool IsReadOnly {
+      get { return false; }
+    }
+
+    public bool Remove(KeyValuePair<TPriority, TValue> item) {
+      int idx = heap.IndexOf(item);
+      if (idx < 0) {
+        return false;
+      }
+
+      values.Remove(item.Value);
+
+      heap[idx] = heap[heap.Count - 1];
+      heap.RemoveAt(heap.Count - 1);
+
+      HeapUp(idx);
+      HeapDown(idx);
+
+      return true;
+    }
+
+    public bool Remove(TValue value) {
+      KeyValuePair<TPriority, TValue> item = values[value];
+      return Remove(item);
+    }
+
+    #endregion
+
+    #region IEnumerable Members
+
+    public IEnumerator<KeyValuePair<TPriority, TValue>> GetEnumerator() {
+      return heap.GetEnumerator();
+    }
+
+    IEnumerator IEnumerable.GetEnumerator() {
+      return this.GetEnumerator();
+    }
+
+    #endregion
+
+    #region Private methods
+
+    private void SwapElements(int pos1, int pos2) {
+      KeyValuePair<TPriority, TValue> element = heap[pos1];
+      heap[pos1] = heap[pos2];
+      heap[pos2] = element;
+    }
+
+    private void Insert(TPriority priority, TValue value) {
+      KeyValuePair<TPriority, TValue> element = new KeyValuePair<TPriority, TValue>(priority, value);
+      heap.Add(element);
+      values.Add(value, element);
+
+      HeapUp(heap.Count - 1);
+    }
+
+    private void RemoveRoot() {
+      if (heap.Count <= 1) {
+        heap.Clear();
+        values.Clear();
+      } else {
+        KeyValuePair<TPriority, TValue> item = heap[0];
+        values.Remove(item.Value);
+
+        heap[0] = heap[heap.Count - 1];
+        heap.RemoveAt(heap.Count - 1);
+
+        HeapDown(0);
+      }
+    }
+
+    private void HeapUp(int pos) {
+      if (pos < heap.Count) {
+        while (pos > 0) {
+          int parent = (pos - 1) / 2;
+          if (comparer.Compare(heap[parent].Key, heap[pos].Key) > 0) {
+            SwapElements(parent, pos);
+            pos = parent;
+          } else {
+            break;
+          }
+        }
+      }
+    }
+
+    private void HeapDown(int pos) {
+      while (true) {
+        int smallest = pos;
+        int left = 2 * pos + 1;
+        int right = 2 * pos + 2;
+        if (left < heap.Count && comparer.Compare(heap[smallest].Key, heap[left].Key) > 0) {
+          smallest = left;
+        }
+        if (right < heap.Count && comparer.Compare(heap[smallest].Key, heap[right].Key) > 0) {
+          smallest = right;
+        }
+
+        if (smallest != pos) {
+          SwapElements(smallest, pos);
+          pos = smallest;
+        } else {
+          break;
+        }
+      }
+    }
+
+    #endregion
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/PriorityQueueOld.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/PriorityQueueOld.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Algorithms.GraphRouting/3.3/Utilities/PriorityQueueOld.cs	(revision 8516)
@@ -0,0 +1,48 @@
+﻿
+using System;
+using System.Collections.Generic;
+namespace HeuristicLab.Algorithms.GraphRouting.Utilities {
+  public class PriorityQueueOld<P, T> where P : IComparable {
+    SortedList<Pair<P>, T> list;
+    P dummy;
+
+    public PriorityQueueOld() {
+      list = new SortedList<Pair<P>, T>(new PairComparer<P>());
+    }
+
+    public int Count {
+      get { return list.Count; }
+    }
+
+    public void Enqueue(T item, P priority) {
+      list.Add(new Pair<P>(priority, dummy), item);
+      //count++;
+    }
+
+    public T Dequeue() {
+      T item = list[list.Keys[0]];
+      list.RemoveAt(0);
+      return item;
+    }
+
+    public bool Contains(T item) {
+      return list.ContainsValue(item);
+    }
+
+    public bool Remove(T item) {
+      bool delete = false;
+      KeyValuePair<Pair<P>, T> toDelete = new KeyValuePair<Pair<P>, T>();
+      foreach (var pair in list) {
+        if (pair.Value.Equals(item)) {
+          delete = true;
+          toDelete = pair;
+        }
+      }
+      if (delete) {
+        return list.Remove(toDelete.Key);
+      }
+      return false;
+    }
+
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning.Test/Program.cs	(revision 8516)
@@ -7,19 +7,22 @@
 using System.Xml;
 using HeuristicLab.Algorithms.GraphRouting;
-using HeuristicLab.Problems.RoutePlanning.Graph;
-using HeuristicLab.Problems.RoutePlanning.Osm;
-using HeuristicLab.Problems.RoutePlanning.Osm.Data;
+using HeuristicLab.Algorithms.GraphRouting.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.Data.DIMACS;
+using HeuristicLab.Problems.RoutePlanning.Data.Osm;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.RoutingGraph;
+
+// For testing openstreetmap data is used
+// http://www.openstreetmap.org
+// Map data © OpenStreetMap contributors, CC BY-SA
+
 namespace HeuristicLab.Problems.RoutePlanning.Test {
   class Program {
     static void Main(string[] args) {
-      // For testing openstreetmap data is used
-      // http://www.openstreetmap.org
-      // Map data © OpenStreetMap contributors, CC BY-SA
-
       string file1 = @"..\..\OsmTestFiles\test.osm";
       string file2 = @"..\..\OsmTestFiles\testNode1.osm";
       string file3 = @"..\..\OsmTestFiles\testWay1.osm";
       string file4 = @"..\..\OsmTestFiles\testRelation1.osm";
-      string file5 = @"..\..\OsmTestFiles\test_mid.osm";
+      string file5 = @"C:\dev\osmfiles\test_mid.osm";
       string file6 = @"C:\dev\osmfiles\oberosterreich.highway.osm";
       string file7 = @"C:\dev\osmfiles\austria.highway.osm";
@@ -29,58 +32,29 @@
       string fileNYCoords = @"C:\dev\DIMACSfiles\USA-road-d.NY.co.gz";
 
-      //IDataSource ds = TestLoad(typeof(XmlDataSource), file7);
-      //IDataSource ds = TestLoad(typeof(OsmDataSource), file6);
-      //OsmGraph graph = new OsmGraph(ds);
-
-      //IGraph graphNew = TestGetRoutingGraph(ds);
-      //ExecuteBenchmark(graphNew, typeof(AStarAlgorithmV3), 262144, 20);
-
-      //IRouter router = new AStarAlgorithmV3(graphNew);
+      IDataSource ds1 = TestLoad(typeof(OsmDataSource), file6);
+      IDataSource ds2 = TestLoad(typeof(DIMACSDataSource), fileNYCoords, fileNYArcs);
+
+      //IGraph graph = TestGetRoutingGraph(ds1);
+      //ExecuteBenchmark(graph, typeof(AStarAlgorithmV3), 262144, 20);
+
+      //IRouter router = new AStarAlgorithmV3(graph);
       //long[] r = router.Calculate(266733493, 986825165);
-      ////long[] r = router.Calculate(998717680, 986825165);
-
-      //IDataSource ds = new DIMACSDataSource(fileNYCoords, fileNYArcs);
-      //IDataSource ds = new OsmDataSource(file5);
-
-      //TestRouter(new DijkstraAlgorithm(graph), 529102170, 1001363194, true);
-      //TestRouter(new DijkstraAlgorithmV2(graphNew), 529102170, 1001363194, true);
-      //TestRouter(new DijkstraAlgorithm(graph), 529102170, 31372732, false); // inz - hgb
-      //TestRouter(new DijkstraAlgorithmV2(graphNew), 529102170, 31372732, false); // inz - hgb
-      //TestRouter(new BidrectionalDijkstraAlgorithm(graph), 529102170, 31372732, false); // inz - hgb
-      //TestRouter(new BidrectionalDijkstraAlgorithmV2(graphNew), 529102170, 31372732, false); // inz - hgb
-      //TestRouter(new AStarAlgorithm(graph), 529102170, 31372732, false); // inz - hgb
-      //TestRouter(new AStarAlgorithmV2(graph), 529102170, 31372732, false); // inz - hgb
-      //TestRouter(new AStarAlgorithmV3(graphNew), 529102170, 31372732, false); // inz - hgb
-
-      //TestRouter(new AStarAlgorithmV2(graph), 763113382, 1078628481, false); // bregenz (bahnhofstr) - podersdorf (??)
-      //TestRouter(new AStarAlgorithmV3(graphNew), 346151602, 33196510, false); // bregenz (bahnhofstr) - wien (stepansplatz)
-      //TestRouter(new AStarAlgorithmV2(graph), 346151602, 33196510, false); // bregenz (bahnhofstr) - wien (stepansplatz)
-
-      //TestRouter(new AStarAlgorithmV2(graph), 32044987, 261576106, false);    //vorarblberg
-      //TestRouter(new AStarAlgorithmV3(graphNew), 32044987, 261576106, false);    //vorarblberg
-
-      //TestLoadAndRouter(file6, typeof(DijkstraAlgorithm), 529102170, 31372732, false, false); // inz - hgb
-      //TestLoadAndRouter(file6, typeof(AStarAlgorithm), 529102170, 31372732, false, false); // inz - hgb
-      //TestLoadAndRouter(file6, typeof(AStarAlgorithmV2), 529102170, 31372732, false, true); // inz - hgb
-
-      //TestLoadAndRouter(file6, typeof(DijkstraAlgorithm), 529102170, 1001363194, true, false);
-      //TestLoadAndRouter(file6, typeof(DijkstraAlgorithm), 529102170, 1001363194, true, false);
-      //TestLoadAndRouter(file6, typeof(AStarAlgorithm), 529102170, 1001363194, true, false);
-      //TestLoadAndRouter(file6, typeof(AStarAlgorithmV2), 529102170, 1001363194, true, false);
-      //TestLoadAndRouter(file6, typeof(BidrectionalDijkstraAlgorithm), 529102170, 1001363194, true, false);
-
-      //TestLoadAndRouter(file5, typeof(DijkstraAlgorithm), 529102170, 1001363194, true, false);
-      //TestLoadAndRouter(file5, typeof(BidrectionalDijkstraAlgorithm), 529102170, 1001363194, true, true);
-      //TestLoadAndRouter(file6, typeof(BidrectionalDijkstraAlgorithm), 529102170, 31372732, false, true); // inz - hgb
-
-      TestLoadAndRouterNew(file6, typeof(AStarAlgorithmV3), 529102170, 31372732, false, true); // inz - hgb
-      //TestLoadAndRouterNew(file6, typeof(DijkstraAlgorithmV2), 529102170, 31372732, false, true);
-      //TestLoadAndRouterNew(file6, typeof(BidrectionalDijkstraAlgorithmV2), 529102170, 31372732, false, true);
-      //TestLoadAndRouterNew(file6, typeof(AStarAlgorithmV3), 529102170, 31372732, false, true);
-
-      //TestLoadAndRouter(file7, typeof(AStarAlgorithmV2), 346151602, 33196510, false, true); // bregenz (bahnhofstr) - wien (stepansplatz)
-      //TestLoadAndRouterNew(file7, typeof(AStarAlgorithmV3), 346151602, 33196510, false, true); // bregenz (bahnhofstr) - wien (stepansplatz)
-
-      //TestLoadAndRouter(file8, typeof(AStarAlgorithmV2), 32044987, 261576106, false, true);    //vorarblberg
+      //long[] r = router.Calculate(998717680, 986825165);
+
+      //TestRouter(new DijkstraAlgorithmV2(graph), 529102170, 1001363194, true); // inz
+
+      //TestRouter(new DijkstraAlgorithmV2(graph), 529102170, 31372732, false); // inz - hgb
+      //TestRouter(new BidrectionalDijkstraAlgorithmV2(graph), 529102170, 31372732, false); // inz - hgb
+      //TestRouter(new AStarAlgorithmV3(graph), 529102170, 31372732, false); // inz - hgb
+
+      //TestRouter(new AStarAlgorithmV3(graph), 346151602, 33196510, false); // bregenz (bahnhofstr) - wien (stepansplatz)
+
+      //TestRouter(new AStarAlgorithmV3(graph), 32044987, 261576106, false);    //vorarblberg
+
+      //TestLoadAndRouter(typeof(OsmDataSource), file6, typeof(AStarAlgorithmV3), 529102170, 31372732, false, true); // inz - hgb
+      //TestLoadAndRouter(typeof(OsmDataSource), file6, typeof(DijkstraAlgorithmV2), 529102170, 31372732, false, true); // inz - hgb
+      //TestLoadAndRouter(typeof(OsmDataSource), file6, typeof(BidrectionalDijkstraAlgorithmV2), 529102170, 31372732, false, true); // inz - hgb
+      //TestLoadAndRouter(typeof(OsmDataSource), file6, typeof(AStarAlgorithmV3), 529102170, 31372732, false, true); // inz - hgb
+      //TestLoadAndRouter(typeof(OsmDataSource), file7, typeof(AStarAlgorithmV3), 346151602, 33196510, false, true); // bregenz (bahnhofstr) - wien (stepansplatz)
 
       System.Console.Read();
@@ -126,5 +100,5 @@
     }
 
-    private static void TestLoadAndRouter(string filepath, Type routerType, long sourceNodeId, long targetNodeId, bool showResult, bool writeResultFile) {
+    private static void TestLoadAndRouter(Type dsType, string filepath, Type routerType, long sourceNodeId, long targetNodeId, bool showResult, bool writeResultFile) {
       FileInfo file = new FileInfo(filepath);
       Console.WriteLine("Test Load and Route BEGIN -------------------------");
@@ -133,10 +107,10 @@
       Console.Write("Loading data ... ");
       var sw = Stopwatch.StartNew();
-      XmlDataSource xmlDs = new XmlDataSource(filepath);
+      IDataSource ds = (IDataSource)Activator.CreateInstance(dsType, filepath);
       sw.Stop();
       Console.WriteLine("done.");
       Console.WriteLine("Loading Time: {0}", sw.Elapsed);
       Console.WriteLine();
-      OsmGraph graph = new OsmGraph(xmlDs);
+      IGraph graph = ds.GetRoutingGraph();
       IRouter router = (IRouter)Activator.CreateInstance(routerType, graph);
       Console.Write("Calculate route ... ");
@@ -164,90 +138,5 @@
     }
 
-    private static void TestLoadAndRouterNew(string filepath, Type routerType, long sourceNodeId, long targetNodeId, bool showResult, bool writeResultFile) {
-      FileInfo file = new FileInfo(filepath);
-      Console.WriteLine("Test Load and Route BEGIN -------------------------");
-      Console.WriteLine("File name: {0}", file.Name);
-      Console.WriteLine();
-      Console.Write("Loading data ... ");
-      var sw = Stopwatch.StartNew();
-      //XmlDataSource xmlDs = new XmlDataSource(filepath);
-      IDataSource xmlDs = new OsmDataSource(filepath);
-      sw.Stop();
-      Console.WriteLine("done.");
-      Console.WriteLine("Loading Time: {0}", sw.Elapsed);
-      Console.WriteLine();
-      IGraph graph = xmlDs.GetRoutingGraph();
-      IRouter router = (IRouter)Activator.CreateInstance(routerType, graph);
-      Console.Write("Calculate route ... ");
-      sw = Stopwatch.StartNew();
-      long[] result = router.Calculate(sourceNodeId, targetNodeId);
-      sw.Stop();
-      Console.WriteLine("done.");
-      Console.WriteLine("Execution Time: {0}", sw.Elapsed);
-      Console.WriteLine();
-      if (showResult) {
-        Console.WriteLine("Result: ");
-        foreach (long i in result) System.Console.Write(i + "; ");
-        Console.WriteLine();
-        Console.WriteLine();
-      }
-      if (writeResultFile) {
-        string dt = DateTime.Now.ToString("yyyyMMddhhmmss_");
-        string fn = Path.GetFileNameWithoutExtension(file.Name);
-        string resultFile = dt + fn + "_" + sourceNodeId + "-" + targetNodeId + ".gpx";
-        Console.WriteLine("Result file: {0}", resultFile);
-        WriteGPXFileNew(graph, result, resultFile);
-      }
-      Console.WriteLine("===================================================");
-      Console.WriteLine();
-    }
-
-    private static void WriteGPXFile(OsmGraph graph, long[] route, string file) {
-      XmlWriterSettings settings = new XmlWriterSettings();
-      settings.Indent = true;
-      settings.IndentChars = ("   ");
-
-      using (XmlWriter writer = XmlWriter.Create(file, settings)) {
-        writer.WriteStartElement("gpx", "http://www.topografix.com/GPX/1/0");
-        writer.WriteAttributeString("version", "1.1");
-        writer.WriteAttributeString("creator", "cloudia");
-
-        foreach (long nodeId in route) {
-          OsmVertex<Node> node = graph.GetVertex(nodeId);
-          writer.WriteStartElement("wpt");
-          writer.WriteAttributeString("lat", XmlConvert.ToString(node.Node.Latitude));
-          writer.WriteAttributeString("lon", XmlConvert.ToString(node.Node.Longitude));
-          writer.WriteEndElement(); // wpt
-        }
-
-        //writer.WriteStartElement("rte");
-        //foreach (long nodeId in route) {
-        //  Vertex<Node> node = graph.GetVertex(nodeId);
-        //  writer.WriteStartElement("rtept");
-        //  writer.WriteAttributeString("lat", XmlConvert.ToString(node.Node.Latitude));
-        //  writer.WriteAttributeString("lon", XmlConvert.ToString(node.Node.Longitude));
-        //  writer.WriteEndElement(); // rtept
-        //}
-        //writer.WriteEndElement(); // rte
-
-        //writer.WriteStartElement("trk");
-        //writer.WriteElementString("name", "RoutePath");
-        ////writer.WriteEndElement(); // name
-        //writer.WriteStartElement("trkseq");
-        //foreach (long nodeId in route) {
-        //  Vertex<Node> node = graph.GetVertex(nodeId);
-        //  writer.WriteStartElement("trkpt");
-        //  writer.WriteAttributeString("lat", XmlConvert.ToString(node.Node.Latitude));
-        //  writer.WriteAttributeString("lon", XmlConvert.ToString(node.Node.Longitude));
-        //  writer.WriteEndElement(); // trkpt
-        //}
-        //writer.WriteEndElement(); // trkseq
-        //writer.WriteEndElement(); // trk
-
-        writer.WriteEndElement(); // gpx
-      }
-    }
-
-    private static void WriteGPXFileNew(IGraph graph, long[] route, string file) {
+    private static void WriteGPXFile(IGraph graph, long[] route, string file) {
       XmlWriterSettings settings = new XmlWriterSettings();
       settings.Indent = true;
@@ -267,28 +156,4 @@
         }
 
-        //writer.WriteStartElement("rte");
-        //foreach (long nodeId in route) {
-        //  Vertex<Node> node = graph.GetVertex(nodeId);
-        //  writer.WriteStartElement("rtept");
-        //  writer.WriteAttributeString("lat", XmlConvert.ToString(node.Node.Latitude));
-        //  writer.WriteAttributeString("lon", XmlConvert.ToString(node.Node.Longitude));
-        //  writer.WriteEndElement(); // rtept
-        //}
-        //writer.WriteEndElement(); // rte
-
-        //writer.WriteStartElement("trk");
-        //writer.WriteElementString("name", "RoutePath");
-        ////writer.WriteEndElement(); // name
-        //writer.WriteStartElement("trkseq");
-        //foreach (long nodeId in route) {
-        //  Vertex<Node> node = graph.GetVertex(nodeId);
-        //  writer.WriteStartElement("trkpt");
-        //  writer.WriteAttributeString("lat", XmlConvert.ToString(node.Node.Latitude));
-        //  writer.WriteAttributeString("lon", XmlConvert.ToString(node.Node.Longitude));
-        //  writer.WriteEndElement(); // trkpt
-        //}
-        //writer.WriteEndElement(); // trkseq
-        //writer.WriteEndElement(); // trk
-
         writer.WriteEndElement(); // gpx
       }
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.DIMACS/DIMACSDataSource.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.DIMACS/DIMACSDataSource.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.DIMACS/DIMACSDataSource.cs	(revision 8516)
@@ -0,0 +1,121 @@
+﻿using System;
+using System.IO;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.RoutingGraph;
+using ICSharpCode.SharpZipLib.GZip;
+
+namespace HeuristicLab.Problems.RoutePlanning.Data.DIMACS {
+  public class DIMACSDataSource : IDataSource {
+    FileInfo graphFile;
+    FileInfo coordinatesFile;
+
+    IGraph graph;
+
+    public DIMACSDataSource(string coordinates, string inputgraph) {
+      coordinatesFile = new FileInfo(coordinates);
+      graphFile = new FileInfo(inputgraph);
+      graph = new Graph();
+      ReadData();
+    }
+
+    #region IDataSource Members
+
+    public IGraph GetRoutingGraph() {
+      return graph;
+    }
+
+    #endregion
+
+    #region Private Methods
+
+    private void ReadData() {
+      using (FileStream fs = File.OpenRead(coordinatesFile.FullName))
+      using (GZipInputStream input = new GZipInputStream(fs)) {
+        string s = "";
+
+        int i;
+
+        while ((i = input.ReadByte()) != -1) {
+          char c = (char)i;
+          if (c == '\r' || c == '\n') {
+            if (s.StartsWith("c")) {
+              if (s.Length > 1) {
+                // comment
+                Console.WriteLine(s);
+              }
+            } else if (s.StartsWith("p")) {
+              string[] line = s.Split(' ');
+              if (line[1] == "aux" && line[2] == "sp" && line[3] == "co") {
+                int vertices = int.Parse(line[4]);
+                Console.WriteLine("vertices: {0}", vertices);
+              } else {
+                throw new ArgumentException("Wrong problem format");
+              }
+            } else if (s.StartsWith("v")) {
+              string[] line = s.Split(' ');
+
+              long id = int.Parse(line[1]);
+              double lon = double.Parse(line[2]);
+              double lat = double.Parse(line[3]);
+
+              Vertex v = new Vertex(id, lon, lat);
+              graph.AddVertex(v);
+            }
+            s = string.Empty;
+          } else {
+            s += c;
+          }
+        }
+      }
+
+
+      using (FileStream fs = File.OpenRead(graphFile.FullName))
+      using (GZipInputStream input = new GZipInputStream(fs)) {
+        string s = "";
+
+        int i;
+
+        while ((i = input.ReadByte()) != -1) {
+          char c = (char)i;
+          if (c == '\r' || c == '\n') {
+            if (s.StartsWith("c")) {
+              if (s.Length > 1) {
+                // comment
+                Console.WriteLine(s);
+              }
+            } else if (s.StartsWith("p")) {
+              string[] line = s.Split(' ');
+              if (line[1] == "sp") {
+                int vertices = int.Parse(line[2]);
+                int edges = int.Parse(line[3]);
+                Console.WriteLine("vertices: {0}; edges: {1}", vertices, edges);
+              } else {
+                throw new ArgumentException("Wrong problem format");
+              }
+            } else if (s.StartsWith("a")) {
+              string[] line = s.Split(' ');
+
+              long src = int.Parse(line[1]);
+              long dst = int.Parse(line[2]);
+              int len = int.Parse(line[3]);
+
+              Vertex vSrc = graph.GetVertex(src);
+              Vertex vDst = graph.GetVertex(dst);
+
+              Edge<Vertex> edge = new Edge<Vertex>(vSrc, vDst);
+              edge.Weight = len;
+
+              graph.AddEdge(edge);
+
+            }
+            s = string.Empty;
+          } else {
+            s += c;
+          }
+        }
+      }
+    }
+
+    #endregion
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Node.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Node.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Node.cs	(revision 8516)
@@ -0,0 +1,29 @@
+﻿
+using HeuristicLab.Problems.RoutePlanning.Utilities;
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm.Core {
+  public class Node : OsmBase {
+    private PointD point;
+
+    public double Longitude {
+      get { return point.X; }
+      set { point.X = value; }
+    }
+    public double Latitude {
+      get { return point.Y; }
+      set { point.Y = value; }
+    }
+
+    public PointD Point {
+      get { return point; }
+    }
+
+    public Node() {
+      point = new PointD();
+    }
+
+    public Node(long id, double lat, double lon)
+      : base(id) {
+      point = new PointD(lat, lon);
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/OsmBase.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/OsmBase.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/OsmBase.cs	(revision 8516)
@@ -0,0 +1,24 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm.Core {
+  public abstract class OsmBase {
+    public long Id { get; set; }
+    public string User { get; set; }
+    public int UserId { get; set; }
+    public DateTime Timestamp { get; set; }
+    public long Changeset { get; set; }
+    public int Version { get; set; }
+    public bool Visible { get; set; }
+    public IDictionary<string, string> Tags { get; set; }
+
+    public OsmBase() {
+      Tags = new Dictionary<string, string>();
+    }
+
+    public OsmBase(long id) {
+      Id = id;
+      Tags = new Dictionary<string, string>();
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Relation.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Relation.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Relation.cs	(revision 8516)
@@ -0,0 +1,20 @@
+﻿
+using System.Collections.Generic;
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm.Core {
+  public class Relation : OsmBase {
+    private List<RelationMember> members;
+
+    public Relation() {
+      members = new List<RelationMember>();
+    }
+
+    public Relation(long id)
+      : base(id) {
+      members = new List<RelationMember>();
+    }
+
+    public List<RelationMember> Members {
+      get { return members; }
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/RelationMember.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/RelationMember.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/RelationMember.cs	(revision 8516)
@@ -0,0 +1,7 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm.Core {
+  public class RelationMember {
+    public OsmBase Member { get; set; }
+    public string Role { get; set; }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/TagConstants.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/TagConstants.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/TagConstants.cs	(revision 8516)
@@ -0,0 +1,11 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm.Core {
+  public class TagConstants {
+    public const string HighwayTagKey = "highway";
+    public const string JunctionTagKey = "junction";
+    public const string OneWayTag = "oneway";
+    public const string RoundaboutValue = "roundabout";
+    public const string YesValue = "yes";
+    public const string TrueValue = "true";
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Way.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Way.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm.Core/Way.cs	(revision 8516)
@@ -0,0 +1,155 @@
+﻿
+using System;
+using System.Collections.Generic;
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm.Core {
+  #region Highway Types
+
+  // see: https://wiki.openstreetmap.org/wiki/Key:highway
+  public enum HighwayType {
+    null_type,
+    motorway,
+    motorway_link,
+    trunk,
+    trunk_link,
+    primary,
+    primary_link,
+    secondary,
+    secondary_link,
+    tertiary,
+    tertiary_link,
+    living_street,
+    pedestrian,
+    residential,
+    unclassified,
+    service,
+    track,
+    bus_guideway,
+    raceway,
+    road,
+    path,
+    footway,
+    cycleway,
+    bridleway,
+    steps
+  }
+
+  #endregion
+
+  public class Way : OsmBase {
+    private List<Node> nodes;
+
+    public Way() {
+      nodes = new List<Node>();
+    }
+
+    public Way(long id)
+      : base(id) {
+      nodes = new List<Node>();
+    }
+
+    public List<Node> Nodes {
+      get { return nodes; }
+    }
+
+    public HighwayType HighwayTag {
+      get {
+        if (!base.Tags.ContainsKey(TagConstants.HighwayTagKey)) {
+          return HighwayType.null_type;
+        }
+        if (Enum.IsDefined(typeof(HighwayType), base.Tags[TagConstants.HighwayTagKey])) {
+          HighwayType ht = (HighwayType)Enum.Parse(
+            typeof(HighwayType),
+            base.Tags[TagConstants.HighwayTagKey],
+            true);
+          return ht;
+        } else {
+          return HighwayType.null_type;
+        }
+      }
+    }
+
+    public bool OneWay {
+      get {
+        if (base.Tags.ContainsKey(TagConstants.OneWayTag)) {
+          string value = base.Tags[TagConstants.OneWayTag];
+          return value.Equals(TagConstants.YesValue);
+        } else {
+          return false;
+        }
+      }
+    }
+
+    public bool CanBeTraversed(Node source, Node target) {
+      // check if way can be traveld by a specific vehicle (car, public transport, pedestiran, bicycle)
+      // if (!CanBeTraversed(Vehicle)) return false
+      if (OneWay) {
+        // if vehicle == pedestrian or bicylce -> return true
+        int sourceIndex = Nodes.IndexOf(source);
+        int targetIndex = Nodes.IndexOf(target);
+        // order of the nodes determines the driving direction
+        return (sourceIndex < targetIndex);
+      }
+      return true;
+    }
+
+    //public bool CanBeTraversed(Vehicle) {}
+
+    public int GetMaxSpeed() {
+      int speed = 0;
+
+      //TODO: 
+      HighwayType highwayType = HighwayTag;
+      switch (highwayType) {
+        case HighwayType.bridleway:
+        case HighwayType.bus_guideway:
+        case HighwayType.raceway:
+        case HighwayType.cycleway:
+        case HighwayType.footway:
+        case HighwayType.steps:
+        case HighwayType.null_type:
+          speed = 1;
+          break;
+
+        case HighwayType.path:
+        case HighwayType.service:
+        case HighwayType.pedestrian:
+        case HighwayType.living_street:
+          speed = 15;
+          break;
+
+        case HighwayType.road:
+        case HighwayType.track:
+          speed = 30;
+          break;
+
+        case HighwayType.tertiary:
+        case HighwayType.tertiary_link:
+        case HighwayType.secondary:
+        case HighwayType.secondary_link:
+          speed = 80;
+          break;
+
+        case HighwayType.unclassified:
+        case HighwayType.residential:
+          speed = 50;
+          break;
+
+        case HighwayType.trunk:
+        case HighwayType.trunk_link:
+        case HighwayType.primary:
+        case HighwayType.primary_link:
+          speed = 100;
+          break;
+        case HighwayType.motorway:
+        case HighwayType.motorway_link:
+          speed = 130;
+          break;
+
+        default:
+          speed = 1;
+          break;
+      }
+      return speed;
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm/OsmDataSource.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm/OsmDataSource.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Data.Osm/OsmDataSource.cs	(revision 8516)
@@ -0,0 +1,221 @@
+﻿using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Xml;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.RoutingGraph;
+using HeuristicLab.Problems.RoutePlanning.Data.Osm.Core;
+
+namespace HeuristicLab.Problems.RoutePlanning.Data.Osm {
+  public class OsmDataSource : IDataSource {
+    private FileInfo file;
+    private Dictionary<long, Vertex> vertices;
+    private IGraph graph;
+
+    public OsmDataSource(string filename) {
+      file = new FileInfo(filename);
+      graph = new Graph();
+      vertices = new Dictionary<long, Vertex>();
+
+      ReadData();
+    }
+
+    #region IDataSource Members
+
+    public IGraph GetRoutingGraph() {
+      return graph;
+    }
+
+    #endregion
+
+    private Vertex GetVertex(long Id) {
+      Vertex v;
+      if (vertices.TryGetValue(Id, out v)) {
+        return v;
+      } else {
+        return null;
+      }
+    }
+
+    private void ReadData() {
+      XmlReaderSettings settings = new XmlReaderSettings();
+      settings.IgnoreComments = true;
+      settings.IgnoreWhitespace = true;
+
+      using (XmlReader reader = XmlReader.Create(file.FullName, settings)) {
+        reader.ReadStartElement("osm");
+        //reader.ReadStartElement("bounds");
+        reader.Read();
+        while (reader.LocalName.Equals("node")) {
+          double lat = XmlConvert.ToDouble(reader.GetAttribute("lat"));
+          double lon = XmlConvert.ToDouble(reader.GetAttribute("lon"));
+          long id = XmlConvert.ToInt64(reader.GetAttribute("id"));
+
+          Vertex v = new Vertex(id, lon, lat);
+          vertices.Add(v.Id, v);
+
+          reader.Read();
+          if (reader.LocalName.Equals("tag")) {
+            reader.ReadToFollowing("node");
+          }
+        }
+        while (reader.LocalName.Equals("way")) {
+          List<Vertex> way = new List<Vertex>();
+          bool missingNodes = false;
+          HighwayType category = HighwayType.null_type;
+          bool oneWayRoad = false;
+
+          reader.Read();
+          while (reader.LocalName.Equals("nd") || reader.LocalName.Equals("tag")) {
+            if (reader.LocalName.Equals("nd")) {
+              long refNodeId = XmlConvert.ToInt64(reader.GetAttribute("ref"));
+              Vertex vertex = GetVertex(refNodeId);
+              if (vertex != null) {
+                way.Add(vertex);
+              } else {
+                missingNodes = true;
+              }
+
+            } else if (reader.LocalName.Equals("tag")) {
+              string key = reader.GetAttribute("k");
+              string value = reader.GetAttribute("v");
+
+              if (key == TagConstants.HighwayTagKey) {
+                if (Enum.IsDefined(typeof(HighwayType), value)) {
+                  HighwayType ht = (HighwayType)Enum.Parse(typeof(HighwayType), value, true);
+                  category = ht;
+                } else {
+                  category = HighwayType.null_type;
+                }
+              } else if (key == TagConstants.OneWayTag) {
+                oneWayRoad = value.Equals(TagConstants.YesValue);
+              }
+            }
+            reader.Read();
+          }
+          if (missingNodes) {
+            // TODO: Error/Trace output 
+            // if Way xxx has incomplete nodes. At least one node was missing in the data.
+          }
+          for (int i = 0; i < way.Count - 1; i++) {
+            Vertex v1 = way[i];
+            graph.AddVertex(v1);
+            Vertex v2 = way[i + 1];
+            graph.AddVertex(v2);
+            short vertexCategory = (short)category;
+            if (oneWayRoad) {
+              Edge<Vertex> edge = new Edge<Vertex>(v1, v2, vertexCategory);
+              graph.AddEdge(edge);
+            } else {
+              Edge<Vertex> edgeForward = new Edge<Vertex>(v1, v2, vertexCategory);
+              graph.AddEdge(edgeForward);
+
+              Edge<Vertex> edgeBackward = new Edge<Vertex>(v2, v1, vertexCategory);
+              graph.AddEdge(edgeBackward);
+            }
+          }
+          reader.Read();
+        }
+        reader.Close();
+      }
+    }
+
+    private void ReadDataV2() {
+      XmlReaderSettings settings = new XmlReaderSettings();
+      settings.IgnoreComments = true;
+      settings.IgnoreWhitespace = true;
+      NameTable nt = new NameTable();
+      string osmName = nt.Add("osm");
+      object nodeName = nt.Add("node");
+      object tagName = nt.Add("tag");
+      object wayName = nt.Add("way");
+      string latName = nt.Add("lat");
+      string lonName = nt.Add("lon");
+      string idName = nt.Add("id");
+      object ndName = nt.Add("nd");
+      string refName = nt.Add("ref");
+      string kName = nt.Add("k");
+      string vName = nt.Add("v");
+      settings.NameTable = nt;
+      string ns = "";
+
+      using (XmlReader reader = XmlReader.Create(file.FullName, settings)) {
+        reader.ReadStartElement(osmName, ns);
+        reader.Read();
+        while (reader.LocalName.Equals(nodeName)) {
+          double lat = XmlConvert.ToDouble(reader.GetAttribute(latName, ns));
+          double lon = XmlConvert.ToDouble(reader.GetAttribute(lonName, ns));
+          long id = XmlConvert.ToInt64(reader.GetAttribute(idName, ns));
+
+          Vertex v = new Vertex(id, lon, lat);
+          vertices.Add(v.Id, v);
+
+          reader.Read();
+          //if (reader.LocalName.Equals(tagName)) {
+          if (ReferenceEquals(tagName, reader.LocalName)) {
+            reader.ReadToFollowing((string)nodeName, ns);
+          }
+        }
+        //while (reader.LocalName.Equals(wayName)) {
+        while (ReferenceEquals(wayName, reader.LocalName)) {
+          List<Vertex> way = new List<Vertex>();
+          bool missingNodes = false;
+          HighwayType category = HighwayType.null_type;
+          bool oneWayRoad = false;
+
+          reader.Read();
+          while (ReferenceEquals(ndName, reader.LocalName) || ReferenceEquals(tagName, reader.LocalName)) {
+            if (reader.LocalName.Equals(ndName)) {
+              long refNodeId = XmlConvert.ToInt64(reader.GetAttribute(refName, ns));
+              Vertex vertex = GetVertex(refNodeId);
+              if (vertex != null) {
+                way.Add(vertex);
+              } else {
+                missingNodes = true;
+              }
+
+            } else if (reader.LocalName.Equals(tagName)) {
+              string key = reader.GetAttribute(kName, ns);
+              string value = reader.GetAttribute(vName, ns);
+
+              if (key == TagConstants.HighwayTagKey) {
+                if (Enum.IsDefined(typeof(HighwayType), value)) {
+                  HighwayType ht = (HighwayType)Enum.Parse(typeof(HighwayType), value, true);
+                  category = ht;
+                } else {
+                  category = HighwayType.null_type;
+                }
+              } else if (key == TagConstants.OneWayTag) {
+                oneWayRoad = value.Equals(TagConstants.YesValue);
+              }
+            }
+            reader.Read();
+          }
+          if (missingNodes) {
+            // TODO: Error/Trace output 
+            // if Way xxx has incomplete nodes. At least one node was missing in the data.
+          }
+          for (int i = 0; i < way.Count - 1; i++) {
+            Vertex v1 = way[i];
+            graph.AddVertex(v1);
+            Vertex v2 = way[i + 1];
+            graph.AddVertex(v2);
+            short vertexCategory = (short)category;
+            if (oneWayRoad) {
+              Edge<Vertex> edge = new Edge<Vertex>(v1, v2, vertexCategory);
+              graph.AddEdge(edge);
+            } else {
+              Edge<Vertex> edgeForward = new Edge<Vertex>(v1, v2, vertexCategory);
+              graph.AddEdge(edgeForward);
+
+              Edge<Vertex> edgeBackward = new Edge<Vertex>(v2, v1, vertexCategory);
+              graph.AddEdge(edgeBackward);
+            }
+          }
+          reader.Read();
+        }
+        reader.Close();
+      }
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj	(revision 8516)
@@ -57,28 +57,24 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="DIMACS\DIMACSDataSource.cs" />
-    <Compile Include="Graph\EarthDistanceCostCalculator.cs" />
-    <Compile Include="Graph\ICostCalculator.cs" />
-    <Compile Include="Graph\Edge.cs" />
-    <Compile Include="Graph\Graph.cs" />
-    <Compile Include="Graph\IGraph.cs" />
-    <Compile Include="Graph\OsmGraph.cs" />
-    <Compile Include="Graph\IEdge.cs" />
-    <Compile Include="Graph\OsmVertex.cs" />
-    <Compile Include="Graph\Route.cs" />
-    <Compile Include="Graph\TravelTimeCostCalculator.cs" />
-    <Compile Include="Graph\Vertex.cs" />
-    <Compile Include="Osm.Data\OsmDataSource.cs" />
-    <Compile Include="Osm.Data\XmlDataSource.cs" />
-    <Compile Include="Osm\IDataSource.cs" />
-    <Compile Include="Osm\Node.cs" />
-    <Compile Include="Osm\OsmBase.cs" />
-    <Compile Include="Osm\PointD.cs" />
-    <Compile Include="Osm\RectangleD.cs" />
-    <Compile Include="Osm\Relation.cs" />
-    <Compile Include="Osm\RelationMember.cs" />
-    <Compile Include="Osm\TagConstants.cs" />
-    <Compile Include="Osm\Utils.cs" />
-    <Compile Include="Osm\Way.cs" />
+    <Compile Include="Data.DIMACS\DIMACSDataSource.cs" />
+    <Compile Include="RoutingGraph\EarthDistanceCostCalculator.cs" />
+    <Compile Include="Interfaces\ICostCalculator.cs" />
+    <Compile Include="RoutingGraph\Edge.cs" />
+    <Compile Include="RoutingGraph\Graph.cs" />
+    <Compile Include="Interfaces\IGraph.cs" />
+    <Compile Include="Interfaces\IEdge.cs" />
+    <Compile Include="RoutingGraph\TravelTimeCostCalculator.cs" />
+    <Compile Include="RoutingGraph\Vertex.cs" />
+    <Compile Include="Data.Osm\OsmDataSource.cs" />
+    <Compile Include="Interfaces\IDataSource.cs" />
+    <Compile Include="Data.Osm.Core\Node.cs" />
+    <Compile Include="Data.Osm.Core\OsmBase.cs" />
+    <Compile Include="Utilities\PointD.cs" />
+    <Compile Include="Utilities\RectangleD.cs" />
+    <Compile Include="Data.Osm.Core\Relation.cs" />
+    <Compile Include="Data.Osm.Core\RelationMember.cs" />
+    <Compile Include="Data.Osm.Core\TagConstants.cs" />
+    <Compile Include="Utilities\Utils.cs" />
+    <Compile Include="Data.Osm.Core\Way.cs" />
     <Compile Include="Plugin.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
@@ -90,4 +86,5 @@
     <None Include="Properties\AssemblyInfo.cs.frame" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/ICostCalculator.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/ICostCalculator.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/ICostCalculator.cs	(revision 8516)
@@ -0,0 +1,8 @@
+﻿
+using HeuristicLab.Problems.RoutePlanning.RoutingGraph;
+namespace HeuristicLab.Problems.RoutePlanning.Interfaces {
+  public interface ICostCalculator {
+    float Costs(Edge<Vertex> edge);
+    float EstimatedCosts(Vertex source, Vertex destination);
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IDataSource.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IDataSource.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IDataSource.cs	(revision 8516)
@@ -0,0 +1,6 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Interfaces {
+  public interface IDataSource {
+    IGraph GetRoutingGraph();
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IEdge.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IEdge.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IEdge.cs	(revision 8516)
@@ -0,0 +1,7 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Interfaces {
+  public interface IEdge<T> {
+    T Source { get; }
+    T Target { get; }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IGraph.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IGraph.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Interfaces/IGraph.cs	(revision 8516)
@@ -0,0 +1,24 @@
+﻿
+using System.Collections.Generic;
+using HeuristicLab.Problems.RoutePlanning.RoutingGraph;
+namespace HeuristicLab.Problems.RoutePlanning.Interfaces {
+  public interface IGraph {
+    void AddVertex(Vertex vertex);
+    Vertex GetVertex(long id);
+    List<Vertex> GetVertices();
+    void AddEdge(long startId, long endId);
+    void AddEdge(Edge<Vertex> edge);
+    void RemoveEdge(long startId, long endId);
+    bool HasEdge(long startId, long endId);
+    Edge<Vertex> GetEdge(long startId, long endId);
+    List<Edge<Vertex>> GetEdges(long vertexId);
+    List<Edge<Vertex>> GetInEdges(long vertexId);
+    List<Edge<Vertex>> GetOutEdges(long vertexId);
+    Dictionary<long, float> GetNeighborsWithWeight(long id);
+    Dictionary<long, float> GetNeighborsWithWeightReversed(long id);
+    int GetOutDegree(long id);
+    int GetInDegree(long id);
+
+    float EstimatedCosts(long sourceId, long targetId);
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutePlanningProblem.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutePlanningProblem.cs	(revision 8515)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutePlanningProblem.cs	(revision 8516)
@@ -27,7 +27,6 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-using HeuristicLab.Problems.RoutePlanning.Graph;
-using HeuristicLab.Problems.RoutePlanning.Osm;
-using HeuristicLab.Problems.RoutePlanning.Osm.Data;
+using HeuristicLab.Problems.RoutePlanning.Data.Osm;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
 
 namespace HeuristicLab.Problems.RoutePlanning {
@@ -42,5 +41,5 @@
 
     IDataSource dataSource;
-    OsmGraph graph;
+    IGraph graph;
 
     #region Parameter Properties
@@ -105,6 +104,6 @@
     public void LoadData(string file) {
       FileInfo f = new FileInfo(file);
-      dataSource = new XmlDataSource(file);
-      graph = new OsmGraph(dataSource);
+      dataSource = new OsmDataSource(file);
+      graph = dataSource.GetRoutingGraph();
 
       Name = f.Name;
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/EarthDistanceCostCalculator.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/EarthDistanceCostCalculator.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/EarthDistanceCostCalculator.cs	(revision 8516)
@@ -0,0 +1,40 @@
+﻿using System;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+
+namespace HeuristicLab.Problems.RoutePlanning.RoutingGraph {
+  public class EarthDistanceCostCalculator : ICostCalculator {
+    private const double earthMeanRadius = 6371.0 * 1000.0;
+
+    #region ICostCalculator Members
+
+    public float Costs(Edge<Vertex> edge) {
+      return edge.Weight;
+    }
+
+    public float EstimatedCosts(Vertex source, Vertex destination) {
+      return (float)EarthDistance(source.Logitude, source.Latitude, destination.Logitude, destination.Latitude);
+    }
+
+    #endregion
+
+    private double DegToRad(double alpha) {
+      return alpha * Math.PI / 180;
+    }
+
+    private double AngularDistance(double startLon, double startLat, double endLon, double endLat) {
+      double lat1 = DegToRad(startLat);
+      double lat2 = DegToRad(endLat);
+      double long1 = DegToRad(startLon);
+      double long2 = DegToRad(endLat);
+
+      double x = Math.Sin(lat1) * Math.Sin(lat2) + Math.Cos(lat1) * Math.Cos(lat2) * Math.Cos(long1 - long2);
+      x = Math.Min(1, Math.Max(0, x));
+
+      return Math.Acos(x);
+    }
+
+    private double EarthDistance(double startLon, double startLat, double endLon, double endLat) {
+      return earthMeanRadius * AngularDistance(startLon, startLat, endLon, endLat);
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Edge.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Edge.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Edge.cs	(revision 8516)
@@ -0,0 +1,112 @@
+﻿
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+namespace HeuristicLab.Problems.RoutePlanning.RoutingGraph {
+  public class Edge<Vertex> : IEdge<Vertex> {
+    private readonly Vertex source;
+    public Vertex Source {
+      get { return this.source; }
+    }
+
+    private readonly Vertex target;
+    public Vertex Target {
+      get { return this.target; }
+    }
+
+    private short category;
+    public short Category {
+      get { return category; }
+      set { category = value; }
+    }
+
+    private float weight;
+    public float Weight {
+      get { return weight; }
+      set { weight = value; }
+    }
+
+    public Edge(Vertex source, Vertex target)
+      : this(source, target, 0) {
+
+    }
+
+    public Edge(Vertex source, Vertex target, short category) {
+      this.source = source;
+      this.target = target;
+      this.category = category;
+    }
+
+    public override string ToString() {
+      return string.Format("{0}->{1}", this.Source, this.Target);
+    }
+
+    public override bool Equals(object obj) {
+      if (obj is Edge<Vertex>) {
+        Edge<Vertex> e = (obj as Edge<Vertex>);
+        return (this.source.Equals(e.source)) && (this.target.Equals(e.target));
+      }
+      return false;
+    }
+
+    public override int GetHashCode() {
+      return source.GetHashCode() ^ target.GetHashCode();
+    }
+
+    public int GetMaxSpeed() {
+      int speed = 0;
+
+      //TODO: 
+      switch (category) {
+        case 23:
+        case 17:
+        case 18:
+        case 22:
+        case 21:
+        case 24:
+        case 16:
+        case 20:
+        case 15:
+        case 12:
+        case 0:
+          speed = 1;
+          break;
+
+        case 11:
+        case 14:
+          speed = 15;
+          break;
+
+        case 19:
+          speed = 30;
+          break;
+
+        case 9:
+        case 10:
+        case 7:
+        case 8:
+          speed = 80;
+          break;
+
+        case 13:
+          speed = 50;
+          break;
+
+        case 3:
+        case 4:
+        case 5:
+        case 6:
+          speed = 100;
+          break;
+
+        case 1:
+        case 2:
+          speed = 130;
+          break;
+
+        default:
+          speed = 1;
+          break;
+      }
+      return speed;
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Graph.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Graph.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Graph.cs	(revision 8516)
@@ -0,0 +1,184 @@
+﻿
+using System;
+using System.Collections.Generic;
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.Utilities;
+namespace HeuristicLab.Problems.RoutePlanning.RoutingGraph {
+  public class Graph : IGraph {
+    private IDictionary<long, Vertex> vertices;
+    private IDictionary<long, List<Edge<Vertex>>> adjacencyMap;
+    private IDictionary<long, List<Edge<Vertex>>> incidenceMap;
+
+    public Graph() {
+      vertices = new Dictionary<long, Vertex>();
+      adjacencyMap = new Dictionary<long, List<Edge<Vertex>>>();
+      incidenceMap = new Dictionary<long, List<Edge<Vertex>>>();
+    }
+
+    public void AddVertex(Vertex vertex) {
+      if (!vertices.ContainsKey(vertex.Id)) {
+        vertices.Add(vertex.Id, vertex);
+      }
+    }
+
+    public Vertex GetVertex(long id) {
+      Vertex vertex = null;
+      vertices.TryGetValue(id, out vertex);
+      return vertex;
+    }
+
+    public List<Vertex> GetVertices() {
+      return new List<Vertex>(vertices.Values);
+    }
+
+    public void AddEdge(long startId, long endId) {
+      Vertex start = GetVertex(startId);
+      if (start == null) throw new ArgumentException(string.Format("Invalid vertex id {0}", startId), "startId");
+      Vertex end = GetVertex(startId);
+      if (end == null) throw new ArgumentException(string.Format("Invalid vertex id {0}", endId), "endId");
+
+      Edge<Vertex> edge = new Edge<Vertex>(start, end);
+      //edge.Category = -1
+
+      AddEdge(edge);
+    }
+
+    public void AddEdge(Edge<Vertex> edge) {
+      if (!adjacencyMap.ContainsKey(edge.Source.Id)) {
+        adjacencyMap.Add(edge.Source.Id, new List<Edge<Vertex>>());
+      }
+      adjacencyMap[edge.Source.Id].Add(edge);
+
+      if (!incidenceMap.ContainsKey(edge.Target.Id)) {
+        incidenceMap.Add(edge.Target.Id, new List<Edge<Vertex>>());
+      }
+      incidenceMap[edge.Target.Id].Add(edge);
+    }
+
+    public void RemoveEdge(long startId, long endId) {
+      Edge<Vertex> edge = GetEdge(startId, endId);
+      if (edge != null) {
+        adjacencyMap[startId].Remove(edge);
+        incidenceMap[endId].Remove(edge);
+      }
+    }
+
+    public bool HasEdge(long startId, long endId) {
+      Edge<Vertex> edge = GetEdge(startId, endId);
+      return (edge != null);
+    }
+
+    public Edge<Vertex> GetEdge(long startId, long endId) {
+      List<Edge<Vertex>> edges = adjacencyMap[startId];
+      foreach (Edge<Vertex> edge in edges) {
+        if (edge.Target.Id == endId) {
+          return edge;
+        }
+      }
+      return null;
+    }
+
+    public List<Edge<Vertex>> GetInEdges(long vertexId) {
+      List<Edge<Vertex>> edges;
+      if (incidenceMap.TryGetValue(vertexId, out edges)) {
+        return edges;
+      } else {
+        return new List<Edge<Vertex>>();
+      }
+    }
+
+    public int GetInDegree(long vertexId) {
+      return incidenceMap[vertexId].Count;
+    }
+
+    public List<Edge<Vertex>> GetOutEdges(long vertexId) {
+      List<Edge<Vertex>> edges;
+      if (adjacencyMap.TryGetValue(vertexId, out edges)) {
+        return edges;
+      } else {
+        return new List<Edge<Vertex>>();
+      }
+
+    }
+
+    public int GetOutDegree(long vertexId) {
+      return adjacencyMap[vertexId].Count;
+    }
+
+    public List<Edge<Vertex>> GetEdges(long vertexId) {
+      List<Edge<Vertex>> result = new List<Edge<Vertex>>();
+      foreach (Edge<Vertex> edge in GetInEdges(vertexId)) {
+        if (!result.Contains(edge)) {
+          result.Add(edge);
+        }
+      }
+      foreach (Edge<Vertex> edge in GetOutEdges(vertexId)) {
+        if (!result.Contains(edge)) {
+          result.Add(edge);
+        }
+      }
+      return result;
+    }
+
+    public Dictionary<long, float> GetNeighborsWithWeight(long id) {
+      Dictionary<long, float> neighbors = new Dictionary<long, float>();
+      List<Edge<Vertex>> edges = GetOutEdges(id);
+      foreach (Edge<Vertex> edge in edges) {
+        // TODO: check if edge can be traversed (eg. highway tag for car roads, ...)
+        float weight = GetWeight(edge); // TODO:  edge.Weight?
+        neighbors[edge.Target.Id] = weight;
+      }
+      return neighbors;
+    }
+    public Dictionary<long, float> GetNeighborsWithWeightReversed(long id) {
+      Dictionary<long, float> neighbors = new Dictionary<long, float>();
+      List<Edge<Vertex>> edges = GetInEdges(id);
+      foreach (Edge<Vertex> edge in edges) {
+        // TODO: check if edge can be traversed (eg. highway tag for car roads, ...)
+        float weight = GetWeight(edge); // TODO:  edge.Weight?
+        neighbors[edge.Source.Id] = weight;
+      }
+      return neighbors;
+    }
+
+    public float GetWeight(Edge<Vertex> edge) {
+      //double distance = Utils.Distance(edge.Source.Logitude, edge.Source.Latitude,
+      //                                 edge.Target.Logitude, edge.Target.Latitude);
+
+      PointD s = new PointD(edge.Source.Logitude, edge.Source.Latitude);
+      PointD t = new PointD(edge.Target.Logitude, edge.Target.Latitude);
+      double distance = Utils.LocationDistance(s, t);
+
+      int speed = edge.GetMaxSpeed();
+      double weight = (distance / speed) * 60;
+      //double weight = (distance / speed) * 3.6;
+      //double weight = (distance / speed);
+      //double weight = distance;
+      return (float)weight;
+    }
+
+    public float EstimatedCosts(long sourceId, long targetId) {
+      Vertex source = GetVertex(sourceId);
+      Vertex target = GetVertex(targetId);
+      return EstimatedCosts(source, target);
+    }
+
+    public float EstimatedCosts(Vertex source, Vertex target) {
+      //double distance = Utils.Distance(source.Logitude, source.Latitude,
+      //                                 target.Logitude, target.Latitude);
+
+      PointD s = new PointD(source.Logitude, source.Latitude);
+      PointD t = new PointD(target.Logitude, target.Latitude);
+      double distance = Utils.LocationDistance(s, t);
+
+      //int speed = 130;
+      //int speed = 10;
+      int speed = 130;
+      double costs = (distance / speed) * 60;
+      //double costs = (distance / speed) * 3.6;
+      //double costs = (distance / speed);
+      //double costs = distance;
+      return (float)costs;
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/TravelTimeCostCalculator.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/TravelTimeCostCalculator.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/TravelTimeCostCalculator.cs	(revision 8516)
@@ -0,0 +1,30 @@
+﻿
+using HeuristicLab.Problems.RoutePlanning.Interfaces;
+using HeuristicLab.Problems.RoutePlanning.Utilities;
+namespace HeuristicLab.Problems.RoutePlanning.RoutingGraph {
+  public class TravelTimeCostCalculator : ICostCalculator {
+    #region CostCalculator Members
+
+    public float Costs(Edge<Vertex> edge) {
+      double distance = Utils.Distance(edge.Source.Logitude, edge.Source.Latitude,
+                                       edge.Target.Logitude, edge.Target.Latitude);
+      //double distance = Utils.LocationDistance(source.Node.Point, target.Node.Point);
+      int speed = edge.GetMaxSpeed();
+      double weight = (distance / speed) * 3.6;
+      //double weight = (distance / speed);
+      return (float)weight;
+    }
+
+    public float EstimatedCosts(Vertex source, Vertex destination) {
+      double distance = Utils.Distance(source.Logitude, source.Latitude,
+                                       destination.Logitude, destination.Latitude);
+      //double distance = Utils.LocationDistance(source.Node.Point, target.Node.Point);
+      int speed = 130;
+      double costs = (distance / speed) * 3.6;
+      //double costs = (distance / speed);
+      return (float)costs;
+    }
+
+    #endregion
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Vertex.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Vertex.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/RoutingGraph/Vertex.cs	(revision 8516)
@@ -0,0 +1,67 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.RoutingGraph {
+  public class Vertex {
+    private long id;
+    public long Id {
+      get { return id; }
+      set { id = value; }
+    }
+
+    private double longitude;
+    public double Logitude {
+      get { return longitude; }
+      set { longitude = value; }
+    }
+
+    private double latitude;
+    public double Latitude {
+      get { return latitude; }
+      set { latitude = value; }
+    }
+
+    public Vertex(long id) {
+      this.id = id;
+    }
+
+    public Vertex(long id, double longitude, double latitude) {
+      this.id = id;
+      this.longitude = longitude;
+      this.latitude = latitude;
+    }
+
+    public static bool operator ==(Vertex v1, Vertex v2) {
+      if ((object)v1 == null) {
+        if ((object)v2 == null) {
+          return true;
+        }
+        return false;
+      }
+      if ((object)v1 == null && (object)v2 != null) {
+        return false;
+      }
+      return v1.Equals(v2);
+    }
+
+    public static bool operator !=(Vertex v1, Vertex v2) {
+      return !(v1 == v2);
+    }
+
+    public override bool Equals(object obj) {
+      if (obj is Vertex) {
+        Vertex v = (obj as Vertex);
+        return (this.id == v.id); //TODO:
+      }
+      return false;
+    }
+
+    public override int GetHashCode() {
+      return id.GetHashCode() ^ latitude.GetHashCode() ^ longitude.GetHashCode();
+    }
+
+    public override string ToString() {
+      return string.Format("{0}", id);
+    }
+
+
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/PointD.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/PointD.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/PointD.cs	(revision 8516)
@@ -0,0 +1,55 @@
+﻿
+using System.Drawing;
+
+namespace HeuristicLab.Problems.RoutePlanning.Utilities {
+  public struct PointD {
+    public double X;
+    public double Y;
+
+    #region Constructors
+
+    public PointD(double x, double y) {
+      this.X = x;
+      this.Y = y;
+    }
+
+    public PointD(PointD p) {
+      this.X = p.X;
+      this.Y = p.Y;
+    }
+
+    #endregion
+
+    #region Operators
+
+    public static bool operator !=(PointD left, PointD right) {
+      return left.X != right.X || left.Y != right.Y;
+    }
+
+    public static bool operator ==(PointD left, PointD right) {
+      return left.X == right.X && left.Y == right.Y;
+    }
+
+    public static explicit operator PointF(PointD p) {
+      return new PointF((float)p.X, (float)p.Y);
+    }
+
+    #endregion
+
+    #region Overridden Methods
+
+    public override bool Equals(object obj) {
+      if (obj is PointD) {
+        PointD p = (PointD)obj;
+        return (this.X == p.X && this.Y == p.Y);
+      }
+      return false;
+    }
+
+    public override int GetHashCode() {
+      return ((PointF)this).GetHashCode();
+    }
+
+    #endregion
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/RectangleD.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/RectangleD.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/RectangleD.cs	(revision 8516)
@@ -0,0 +1,98 @@
+﻿using System;
+using System.Drawing;
+
+namespace HeuristicLab.Problems.RoutePlanning.Utilities {
+  public class RectangleD {
+    private const int Digits = 4;
+    private double x;
+    private double y;
+    private double width;
+    private double height;
+
+    #region Properties
+
+    public double X {
+      get { return Math.Round(x, Digits); }
+      set { x = value; }
+    }
+
+    public double Y {
+      get { return Math.Round(y, Digits); }
+      set { y = value; }
+    }
+
+    public double Width {
+      get { return Math.Round(width, Digits); }
+      set { width = value; }
+    }
+
+    public double Height {
+      get { return Math.Round(height, Digits); }
+      set { height = value; }
+    }
+
+    public PointD TopLeft {
+      get { return new PointD(X, Y); }
+    }
+
+    public PointD BottomRight {
+      get { return new PointD(X + Width, Y + Height); }
+    }
+
+    public PointD Center {
+      get { return new PointD(X + Width / 2d, Y + Height / 2d); }
+    }
+
+    public double MaxSide {
+      get { return Math.Max(width, height); }
+    }
+
+    public double MinSide {
+      get { return Math.Min(width, height); }
+    }
+
+    #endregion
+
+    #region Constructors
+
+    public RectangleD(double x, double y, double w, double h) {
+      this.x = x;
+      this.y = y;
+      this.width = w;
+      this.height = h;
+    }
+
+    public RectangleD(RectangleD r) {
+      x = r.X;
+      y = r.Y;
+      width = r.Width;
+      height = r.Height;
+    }
+
+    #endregion
+
+    #region Operators
+
+    public static explicit operator RectangleF(RectangleD r) {
+      return new RectangleF((float)r.X, (float)r.Y, (float)r.Width, (float)r.Height);
+    }
+
+    #endregion
+
+    #region Overridden Methods
+
+    public override bool Equals(object obj) {
+      if (obj is RectangleD) {
+        RectangleD r = (RectangleD)obj;
+        return (X == r.X && Y == r.Y && Width == r.Width && Height == r.Height);
+      }
+      return false;
+    }
+
+    public override int GetHashCode() {
+      return ((RectangleF)this).GetHashCode();
+    }
+
+    #endregion
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/Utils.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/Utils.cs	(revision 8516)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Utilities/Utils.cs	(revision 8516)
@@ -0,0 +1,84 @@
+﻿using System;
+using System.Collections.Generic;
+
+namespace HeuristicLab.Problems.RoutePlanning.Utilities {
+  public static class Utils {
+    public static double Distance(PointD p1, PointD p2) {
+      double dx = p2.X - p1.X;
+      double dy = p2.Y - p1.Y;
+      return Math.Sqrt(dx * dx + dy * dy);
+    }
+
+    public static double Distance(double startX, double startY, double endX, double endY) {
+      double dx = endX - startX;
+      double dy = endY - startY;
+      return Math.Sqrt(dx * dx + dy * dy);
+    }
+
+    public static double LocationDistance(PointD p1, PointD p2) {
+      // The Haversine formula
+      /* dlon = lon2 - lon1
+            dlat = lat2 - lat1
+            a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2
+            c = 2 * atan2(sqrt(a), sqrt(1-a)) 
+            d = R * c
+       */
+
+      double lat1Rad = p1.Y * (Math.PI / 180.0);
+      double long1Rad = p1.X * (Math.PI / 180.0);
+      double lat2Rad = p2.Y * (Math.PI / 180.0);
+      double long2Rad = p2.X * (Math.PI / 180.0);
+
+      double longitude = long2Rad - long1Rad;
+      double latitude = lat2Rad - lat1Rad;
+
+      double a = Math.Pow(Math.Sin(latitude / 2.0), 2.0) +
+                   Math.Cos(lat1Rad) * Math.Cos(lat2Rad) *
+                   Math.Pow(Math.Sin(longitude / 2.0), 2.0);
+
+      double c = 2.0 * Math.Asin(Math.Sqrt(a));
+
+      const double earthRadiusKms = 6376.5;
+      double distance = earthRadiusKms * c;
+
+      return distance;
+    }
+
+    public static double PathLength(IList<PointD> points) {
+      double length = 0;
+      for (int i = 1; i < points.Count; i++) {
+        length += Distance((PointD)points[i - 1], (PointD)points[i]);
+      }
+      return length;
+    }
+
+    public static RectangleD FindBox(IList<PointD> points) {
+      double minX = double.MaxValue;
+      double maxX = double.MinValue;
+      double minY = double.MaxValue;
+      double maxY = double.MinValue;
+
+      foreach (PointD p in points) {
+        if (p.X < minX)
+          minX = p.X;
+        if (p.X > maxX)
+          maxX = p.X;
+
+        if (p.Y < minY)
+          minY = p.Y;
+        if (p.Y > maxY)
+          maxY = p.Y;
+      }
+      return new RectangleD(minX, minY, maxX - minX, maxY - minY);
+    }
+
+    public static double PathDistance(IList<PointD> path1, IList<PointD> path2) {
+      double distance = 0;
+      for (int i = 0; i < path1.Count; i++) {
+        distance += Distance((PointD)path1[i], (PointD)path2[i]);
+      }
+      return distance / path1.Count;
+    }
+  }
+}
+
