oldrev / Sandwych.QuickGraph

Sandwych.QuickGraph is a port of the awesome QuickGraph to .NET Standard, it provides generic directed/undirected graph datastructures and algorithms for .NET.
Microsoft Public License
27 stars 6 forks source link

Sandwych.QuickGraph

NuGet Stats Build status Build Status

Generic Graph Data Structures and Algorithms for .NET

Sandwych.QuickGraph is a port of the original QuickGraph project to .NET Standard 1.6+.

QuickGraph provides generic directed/undirected graph datastructures and algorithms for .NET. QuickGraph comes with algorithms such as depth first seach, breath first search, A* search, shortest path, k-shortest path, maximum flow, minimum spanning tree, least common ancestors, etc... QuickGraph supports MSAGL, GLEE, and Graphviz to render the graphs, serialization to GraphML, etc...

QuickGraph is a portable library, i.e. supports .Net 4.0, Silverlight 4.0, Windows Phone 7, XBox 360 and Windows 8 Metro apps. QuickGraph is annotated with Code Contracts.

Other projects using QuickGraph:

NuGet Instructions

PM> Install-Package Sandwych.QuickGraph.Core

A simple example

This example takes a DataSet, builds the graph of table and constraints from the schema and computes the table topological sort (useful to figure order to populate a database):

DataSet ds = new MyDataSet(); // your dataset
var graph = ds.ToGraph();  // wraps the dataset into a DataSetGraph
foreach(DataTable table in graph.TopologicalSort()) // applies a topological sort to the dataset graph
    Console.WriteLine(table.TableName); // in which order should we delete the tables?

License

Sandwych.QuickGraph is licensed to the MS-PL License. More details please see the LICENSE.md file.

History

The design of QuickGraph is inspired from the Boost Graph Library.

Where to go next?