Using QuickGraph

Setting up your project

  • Add a reference to QuickGraph.dll to your project. QuickGraph provides a version backward compatible with .Net 2.0 or a .Net 3.5 version. The only difference lies in the support for extension methods.
  • Most data structures are defined under the QuickGraph namespace, algorithms are under the QuickGraph.Algorithms namespace.

Identify the vertex and edge types.

The vertex type can be any type as all QuickGraph datastructure are generic. The edge type must implement the IEdge<TVertex> interface:
class FooVertex {} // custom vertex type
class FooEdge : Edge<FooVertex> [] // custom edge type
class FooGraph : AdjacencyGraph<FooVertex, FooEdge> {} // custom graph type

That's it!

Last edited Mar 29, 2009 at 4:00 PM by pelikhan, version 4

Comments

Sandman8 Jan 21, 2014 at 7:12 AM 
For the version 3.6.61114.0 this is also wrong, because the Edge class doesn't have any constructor with 0 arguments.

Cieszak Feb 19, 2010 at 4:01 PM 
small mistake
should be {} instead of []