I'm looking for a C# graph library to be used inside Unity3D script.

I'm not looking for pathfinding libraries (I know there are good one available).

I could consider using a path finding library only if it gives me direct access to underlying graph classes (I need nodes and edges, and classic graph algorithms)

The only product I've seen that seems intersting is QuickGraph.

I have the following question:

  1. Is it possible to use QuickGraph inside Unity3d?
  2. If yes. Is this a good idea? Does it have any drawbacks? Is it a quite fast and well written/supported library? Does anyone has ever used it?
  3. Are available other C# graph library that can be easily integrated in Unity3d?
  • 2
    \$\begingroup\$ Are there any specific graph algorithms you need? Graphs themselves are quite easy to represent in any language, so the issue is going to be more about the algorithms. \$\endgroup\$ – Kylotan Sep 28 '12 at 9:54
  • \$\begingroup\$ @Kylotan: well you are right. In fact for the moment I've implemented a graph myself. I realize that the question is a bit vague(maybe should be removed). The point is that actually I don't know it. What I'm doing is building procedural cities for my company. The graph for the moment is used to represent street topology. My goal was to find a general purpose, possibly well written and tested graph library, in such a way that I could rely on it without have to implement and test all by myself.I think Floyd-Warshall,Bellman-Ford,Dijkstra,A*,BFS, DFS should be a good starting point. \$\endgroup\$ – Heisenbug Sep 28 '12 at 10:12

I have to solve a few basic graph problems: find strongly connected components, find best traversal, etc. Quickgraph is the sort of library I'm looking for but the binaries don't work with mono/unity, I'm willing to try compiling it myself but if there's a better option out there I'd much rather start with that.

~ From the Unity forums

Suggestions were:

EDIT: Just found this. Looks like this guy was able to use QuickGraph with Unity, but he doesn't mention how he did it.

Edit 2020: Working QuickGraph core implementation with Unity based on .NET standard https://www.nuget.org/packages/QuikGraph

  • \$\begingroup\$ These may provide access to the graph, but not the algorithms unfortunately. \$\endgroup\$ – Kylotan Sep 28 '12 at 9:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.