Index: /trunk/sources/HeuristicLab.ExtLibs.sln
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs.sln	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs.sln	(revision 14244)
@@ -73,5 +73,5 @@
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.MathJax-2.6.1", "HeuristicLab.ExtLibs\HeuristicLab.MathJax\2.6.1\HeuristicLab.MathJax-2.6.1\HeuristicLab.MathJax-2.6.1.csproj", "{BCDA17A6-5B4A-495C-B182-E856CA081BE6}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.igraph-0.8.0-pre", "HeuristicLab.ExtLibs\HeuristicLab.Igraph\0.8.0-pre\HeuristicLab.Igraph-0.8.0-pre\HeuristicLab.igraph-0.8.0-pre.csproj", "{088D34F2-32EA-43FF-BAA8-22428D5B66BE}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.IGraph-0.8.0-pre", "HeuristicLab.ExtLibs\HeuristicLab.Igraph\0.8.0-pre\HeuristicLab.Igraph-0.8.0-pre\HeuristicLab.IGraph-0.8.0-pre.csproj", "{088D34F2-32EA-43FF-BAA8-22428D5B66BE}"
 EndProject
 Global
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Datatypes.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Datatypes.cs	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Datatypes.cs	(revision 14244)
@@ -23,5 +23,5 @@
 using System.Runtime.InteropServices;
 
-namespace HeuristicLab.igraph {
+namespace HeuristicLab.IGraph {
   #region Structs
   [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
@@ -66,4 +66,64 @@
     IntPtr attr;
   };
+
+  [StructLayout(LayoutKind.Explicit, CharSet = CharSet.Ansi)]
+  internal struct igraph_vs_t {
+    [FieldOffset(0)]
+    internal int type;
+    [FieldOffset(4)]
+    int vid;
+    [FieldOffset(4)]
+    IntPtr vecptr;
+    [FieldOffset(4)]
+    int adj_vid;
+    [FieldOffset(8)]
+    igraph_neimode_t adj_mode;
+    [FieldOffset(4)]
+    int seq_from;
+    [FieldOffset(8)]
+    int seq_to;
+  }
+
+  [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+  unsafe internal struct igraph_arpack_options_t {
+    /* INPUT */
+    internal fixed char bmat[1]; /* I-standard problem, G-generalized */
+    internal int n; /* Dimension of the eigenproblem */
+    internal fixed char which[2]; /* LA, SA, LM, SM, BE */
+    internal int nev; /* Number of eigenvalues to be computed */
+    internal double tol; /* Stopping criterion */
+    internal int ncv; /* Number of columns in V */
+    internal int ldv; /* Leading dimension of V */
+    internal int ishift; /* 0-reverse comm., 1-exact with tridiagonal */
+    internal int mxiter; /* Maximum number of update iterations to take */
+    internal int nb; /* Block size on the recurrence, only 1 works */
+    internal int mode; /* The kind of problem to be solved (1-5)
+                          1: A*x=l*x, A symmetric
+                          2: A*x=l*M*x, A symm. M pos. def.
+                          3: K*x = l*M*x, K symm., M pos. semidef.
+                          4: K*x = l*KG*x, K s. pos. semidef. KG s. indef.
+                          5: A*x = l*M*x, A symm., M symm. pos. semidef. */
+    internal int start; /* 0: random, 1: use the supplied vector */
+    internal int lworkl; /* Size of temporary storage, default is fine */
+    internal double sigma; /* The shift for modes 3,4,5 */
+    internal double sigmai; /* The imaginary part of shift for rnsolve */
+    /* OUTPUT */
+    internal int info; /* What happened, see docs */
+    internal int ierr; /* What happened  in the dseupd call */
+    internal int noiter; /* The number of iterations taken */
+    internal int nconv;
+    internal int numop; /* Number of OP*x operations */
+    internal int numopb; /* Number of B*x operations if BMAT='G' */
+    internal int numreo; /* Number of steps of re-orthogonalizations */
+    /* INTERNAL */
+    internal fixed int iparam[11];
+    internal fixed int ipntr[14];
+  }
+
+  [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
+  internal struct igraph_pagerank_power_options_t {
+    internal int niter;
+    internal double eps;
+  }
   #endregion
 
@@ -74,4 +134,15 @@
     IGRAPH_LAYOUT_AUTOGRID
   };
+  internal enum igraph_pagerank_algo_t {
+    IGRAPH_PAGERANK_ALGO_POWER = 0,
+    IGRAPH_PAGERANK_ALGO_ARPACK = 1,
+    IGRAPH_PAGERANK_ALGO_PRPACK = 2
+  }
+  internal enum igraph_neimode_t {
+    IGRAPH_OUT = 1,
+    IGRAPH_IN = 2,
+    IGRAPH_ALL = 3,
+    IGRAPH_TOTAL = 3
+  }
   #endregion
 }
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/DllImporter.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/DllImporter.cs	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/DllImporter.cs	(revision 14244)
@@ -23,12 +23,12 @@
 using System.Runtime.InteropServices;
 
-namespace HeuristicLab.igraph {
+namespace HeuristicLab.IGraph {
   internal static class DllImporter {
     private const string X86Dll = "igraph-0.8.0-pre-x86.dll";
     private const string X64Dll = "igraph-0.8.0-pre-x64.dll";
-    private readonly static bool X64 = false;
+    private readonly static bool X86 = false;
 
     static DllImporter() {
-      X64 = Environment.Is64BitProcess;
+      X86 = !Environment.Is64BitProcess;
     }
 
@@ -36,9 +36,9 @@
     #region igraph init/finalize
     internal static void igraph_empty(igraph_t graph, int n, bool directed) {
-      if (X64) igraph_empty_x64(graph, n, directed);
-      else igraph_empty_x86(graph, n, directed);
+      if (X86) igraph_empty_x86(graph, n, directed);
+      else igraph_empty_x64(graph, n, directed);
     }
     internal static int igraph_destroy(igraph_t graph) {
-      return X64 ? igraph_destroy_x64(graph) : igraph_destroy_x86(graph);
+      return X86 ? igraph_destroy_x86(graph) : igraph_destroy_x64(graph);
     }
     #endregion
@@ -46,5 +46,61 @@
     #region igraph query
     internal static int igraph_vcount(igraph_t graph) {
-      return X64 ? igraph_vcount_x64(graph) : igraph_vcount_x86(graph);
+      return X86 ? igraph_vcount_x86(graph) : igraph_vcount_x64(graph);
+    }
+    #endregion
+
+    #region igraph characteristics
+    internal static int igraph_density(igraph_t graph, out double density, bool loops) {
+      density = double.NaN;
+      return X86 ? igraph_density_x86(graph, ref density, loops) : igraph_density_x64(graph, ref density, loops);
+    }
+
+    internal static int igraph_pagerank(igraph_t graph, igraph_pagerank_algo_t algo, igraph_vector_t vector, out double value, igraph_vs_t vids, bool directed, double damping, igraph_vector_t weights) {
+      value = 1;
+      var options = IntPtr.Zero;
+      if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_ARPACK) {
+        var arpackoptions = GetDefaultArpackOptions();
+        options = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(igraph_arpack_options_t)));
+        Marshal.StructureToPtr(arpackoptions, options, false);
+      } else if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_POWER) {
+        var poweroptions = GetDefaultPowerOptions();
+        options = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(igraph_pagerank_power_options_t)));
+        Marshal.StructureToPtr(poweroptions, options, false);
+      }
+      try {
+        return X86 ? igraph_pagerank_x86(graph, algo, vector, ref value, vids, directed, damping, weights, options) : igraph_pagerank_x64(graph, algo, vector, ref value, vids, directed, damping, weights, options);
+      } finally {
+        if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_ARPACK) {
+          Marshal.DestroyStructure(options, typeof(igraph_arpack_options_t));
+          Marshal.FreeHGlobal(options);
+        } else if (algo == igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_POWER) {
+          Marshal.DestroyStructure(options, typeof(igraph_pagerank_power_options_t));
+          Marshal.FreeHGlobal(options);
+        }
+      }
+    }
+
+    unsafe private static igraph_arpack_options_t GetDefaultArpackOptions() {
+      var arpackoptions = new igraph_arpack_options_t();
+      arpackoptions.bmat[0] = 'I';
+      arpackoptions.which[0] = arpackoptions.which[1] = 'X';
+      arpackoptions.nev = 1;
+      arpackoptions.ishift = 1;
+      arpackoptions.mxiter = 3000;
+      arpackoptions.nb = 1;
+      arpackoptions.mode = 1;
+      arpackoptions.iparam[0] = arpackoptions.ishift;
+      arpackoptions.iparam[1] = arpackoptions.iparam[4] = arpackoptions.iparam[5] = arpackoptions.iparam[7] = arpackoptions.iparam[8] = arpackoptions.iparam[9] = arpackoptions.iparam[10] = 0;
+      arpackoptions.iparam[2] = arpackoptions.mxiter;
+      arpackoptions.iparam[3] = arpackoptions.nb;
+      arpackoptions.iparam[6] = arpackoptions.mode;
+      return arpackoptions;
+    }
+
+    private static igraph_pagerank_power_options_t GetDefaultPowerOptions() {
+      var poweroptions = new igraph_pagerank_power_options_t();
+      poweroptions.niter = 50;
+      poweroptions.eps = 1e-5;
+      return poweroptions;
     }
     #endregion
@@ -52,5 +108,5 @@
     #region igraph manipulation
     internal static int igraph_add_edge(igraph_t graph, int from, int to) {
-      return X64 ? igraph_add_edge_x64(graph, from, to) : igraph_add_edge_x86(graph, from, to);
+      return X86 ? igraph_add_edge_x86(graph, from, to) : igraph_add_edge_x64(graph, from, to);
     }
     #endregion
@@ -73,4 +129,12 @@
     [DllImport(X64Dll, EntryPoint = "igraph_add_edge", CallingConvention = CallingConvention.Cdecl)]
     private static extern int igraph_add_edge_x64([In, Out]igraph_t graph, int from, int to);
+    [DllImport(X86Dll, EntryPoint = "igraph_density", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_density_x86(igraph_t graph, ref double density, bool loops);
+    [DllImport(X64Dll, EntryPoint = "igraph_density", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_density_x64(igraph_t graph, ref double density, bool loops);
+    [DllImport(X86Dll, EntryPoint = "igraph_pagerank", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_pagerank_x86(igraph_t graph, igraph_pagerank_algo_t algo, [In, Out]igraph_vector_t vector, ref double value, igraph_vs_t vids, bool directed, double damping, igraph_vector_t weights, IntPtr options);
+    [DllImport(X64Dll, EntryPoint = "igraph_pagerank", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_pagerank_x64(igraph_t graph, igraph_pagerank_algo_t algo, [In, Out]igraph_vector_t vector, ref double value, igraph_vs_t vids, bool directed, double damping, igraph_vector_t weights, IntPtr options);
     #endregion
     #endregion
@@ -78,8 +142,8 @@
     #region igraph_rng
     internal static int igraph_rng_get_integer(int l, int h) {
-      return X64 ? igraph_rng_get_integer_x64(igraph_rng_default_x64(), l, h) : igraph_rng_get_integer_x86(igraph_rng_default_x86(), l, h);
+      return X86 ? igraph_rng_get_integer_x86(igraph_rng_default_x86(), l, h) : igraph_rng_get_integer_x64(igraph_rng_default_x64(), l, h);
     }
     internal static int igraph_rng_seed(uint seed) {
-      return X64 ? igraph_rng_seed_x64(igraph_rng_default_x64(), seed) : igraph_rng_seed_x86(igraph_rng_default_x86(), seed);
+      return X86 ? igraph_rng_seed_x86(igraph_rng_default_x86(), seed) : igraph_rng_seed_x64(igraph_rng_default_x64(), seed);
     }
 
@@ -100,20 +164,76 @@
     #endregion
 
+    #region igraph_vector
+    internal static int igraph_vector_init(igraph_vector_t vector, int length) {
+      return X86 ? igraph_vector_init_x86(vector, length) : igraph_vector_init_x64(vector, length);
+    }
+    internal static void igraph_vector_destroy(igraph_vector_t vector) {
+      if (X86) igraph_vector_destroy_x86(vector);
+      else igraph_vector_destroy_x64(vector);
+    }
+    internal static int igraph_vector_copy(igraph_vector_t to, igraph_vector_t from) {
+      return X86 ? igraph_vector_copy_x86(to, from) : igraph_vector_copy_x64(to, from);
+    }
+
+    internal static int igraph_vector_size(igraph_vector_t vector) {
+      return X86 ? igraph_vector_size_x86(vector) : igraph_vector_size_x64(vector);
+    }
+
+    internal static double igraph_vector_e(igraph_vector_t vector, int index) {
+      return X86 ? igraph_vector_e_x86(vector, index) : igraph_vector_e_x64(vector, index);
+    }
+
+    internal static void igraph_vector_set(igraph_vector_t vector, int index, double value) {
+      if (X86) igraph_vector_set_x86(vector, index, value);
+      else igraph_vector_set_x64(vector, index, value);
+    }
+
+    #region Platform specific DLL imports
+    [DllImport(X86Dll, EntryPoint = "igraph_vector_init", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vector_init_x86([In, Out]igraph_vector_t vector, int length);
+    [DllImport(X64Dll, EntryPoint = "igraph_vector_init", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vector_init_x64([In, Out]igraph_vector_t vector, int length);
+    [DllImport(X86Dll, EntryPoint = "igraph_vector_destroy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern void igraph_vector_destroy_x86([In, Out]igraph_vector_t vector);
+    [DllImport(X64Dll, EntryPoint = "igraph_vector_destroy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern void igraph_vector_destroy_x64([In, Out]igraph_vector_t vector);
+    [DllImport(X86Dll, EntryPoint = "igraph_vector_size", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vector_size_x86(igraph_vector_t vector);
+    [DllImport(X64Dll, EntryPoint = "igraph_vector_size", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vector_size_x64(igraph_vector_t vector);
+    [DllImport(X86Dll, EntryPoint = "igraph_vector_e", CallingConvention = CallingConvention.Cdecl)]
+    private static extern double igraph_vector_e_x86(igraph_vector_t vector, int index);
+    [DllImport(X64Dll, EntryPoint = "igraph_vector_e", CallingConvention = CallingConvention.Cdecl)]
+    private static extern double igraph_vector_e_x64(igraph_vector_t vector, int index);
+    [DllImport(X86Dll, EntryPoint = "igraph_vector_set", CallingConvention = CallingConvention.Cdecl)]
+    private static extern double igraph_vector_set_x86([In, Out]igraph_vector_t vector, int index, double value);
+    [DllImport(X64Dll, EntryPoint = "igraph_vector_set", CallingConvention = CallingConvention.Cdecl)]
+    private static extern double igraph_vector_set_x64([In, Out]igraph_vector_t vector, int index, double value);
+    [DllImport(X86Dll, EntryPoint = "igraph_vector_copy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vector_copy_x86([In, Out]igraph_vector_t to, igraph_vector_t from);
+    [DllImport(X64Dll, EntryPoint = "igraph_vector_copy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vector_copy_x64([In, Out]igraph_vector_t to, igraph_vector_t from);
+    #endregion
+    #endregion
+
     #region igraph_matrix
     internal static int igraph_matrix_init(igraph_matrix_t matrix, int nrows, int ncols) {
-      return X64 ? igraph_matrix_init_x64(matrix, nrows, ncols) : igraph_matrix_init_x86(matrix, nrows, ncols);
+      return X86 ? igraph_matrix_init_x86(matrix, nrows, ncols) : igraph_matrix_init_x64(matrix, nrows, ncols);
     }
     internal static void igraph_matrix_destroy(igraph_matrix_t matrix) {
-      if (X64) igraph_matrix_destroy_x64(matrix);
-      else igraph_matrix_destroy_x86(matrix);
+      if (X86) igraph_matrix_destroy_x86(matrix);
+      else igraph_matrix_destroy_x64(matrix);
+    }
+    internal static int igraph_matrix_copy(igraph_matrix_t to, igraph_matrix_t from) {
+      return X86 ? igraph_matrix_copy_x86(to, from) : igraph_matrix_copy_x64(to, from);
     }
 
     internal static double igraph_matrix_e(igraph_matrix_t matrix, int row, int col) {
-      return X64 ? igraph_matrix_e_x64(matrix, row, col) : igraph_matrix_e_x86(matrix, row, col);
+      return X86 ? igraph_matrix_e_x86(matrix, row, col) : igraph_matrix_e_x64(matrix, row, col);
     }
 
     internal static void igraph_matrix_set(igraph_matrix_t matrix, int row, int col, double value) {
-      if (X64) igraph_matrix_set_x64(matrix, row, col, value);
-      else igraph_matrix_set_x86(matrix, row, col, value);
+      if (X86) igraph_matrix_set_x86(matrix, row, col, value);
+      else igraph_matrix_set_x64(matrix, row, col, value);
     }
 
@@ -132,7 +252,11 @@
     private static extern double igraph_matrix_e_x64(igraph_matrix_t matrix, int row, int col);
     [DllImport(X86Dll, EntryPoint = "igraph_matrix_set", CallingConvention = CallingConvention.Cdecl)]
-    private static extern double igraph_matrix_set_x86(igraph_matrix_t matrix, int row, int col, double value);
+    private static extern double igraph_matrix_set_x86([In, Out]igraph_matrix_t matrix, int row, int col, double value);
     [DllImport(X64Dll, EntryPoint = "igraph_matrix_set", CallingConvention = CallingConvention.Cdecl)]
-    private static extern double igraph_matrix_set_x64(igraph_matrix_t matrix, int row, int col, double value);
+    private static extern double igraph_matrix_set_x64([In, Out]igraph_matrix_t matrix, int row, int col, double value);
+    [DllImport(X86Dll, EntryPoint = "igraph_matrix_copy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_matrix_copy_x86([In, Out]igraph_matrix_t to, igraph_matrix_t from);
+    [DllImport(X64Dll, EntryPoint = "igraph_matrix_copy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_matrix_copy_x64([In, Out]igraph_matrix_t to, igraph_matrix_t from);
     #endregion
     #endregion
@@ -140,5 +264,11 @@
     #region igraph_layout
     internal static int igraph_layout_fruchterman_reingold(igraph_t graph, igraph_matrix_t res, bool use_seed, int niter, double start_temp, igraph_layout_grid_t grid, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy) {
-      return X64 ? igraph_layout_fruchterman_reingold_x64(graph, res, use_seed, niter, start_temp, grid, weights, minx, maxx, miny, maxy) : igraph_layout_fruchterman_reingold_x86(graph, res, use_seed, niter, start_temp, grid, weights, minx, maxx, miny, maxy);
+      return X86 ? igraph_layout_fruchterman_reingold_x86(graph, res, use_seed, niter, start_temp, grid, weights, minx, maxx, miny, maxy) : igraph_layout_fruchterman_reingold_x64(graph, res, use_seed, niter, start_temp, grid, weights, minx, maxx, miny, maxy);
+    }
+    internal static int igraph_layout_kamada_kawai(igraph_t graph, igraph_matrix_t res, bool use_seed, int maxiter, double epsilon, double kkconst, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy) {
+      return X86 ? igraph_layout_kamada_kawai_x86(graph, res, use_seed, maxiter, epsilon, kkconst, weights, minx, maxx, miny, maxy) : igraph_layout_kamada_kawai_x64(graph, res, use_seed, maxiter, epsilon, kkconst, weights, minx, maxx, miny, maxy);
+    }
+    internal static int igraph_layout_davidson_harel(igraph_t graph, igraph_matrix_t res, bool use_seed, int maxiter, int fineiter, double cool_fact, double weight_node_dist, double weight_border, double weight_edge_lengths, double weight_edge_crossings, double weight_node_edge_dist) {
+      return X86 ? igraph_layout_davidson_harel_x86(graph, res, use_seed, maxiter, fineiter, cool_fact, weight_node_dist, weight_border, weight_edge_lengths, weight_edge_crossings, weight_node_edge_dist) : igraph_layout_davidson_harel_x64(graph, res, use_seed, maxiter, fineiter, cool_fact, weight_node_dist, weight_border, weight_edge_lengths, weight_edge_crossings, weight_node_edge_dist);
     }
 
@@ -148,7 +278,35 @@
     [DllImport(X64Dll, EntryPoint = "igraph_layout_fruchterman_reingold", CallingConvention = CallingConvention.Cdecl)]
     private static extern int igraph_layout_fruchterman_reingold_x64(igraph_t graph, [In, Out]igraph_matrix_t res, bool use_seed, int niter, double start_temp, igraph_layout_grid_t grid, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy);
-    #endregion
-    #endregion
-
+    [DllImport(X86Dll, EntryPoint = "igraph_layout_kamada_kawai", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_layout_kamada_kawai_x86(igraph_t graph, [In, Out]igraph_matrix_t res, bool use_seed, int maxiter, double epsilon, double kkconst, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy);
+    [DllImport(X64Dll, EntryPoint = "igraph_layout_kamada_kawai", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_layout_kamada_kawai_x64(igraph_t graph, [In, Out]igraph_matrix_t res, bool use_seed, int maxiter, double epsilon, double kkconst, igraph_vector_t weights, igraph_vector_t minx, igraph_vector_t maxx, igraph_vector_t miny, igraph_vector_t maxy);
+    [DllImport(X86Dll, EntryPoint = "igraph_layout_davidson_harel", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_layout_davidson_harel_x86(igraph_t graph, [In, Out]igraph_matrix_t res, bool use_seed, int maxiter, int fineiter, double cool_fact, double weight_node_dist, double weight_border, double weight_edge_lengths, double weight_edge_crossings, double weight_node_edge_dist);
+    [DllImport(X64Dll, EntryPoint = "igraph_layout_davidson_harel", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_layout_davidson_harel_x64(igraph_t graph, [In, Out]igraph_matrix_t res, bool use_seed, int maxiter, int fineiter, double cool_fact, double weight_node_dist, double weight_border, double weight_edge_lengths, double weight_edge_crossings, double weight_node_edge_dist);
+    #endregion
+    #endregion
+
+    #region igraph_iterators
+    internal static int igraph_vs_all(ref igraph_vs_t vs) {
+      return X86 ? igraph_vs_all_x86(ref vs) : igraph_vs_all_x64(ref vs);
+    }
+    internal static void igraph_vs_destroy(ref igraph_vs_t vs) {
+      if (X86) igraph_vs_destroy_x86(ref vs);
+      else igraph_vs_destroy_x64(ref vs);
+    }
+
+    #region Platform specific DLL imports
+    [DllImport(X86Dll, EntryPoint = "igraph_vs_all", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vs_all_x86([In, Out]ref igraph_vs_t vs);
+    [DllImport(X64Dll, EntryPoint = "igraph_vs_all", CallingConvention = CallingConvention.Cdecl)]
+    private static extern int igraph_vs_all_x64([In, Out]ref igraph_vs_t vs);
+    [DllImport(X86Dll, EntryPoint = "igraph_vs_destroy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern void igraph_vs_destroy_x86([In, Out]ref igraph_vs_t vs);
+    [DllImport(X64Dll, EntryPoint = "igraph_vs_destroy", CallingConvention = CallingConvention.Cdecl)]
+    private static extern void igraph_vs_destroy_x64([In, Out]ref igraph_vs_t vs);
+    #endregion
+    #endregion
   }
 }
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/HeuristicLab.igraph-0.8.0-pre.csproj
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/HeuristicLab.igraph-0.8.0-pre.csproj	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/HeuristicLab.igraph-0.8.0-pre.csproj	(revision 14244)
@@ -8,6 +8,6 @@
     <OutputType>Library</OutputType>
     <AppDesignerFolder>Properties</AppDesignerFolder>
-    <RootNamespace>HeuristicLab.igraph</RootNamespace>
-    <AssemblyName>HeuristicLab.igraph-0.8.0-pre</AssemblyName>
+    <RootNamespace>HeuristicLab.IGraph</RootNamespace>
+    <AssemblyName>HeuristicLab.IGraph-0.8.0-pre</AssemblyName>
     <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
     <FileAlignment>512</FileAlignment>
@@ -21,4 +21,5 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
@@ -29,4 +30,5 @@
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
+    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
   <PropertyGroup>
@@ -52,4 +54,5 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="Datatypes.cs" />
+    <Compile Include="Wrappers\Vector.cs" />
   </ItemGroup>
   <ItemGroup>
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Plugin.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Plugin.cs	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Plugin.cs	(revision 14244)
@@ -1,12 +1,32 @@
-﻿
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
 using HeuristicLab.PluginInfrastructure;
 
-namespace HeuristicLab.igraph {
-  [Plugin("HeuristicLab.igraph", "Provides functionality of igraph in HeuristicLab", "0.8.0.0")]
-  [PluginFile("HeuristicLab.igraph-0.8.0-pre.dll", PluginFileType.Assembly)]
+namespace HeuristicLab.IGraph {
+  [Plugin("HeuristicLab.IGraph", "Provides functionality of igraph in HeuristicLab", "0.8.0.0")]
+  [PluginFile("HeuristicLab.IGraph-0.8.0-pre.dll", PluginFileType.Assembly)]
   [PluginFile("igraph-0.8.0-pre-x86.dll", PluginFileType.NativeDll)]
   [PluginFile("igraph-0.8.0-pre-x64.dll", PluginFileType.NativeDll)]
   [PluginFile("igraph-0.8.0-pre-license.txt", PluginFileType.License)]
-  public class HeuristicLabigraphPlugin : PluginBase {
+  public class HeuristicLabIGraphPlugin : PluginBase {
   }
 }
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Properties/AssemblyInfo.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Properties/AssemblyInfo.cs	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Properties/AssemblyInfo.cs	(revision 14244)
@@ -1,3 +1,24 @@
-﻿using System.Reflection;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
 using System.Runtime.InteropServices;
 
@@ -5,6 +26,6 @@
 // set of attributes. Change these attribute values to modify the information
 // associated with an assembly.
-[assembly: AssemblyTitle("HeuristicLab.Igraph-0.8.0-pre")]
-[assembly: AssemblyDescription("Plugin for providing iGraph functionality in HeuristicLab")]
+[assembly: AssemblyTitle("HeuristicLab.IGraph-0.8.0-pre")]
+[assembly: AssemblyDescription("Plugin for providing igraph functionality in HeuristicLab")]
 [assembly: AssemblyConfiguration("")]
 [assembly: AssemblyCompany("HEAL")]
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Graph.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Graph.cs	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Graph.cs	(revision 14244)
@@ -1,9 +1,33 @@
-﻿using System;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
 using System.Collections.Generic;
 
-namespace HeuristicLab.igraph.Wrappers {
-  public class Graph : IDisposable {
+namespace HeuristicLab.IGraph.Wrappers {
+  public sealed class Graph : IDisposable {
     private igraph_t graph;
+    internal igraph_t NativeInstance { get { return graph; } }
+
     public int Vertices { get { return graph.n; } }
+    public bool IsDirected { get { return graph.directed; } }
 
     public Graph() : this(0) { }
@@ -39,12 +63,55 @@
     }
 
-    public double[,] LayoutWithFruchtermanReingold() {
-      return LayoutWithFruchtermanReingold(500, Math.Sqrt(Vertices));
+    public double Density() {
+      double density;
+      DllImporter.igraph_density(graph, out density, false);
+      return density;
     }
-    public double[,] LayoutWithFruchtermanReingold(int niter, double startTemp) {
-      using (var coords = new Matrix(graph.n, 2)) {
-        DllImporter.igraph_layout_fruchterman_reingold(graph, coords.NativeInstance, false, niter, startTemp, igraph_layout_grid_t.IGRAPH_LAYOUT_AUTOGRID, null, null, null, null, null);
-        return coords.ToMatrix();
+
+    public Vector PageRank(double damping = 0.85, Vector weights = null) {
+      var vec = new Vector(Vertices);
+      var all = new igraph_vs_t();
+      DllImporter.igraph_vs_all(ref all);
+      try {
+        double eigenv = 0;
+        DllImporter.igraph_pagerank(graph, igraph_pagerank_algo_t.IGRAPH_PAGERANK_ALGO_PRPACK, vec.NativeInstance, out eigenv, all, IsDirected, damping, weights != null ? weights.NativeInstance : null);
+      } finally {
+        DllImporter.igraph_vs_destroy(ref all);
       }
+      return vec;
+    }
+
+    public Matrix LayoutWithFruchtermanReingold(Matrix initialCoords = null) {
+      return LayoutWithFruchtermanReingold(500, Math.Sqrt(Vertices), initialCoords);
+    }
+    public Matrix LayoutWithFruchtermanReingold(int niter, double startTemp, Matrix initialCoords = null) {
+      if (initialCoords != null && (initialCoords.Rows != graph.n || initialCoords.Columns != 2))
+        throw new ArgumentException("Initial coordinate matrix does not contain the required number of rows and columns.", "initialCoords");
+      var coords = initialCoords != null ? new Matrix(initialCoords) : new Matrix(graph.n, 2);
+      DllImporter.igraph_layout_fruchterman_reingold(graph, coords.NativeInstance, initialCoords != null, niter, startTemp, igraph_layout_grid_t.IGRAPH_LAYOUT_AUTOGRID, null, null, null, null, null);
+      return coords;
+    }
+
+    public Matrix LayoutWithKamadaKawai(Matrix initialCoords = null) {
+      return LayoutWithKamadaKawai(50 * Vertices, 0, Vertices, initialCoords);
+    }
+    public Matrix LayoutWithKamadaKawai(int maxiter, double epsilon, double kkconst, Matrix initialCoords = null) {
+      if (initialCoords != null && (initialCoords.Rows != graph.n || initialCoords.Columns != 2))
+        throw new ArgumentException("Initial coordinate matrix does not contain the required number of rows and columns.", "initialCoords");
+      var coords = initialCoords != null ? new Matrix(initialCoords) : new Matrix(graph.n, 2);
+      DllImporter.igraph_layout_kamada_kawai(graph, coords.NativeInstance, initialCoords != null, maxiter, epsilon, kkconst, null, null, null, null, null);
+      return coords;
+    }
+
+    public Matrix LayoutWithDavidsonHarel(Matrix initialCoords = null) {
+      var density = Density();
+      return LayoutWithDavidsonHarel(10, Math.Max(10, (int)Math.Log(Vertices, 2)), 0.75, 1.0, 0.0, density / 10.0, 1.0 - Math.Sqrt(density), 0.2 * (1 - density), initialCoords);
+    }
+    public Matrix LayoutWithDavidsonHarel(int maxiter, int fineiter, double cool_fact, double weight_node_dist, double weight_border, double weight_edge_lengths, double weight_edge_crossings, double weight_node_edge_dist, Matrix initialCoords = null) {
+      if (initialCoords != null && (initialCoords.Rows != graph.n || initialCoords.Columns != 2))
+        throw new ArgumentException("Initial coordinate matrix does not contain the required number of rows and columns.", "initialCoords");
+      var coords = initialCoords != null ? new Matrix(initialCoords) : new Matrix(graph.n, 2);
+      DllImporter.igraph_layout_davidson_harel(graph, coords.NativeInstance, initialCoords != null, maxiter, fineiter, cool_fact, weight_node_dist, weight_border, weight_edge_lengths, weight_edge_crossings, weight_node_edge_dist);
+      return coords;
     }
   }
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Matrix.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Matrix.cs	(revision 14243)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Matrix.cs	(revision 14244)
@@ -1,8 +1,27 @@
-﻿using System;
-using System.Runtime.InteropServices;
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
 
-namespace HeuristicLab.igraph.Wrappers {
-  [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
-  public class Matrix : IDisposable {
+using System;
+
+namespace HeuristicLab.IGraph.Wrappers {
+  public sealed class Matrix : IDisposable {
     igraph_matrix_t matrix;
     internal igraph_matrix_t NativeInstance { get { return matrix; } }
@@ -11,6 +30,12 @@
 
     public Matrix(int nrow, int ncol) {
+      if (nrow < 0 || ncol < 0) throw new ArgumentException("Rows and Columns must be >= 0");
       matrix = new igraph_matrix_t();
       DllImporter.igraph_matrix_init(matrix, nrow, ncol);
+    }
+    public Matrix(Matrix other) {
+      if (other == null) throw new ArgumentNullException("other");
+      matrix = new igraph_matrix_t();
+      DllImporter.igraph_matrix_copy(matrix, other.NativeInstance);
     }
     ~Matrix() {
Index: /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Vector.cs
===================================================================
--- /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Vector.cs	(revision 14244)
+++ /trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Igraph/0.8.0-pre/HeuristicLab.Igraph-0.8.0-pre/Wrappers/Vector.cs	(revision 14244)
@@ -0,0 +1,78 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+
+namespace HeuristicLab.IGraph.Wrappers {
+  public sealed class Vector : IDisposable {
+    private igraph_vector_t vector;
+
+    internal igraph_vector_t NativeInstance {
+      get { return vector; }
+    }
+
+    public int Length {
+      get { return DllImporter.igraph_vector_size(vector); }
+    }
+
+    public Vector(int length) {
+      if (length < 0) throw new ArgumentException("Rows and Columns must be >= 0");
+      vector = new igraph_vector_t();
+      DllImporter.igraph_vector_init(vector, length);
+    }
+
+    public Vector(Vector other) {
+      if (other == null) throw new ArgumentNullException("other");
+      vector = new igraph_vector_t();
+      DllImporter.igraph_vector_copy(vector, other.NativeInstance);
+    }
+
+    ~Vector() {
+      DllImporter.igraph_vector_destroy(vector);
+    }
+
+    public void Dispose() {
+      if (vector == null) return;
+      DllImporter.igraph_vector_destroy(vector);
+      vector = null;
+      GC.SuppressFinalize(this);
+    }
+
+    public double this[int index] {
+      get {
+        if (index < 0 || index > Length) throw new IndexOutOfRangeException("Trying to get index(" + index + ") of vector(" + Length + ").");
+        return DllImporter.igraph_vector_e(vector, index);
+      }
+      set {
+        if (index < 0 || index > Length) throw new IndexOutOfRangeException("Trying to set index(" + index + ") of vector(" + Length + ").");
+        DllImporter.igraph_vector_set(vector, index, value);
+      }
+    }
+
+    public double[] ToArray() {
+      var result = new double[Length];
+      for (var i = 0; i < result.Length; i++) {
+        result[i] = DllImporter.igraph_vector_e(vector, i);
+      }
+      return result;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphLayoutTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphLayoutTest.cs	(revision 14244)
+++ /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphLayoutTest.cs	(revision 14244)
@@ -0,0 +1,82 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.IGraph.Wrappers;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Tests {
+  [TestClass]
+  public class IGraphLayoutTest {
+    [TestMethod]
+    public void TestFruchtermanReingold() {
+      var graph = new Graph(5, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(1, 2),
+        Tuple.Create(2, 3),
+        Tuple.Create(2, 4),
+        Tuple.Create(3, 4),
+      });
+      Assert.AreEqual(5, graph.Vertices);
+      try {
+        using (var matrix = graph.LayoutWithFruchtermanReingold()) {
+          Assert.AreEqual(5, matrix.Rows);
+          Assert.AreEqual(2, matrix.Columns);
+        }
+      } catch { Assert.Fail("Layouting with fruchterman-reingold using default parameters failed."); }
+
+      try {
+        using (var matrix = new Matrix(1, 1)) {
+          graph.LayoutWithFruchtermanReingold(50, 2, matrix);
+        }
+        Assert.Fail("Layouting with fruchterman-reingold using too little pre-initialized coordinates failed.");
+      } catch (ArgumentException) { }
+
+      try {
+        using (var matrix = new Matrix(7, 3)) {
+          graph.LayoutWithFruchtermanReingold(50, 2, matrix);
+          Assert.Fail("Layouting with fruchterman-reingold using too many pre-initialized coordinates failed.");
+        }
+      } catch (ArgumentException) { }
+
+      try {
+        using (var matrix = new Matrix(5, 2)) {
+          matrix[0, 0] = matrix[0, 1] = 1;
+          matrix[1, 0] = matrix[1, 1] = 2;
+          matrix[2, 0] = matrix[2, 1] = 3;
+          matrix[3, 0] = matrix[3, 1] = 4;
+          matrix[4, 0] = matrix[4, 1] = 5;
+          graph.LayoutWithFruchtermanReingold(50, 2, matrix);
+          Assert.AreEqual(5, matrix.Rows);
+          Assert.AreEqual(2, matrix.Columns);
+          Assert.IsFalse(
+               matrix[0, 0].IsAlmost(1) && matrix[0, 1].IsAlmost(1)
+            && matrix[1, 0].IsAlmost(2) && matrix[1, 1].IsAlmost(2)
+            && matrix[2, 0].IsAlmost(2) && matrix[2, 1].IsAlmost(2)
+            && matrix[3, 0].IsAlmost(2) && matrix[3, 1].IsAlmost(2)
+            && matrix[4, 0].IsAlmost(2) && matrix[4, 1].IsAlmost(2));
+        }
+      } catch { Assert.Fail("Layouting with fruchterman-reingold using pre-initialized coordinates failed."); }
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersGraphTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersGraphTest.cs	(revision 14244)
+++ /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersGraphTest.cs	(revision 14244)
@@ -0,0 +1,128 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using HeuristicLab.Common;
+using HeuristicLab.IGraph.Wrappers;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Tests {
+  [TestClass]
+  public class IGraphWrappersGraphTest {
+    [TestMethod]
+    public void IGraphWrappersGraphConstructionAndFinalization() {
+      var graph = new Graph(5, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(1, 2),
+        Tuple.Create(2, 3),
+        Tuple.Create(2, 4),
+        Tuple.Create(3, 4),
+      });
+      Assert.AreEqual(5, graph.Vertices);
+      Assert.IsFalse(graph.IsDirected);
+
+      graph = new Graph(3, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(1, 2),
+      }, directed: true);
+      Assert.AreEqual(3, graph.Vertices);
+      Assert.IsTrue(graph.IsDirected);
+    }
+
+    [TestMethod]
+    public void TestDensity() {
+      var graph = new Graph(5, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(1, 2),
+        Tuple.Create(2, 3),
+        Tuple.Create(2, 4),
+        Tuple.Create(3, 4),
+      });
+
+      var density = graph.Density();
+      // in un-directed graphs edges count twice
+      Assert.IsTrue(density.IsAlmost(12 / 20.0));
+
+      graph.Dispose();
+
+      graph = new Graph(5, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(1, 2),
+        Tuple.Create(2, 3),
+        Tuple.Create(2, 4),
+        Tuple.Create(3, 4),
+      }, directed: true);
+
+      density = graph.Density();
+      // in directed graphs edges count twice
+      Assert.IsTrue(density.IsAlmost(6 / 20.0));
+    }
+
+    [TestMethod]
+    public void TestPageRank() {
+      var graph = new Graph(4, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(1, 2),
+        Tuple.Create(2, 0),
+        Tuple.Create(3, 2),
+      }, directed: true);
+      var ranks = graph.PageRank();
+      Assert.AreEqual(4, ranks.Length);
+      Assert.AreEqual(0.372, ranks[0], 0.01);
+      Assert.AreEqual(0.195, ranks[1], 0.01);
+      Assert.AreEqual(0.394, ranks[2], 0.01);
+      Assert.AreEqual(0.037, ranks[3], 0.01);
+
+      graph = new Graph(4, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(1, 2),
+        Tuple.Create(2, 3),
+        Tuple.Create(3, 0),
+      }, directed: true);
+      ranks = graph.PageRank();
+      Assert.AreEqual(4, ranks.Length);
+      Assert.AreEqual(0.250, ranks[0], 0.01);
+      Assert.AreEqual(0.250, ranks[1], 0.01);
+      Assert.AreEqual(0.250, ranks[2], 0.01);
+      Assert.AreEqual(0.250, ranks[3], 0.01);
+
+      graph = new Graph(4, new[] {
+        Tuple.Create(0, 1),
+        Tuple.Create(0, 2),
+        Tuple.Create(0, 3),
+        Tuple.Create(1, 0),
+        Tuple.Create(2, 0),
+        Tuple.Create(3, 0),
+      }, directed: true);
+      ranks = graph.PageRank();
+      Assert.AreEqual(4, ranks.Length);
+      Assert.AreEqual(0.480, ranks[0], 0.01);
+      Assert.AreEqual(0.173, ranks[1], 0.01);
+      Assert.AreEqual(0.173, ranks[2], 0.01);
+      Assert.AreEqual(0.173, ranks[3], 0.01);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersMatrixTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersMatrixTest.cs	(revision 14244)
+++ /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersMatrixTest.cs	(revision 14244)
@@ -0,0 +1,64 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.IGraph.Wrappers;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Tests {
+  [TestClass]
+  public class IGraphWrappersMatrixTest {
+    [TestMethod]
+    public void IGraphWrappersMatrixConstructionAndFinalization() {
+      var matrix = new Matrix(3, 2);
+      Assert.AreEqual(3, matrix.Rows);
+      Assert.AreEqual(2, matrix.Columns);
+      Assert.AreEqual(0, matrix[0, 0]);
+      matrix[0, 0] = 4;
+      var other = new Matrix(matrix);
+      Assert.AreEqual(3, other.Rows);
+      Assert.AreEqual(2, other.Columns);
+      Assert.AreEqual(4, other[0, 0]);
+    }
+
+    [TestMethod]
+    public void IGraphWrappersMatrixGetSetTest() {
+      var matrix = new Matrix(3, 2);
+      matrix[0, 0] = matrix[0, 1] = 4;
+      matrix[1, 0] = 3;
+      matrix[1, 1] = 2;
+      matrix[2, 0] = 1.5;
+      matrix[2, 1] = -0.5;
+      Assert.AreEqual(4, matrix[0, 0]);
+      Assert.AreEqual(4, matrix[0, 1]);
+      Assert.AreEqual(3, matrix[1, 0]);
+      Assert.AreEqual(2, matrix[1, 1]);
+      Assert.AreEqual(1.5, matrix[2, 0]);
+      Assert.AreEqual(-0.5, matrix[2, 1]);
+
+      var netmat = matrix.ToMatrix();
+      Assert.AreEqual(3, netmat.GetLength(0));
+      Assert.AreEqual(2, netmat.GetLength(1));
+      for (var i = 0; i < netmat.GetLength(0); i++)
+        for (var j = 0; j < netmat.GetLength(1); j++)
+          Assert.AreEqual(matrix[i, j], netmat[i, j]);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersVectorTest.cs
===================================================================
--- /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersVectorTest.cs	(revision 14244)
+++ /trunk/sources/HeuristicLab.Tests/HeuristicLab.IGraph/IGraphWrappersVectorTest.cs	(revision 14244)
@@ -0,0 +1,58 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using HeuristicLab.IGraph.Wrappers;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace HeuristicLab.Tests {
+  [TestClass]
+  public class IGraphWrappersVectorTest {
+    [TestMethod]
+    public void IGraphWrappersVectorConstructionAndFinalization() {
+      var vector = new Vector(7);
+      Assert.AreEqual(7, vector.Length);
+      Assert.AreEqual(0, vector[0]);
+      vector[0] = 4;
+      var other = new Vector(vector);
+      Assert.AreEqual(7, other.Length);
+      Assert.AreEqual(4, other[0]);
+    }
+
+    [TestMethod]
+    public void IGraphWrappersVectorGetSetTest() {
+      var vector = new Vector(5);
+      vector[0] = vector[1] = 4;
+      vector[2] = 3;
+      vector[3] = 1.5;
+      vector[4] = -0.5;
+      Assert.AreEqual(4, vector[0]);
+      Assert.AreEqual(4, vector[1]);
+      Assert.AreEqual(3, vector[2]);
+      Assert.AreEqual(1.5, vector[3]);
+      Assert.AreEqual(-0.5, vector[4]);
+
+      var netmat = vector.ToArray();
+      Assert.AreEqual(5, netmat.Length);
+      for (var i = 0; i < netmat.Length; i++)
+        Assert.AreEqual(vector[i], netmat[i]);
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.Tests/HeuristicLab.Tests.csproj
===================================================================
--- /trunk/sources/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 14243)
+++ /trunk/sources/HeuristicLab.Tests/HeuristicLab.Tests.csproj	(revision 14244)
@@ -218,4 +218,8 @@
       <HintPath>..\bin\HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4.dll</HintPath>
       <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.igraph-0.8.0-pre, Version=0.8.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\bin\HeuristicLab.igraph-0.8.0-pre.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.MainForm-3.3">
@@ -561,4 +565,8 @@
     <Compile Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4\SubtreeCrossoverTest.cs" />
     <Compile Include="HeuristicLab.Encodings.SymbolicExpressionTreeEncoding-3.4\Util.cs" />
+    <Compile Include="HeuristicLab.IGraph\IGraphWrappersGraphTest.cs" />
+    <Compile Include="HeuristicLab.IGraph\IGraphLayoutTest.cs" />
+    <Compile Include="HeuristicLab.IGraph\IGraphWrappersVectorTest.cs" />
+    <Compile Include="HeuristicLab.IGraph\IGraphWrappersMatrixTest.cs" />
     <Compile Include="HeuristicLab.Persistence-3.3\StorableAttributeTests.cs" />
     <Compile Include="HeuristicLab.Persistence-3.3\UseCases.cs" />
@@ -679,4 +687,5 @@
     </EmbeddedResource>
   </ItemGroup>
+  <ItemGroup />
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
