Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs	(revision 8300)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Edge.cs	(revision 8300)
@@ -0,0 +1,23 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Graph {
+  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; }
+    }
+
+    public Edge(Vertex source, Vertex target) {
+      this.source = source;
+      this.target = target;
+    }
+
+    public override string ToString() {
+      return string.Format("{0}->{1}", this.Source, this.Target);
+    }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs	(revision 8300)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Graph.cs	(revision 8300)
@@ -0,0 +1,37 @@
+﻿
+using System.Collections.Generic;
+using HeuristicLab.Problems.RoutePlanning.Osm;
+namespace HeuristicLab.Problems.RoutePlanning.Graph {
+  public class Graph {
+    private IDataSource dataSource;
+    private Dictionary<Node, List<Node>> vertexEdges;
+    private Dictionary<long, Vertex<Node>> vertices;
+    private Dictionary<Way, Dictionary<long, List<Vertex<Node>>>> resolvedList;
+
+    public Graph(IDataSource ds) {
+      dataSource = ds;
+      vertexEdges = new Dictionary<Node, List<Node>>();
+      vertices = new Dictionary<long, Vertex<Node>>();
+      resolvedList = new Dictionary<Way, Dictionary<long, List<Vertex<Node>>>>();
+    }
+
+    public Vertex<Node> GetVertex(long id) {
+      return new Vertex<Node>(dataSource.GetNode(id));
+    }
+
+    public List<Way> GetEdges(Vertex<Node> vertex) {
+      return dataSource.GetWays(vertex.Node);
+    }
+
+    //public Dictionary<long, float> GetNeighbours(long id) {
+    //  Vertex<Node> vertex = GetVertex(id);
+    //  Dictionary<long, float> neighbors = new Dictionary<long, float>();
+    //  IList<Way> edges = GetEdges(vertex);
+    //  foreach (Way edge in edges) {
+
+    //  }
+    //  return null;
+    //}
+
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IEdge.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IEdge.cs	(revision 8300)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/IEdge.cs	(revision 8300)
@@ -0,0 +1,7 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Graph {
+  public interface IEdge<Vertex> {
+    Vertex Source { get; }
+    Vertex Target { get; }
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Vertex.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Vertex.cs	(revision 8300)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Graph/Vertex.cs	(revision 8300)
@@ -0,0 +1,56 @@
+﻿
+namespace HeuristicLab.Problems.RoutePlanning.Graph {
+  public class Vertex<T> {
+    private static long idCounter = 0;
+
+    private long id;
+    public long Id {
+      get { return id; }
+    }
+
+    private T node;
+    public T Node {
+      get { return node; }
+    }
+
+    public Vertex(T node) {
+      this.node = node;
+      this.id = idCounter++;
+    }
+
+    public static bool operator ==(Vertex<T> v1, Vertex<T> 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<T> v1, Vertex<T> v2) {
+      return !(v1 == v2);
+    }
+
+    public override bool Equals(object obj) {
+      if (obj is Vertex<T>) {
+        Vertex<T> graph = (obj as Vertex<T>);
+        return this.Equals(graph);
+      }
+      return false;
+    }
+
+    public override int GetHashCode() {
+      return typeof(T).GetHashCode() ^ this.Node.GetHashCode();
+    }
+
+    public override string ToString() {
+      return string.Format("{0}", this.Node);
+    }
+
+
+  }
+}
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj	(revision 8299)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/HeuristicLab.Problems.RoutePlanning.csproj	(revision 8300)
@@ -56,4 +56,8 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="Graph\Edge.cs" />
+    <Compile Include="Graph\Graph.cs" />
+    <Compile Include="Graph\IEdge.cs" />
+    <Compile Include="Graph\Vertex.cs" />
     <Compile Include="Osm.Data\XmlDataSource.cs" />
     <Compile Include="Osm\IDataSource.cs" />
@@ -74,4 +78,5 @@
     <None Include="Properties\AssemblyInfo.cs.frame" />
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <PropertyGroup>
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm.Data/XmlDataSource.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm.Data/XmlDataSource.cs	(revision 8299)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm.Data/XmlDataSource.cs	(revision 8300)
@@ -10,4 +10,6 @@
     private IDictionary<long, Way> ways;
     private IDictionary<long, Relation> relations;
+
+    private IDictionary<long, List<long>> nodeWays;
 
 
@@ -38,4 +40,6 @@
       relations = new Dictionary<long, Relation>();
 
+      nodeWays = new Dictionary<long, List<long>>();
+
       ReadData();
     }
@@ -55,4 +59,16 @@
       if (ways.ContainsKey(wayId)) {
         return ways[wayId];
+      }
+      return null;
+    }
+
+    public List<Way> GetWays(Node node) {
+      if (nodeWays.ContainsKey(node.Id)) {
+        List<long> wayIds = nodeWays[node.Id];
+        List<Way> result = new List<Way>(wayIds.Count);
+        for (int i = 0; i < wayIds.Count; i++) {
+          result.Add(GetWay(wayIds[i]));
+        }
+        return result;
       }
       return null;
@@ -117,4 +133,5 @@
 
           ways.Add(way.Id, way);
+          InsertNodeWayRelation(way);
 
           reader.Read();
@@ -170,4 +187,13 @@
 
     }
+
+    private void InsertNodeWayRelation(Way way) {
+      foreach (Node node in way.Nodes) {
+        if (!nodeWays.ContainsKey(node.Id)) {
+          nodeWays.Add(node.Id, new List<long>());
+        }
+        nodeWays[node.Id].Add(way.Id);
+      }
+    }
   }
 }
Index: /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/IDataSource.cs
===================================================================
--- /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/IDataSource.cs	(revision 8299)
+++ /branches/RoutePlanning/HeuristicLab.Problems.RoutePlanning/3.3/Osm/IDataSource.cs	(revision 8300)
@@ -1,3 +1,4 @@
 ﻿
+using System.Collections.Generic;
 namespace HeuristicLab.Problems.RoutePlanning.Osm {
   public interface IDataSource {
@@ -5,4 +6,5 @@
     Node GetNode(long nodeId);
     Way GetWay(long wayId);
+    List<Way> GetWays(Node node);
     Relation GetRelation(long relationId);
   }
