Is there any graph data structure implemented for C# [closed]
Asked Answered
D

4

73

I tried to find a graph data structure to reuse in C# without any success. Of course, I can borrow from data structure books but I want it to be more commercially practical(?) Also I would appreciate if you can tell me what the best way of implementing a graph is. Thanks

Decarbonize answered 23/9, 2011 at 17:42 Comment(0)
J
46

QuickGraph

QuickGraph is a graph library for .NET that is inspired by Boost Graph Library.

QuickGraph provides generic directed/undirected graph datastructures and algorithms for .Net 2.0 and up. 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...


There are several ways to build graphs. The C++ Boost Graph Library (BGL) would be your best reference. It implements both adjacency-list, adjacency-matrix and edge-list graphs. Look here for details.

Jablon answered 23/9, 2011 at 18:31 Comment(2)
You expect some sorites marshalling of any kind to make it work for c# as it is a c# question, or ?...Cheongsam
There is another one, called QuikGraph, which forked QuickGraph, and is under active development.Confirmatory
D
43

There is actually a fairly old article in MSDN that covers graph creation in C#, An Extensive Examination of Data Structures Using C# 2.0. Despite its age, it still addresses your question as long as you don't mind creating your own graph class(es).

Deplume answered 23/9, 2011 at 17:50 Comment(2)
@Tae-SungShin Most of the basic concepts and algorithms about the graph theory is older than at least 20 years. So the article is still valid and an up-to-date resource IMHO.Manuel
To keep things interesting, Microsoft keeps shuffling stuff around. A modern link that will take you directly to the above article is: learn.microsoft.com/en-us/previous-versions/…Savill
I
9

Under active development, there is https://www.nuget.org/packages/QuikGraph You can view source code on GitHub https://github.com/KeRNeLith/QuikGraph and also read the wiki https://github.com/KeRNeLith/QuikGraph/wiki

Improve answered 31/7, 2021 at 1:30 Comment(0)
N
0

I have been working on graph theory library for 3 years till now.

It is pretty comprehensive, have a lot of algorithms built in.

I decided to create it because Quick graph was dead and didn't implement features I needed.

https://github.com/Kemsekov/GraphSharp

Newly answered 15/2 at 9:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.