Skip to content
Bruce Markham edited this page Nov 29, 2021 · 26 revisions

FastGraph

General information

FastGraph provides generic directed/undirected graph data structures and algorithms for .NET.

FastGraph comes with algorithms such as depth first search, breath first search, A* search, shortest path, k-shortest path, maximum flow, minimum spanning tree, etc.

FastGraph supports a wide range of targets for maximal compatibility.

  • .NET Standard 1.3+
  • .NET Core 1.0+
  • .NET Framework 3.5+
  • Works under Unity 3D

Supports Source Link

Getting started with FastGraph

A simple example

This example takes a DataSet, builds the graph of tables and constraints from the schema and computes the table topological sort. This can be useful to figure order to populate a database.

var dataSet = new DataSet();             // Get your data set
DataSetGraph graph = dataSet.ToGraph();  // Wraps the dataset into a DataSetGraph
foreach(DataTable table in graph.TopologicalSort()) // Applies a topological sort to the data set graph
{
    Console.WriteLine(table.TableName); // In which order should we delete the tables?
}

See also DataSetGraph.

Packages

FastGraph is available on NuGet in several modules.

Nuget Status FastGraph (Core)

PM> Install-Package FastGraph

Nuget Status FastGraph.Serialization

PM> Install-Package FastGraph.Serialization

Nuget Status FastGraph.Graphviz

PM> Install-Package FastGraph.Graphviz

Nuget Status FastGraph.Data

PM> Install-Package FastGraph.Data

Nuget Status FastGraph.MSAGL

PM> Install-Package FastGraph.MSAGL

Nuget Status FastGraph.Petri

PM> Install-Package FastGraph.Petri

Where to go next