Skip to content
Alexandre Rabérin edited this page May 24, 2021 · 9 revisions

QuikGraph

General information

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

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

QuikGraph 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 QuikGraph

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

QuikGraph is available on NuGet in several modules.

Nuget Status QuikGraph (Core)

PM> Install-Package QuikGraph

Nuget Status QuikGraph.Serialization

PM> Install-Package QuikGraph.Serialization

Nuget Status QuikGraph.Graphviz

PM> Install-Package QuikGraph.Graphviz

Nuget Status QuikGraph.Data

PM> Install-Package QuikGraph.Data

Nuget Status QuikGraph.MSAGL

PM> Install-Package QuikGraph.MSAGL

Nuget Status QuikGraph.Petri

PM> Install-Package QuikGraph.Petri

Where to go next