Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs	(revision 8478)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs	(revision 8479)
@@ -44,4 +44,62 @@
       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 0:
+          speed = 1;
+          break;
+
+        case 20:
+        case 15:
+        case 12:
+        case 11:
+          speed = 15;
+          break;
+
+        case 19:
+        case 16:
+          speed = 30;
+          break;
+
+        case 9:
+        case 10:
+        case 7:
+        case 8:
+          speed = 80;
+          break;
+
+        case 14:
+        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/Graph/Graph.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs	(revision 8478)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs	(revision 8479)
@@ -2,4 +2,5 @@
 using System;
 using System.Collections.Generic;
+using HeuristicLab.Problems.RoutePlanning.Osm;
 namespace HeuristicLab.Problems.RoutePlanning.Graph {
   public class Graph : IGraph {
@@ -74,5 +75,10 @@
 
     public List<Edge<Vertex>> GetInEdges(long vertexId) {
-      return incidenceMap[vertexId];
+      List<Edge<Vertex>> edges;
+      if (incidenceMap.TryGetValue(vertexId, out edges)) {
+        return edges;
+      } else {
+        return new List<Edge<Vertex>>();
+      }
     }
 
@@ -82,5 +88,11 @@
 
     public List<Edge<Vertex>> GetOutEdges(long vertexId) {
-      return adjacencyMap[vertexId];
+      List<Edge<Vertex>> edges;
+      if (adjacencyMap.TryGetValue(vertexId, out edges)) {
+        return edges;
+      } else {
+        return new List<Edge<Vertex>>();
+      }
+
     }
 
@@ -109,5 +121,5 @@
       foreach (Edge<Vertex> edge in edges) {
         // TODO: check if edge can be traversed (eg. highway tag for car roads, ...)
-        float weight = 1; // TODO:  edge.Weight?
+        float weight = GetWeight(edge); // TODO:  edge.Weight?
         neighbors[edge.Target.Id] = weight;
       }
@@ -119,9 +131,35 @@
       foreach (Edge<Vertex> edge in edges) {
         // TODO: check if edge can be traversed (eg. highway tag for car roads, ...)
-        float weight = 1; // TODO:  edge.Weight?
+        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);
+      //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(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);
+      //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;
+    }
   }
 }
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IGraph.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IGraph.cs	(revision 8478)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IGraph.cs	(revision 8479)
@@ -17,4 +17,6 @@
     int GetOutDegree(long id);
     int GetInDegree(long id);
+
+    float EstimatedCosts(long sourceId, long targetId);
   }
 }
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/Utils.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/Utils.cs	(revision 8478)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/Utils.cs	(revision 8479)
@@ -7,4 +7,10 @@
       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);
     }
