Skip to content

Using FastGraph

Bruce Markham edited this page Nov 29, 2021 · 1 revision

Using FastGraph

Setting up your project

  • Add a package reference to FastGraph to your project. (<PackageReference Include="FastGraph" Version="X.Y.Z" />). Or if you're not in an environment supporting NuGet, simply add a reference to the FastGraph.dll that fit your constraint target version.
  • Most data structures are defined under the FastGraph namespace, and algorithms are under the FastGraph.Algorithms namespace.

Identify the vertex and edge types

The vertex type can be any type as all FastGraph data structure 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

Clone this wiki locally