Search code examples
c#wpfframeworksgraph-theorygraph-sharp

Building Non-Directed Graphs using Graphsharp framework


Is it possible to generate non-directed graph using the Graphsharp framework in WPF?

I could only manage to generate directed graph, I tried searching it on my own, but didn't figure it out if there is an appropriate class built-in to create such non-directed graph.

Due to lack of the documentation about this framework I ask for your help. Maybe someone has a similar problem.


Solution

  • You may want to convert your graph:

    See GraphLayout.cs specifically where

    • TGraph : class, IBidirectionalGraph
    /// <summary>
    /// THE layout control. Support layout, edge routing and overlap removal algorithms, with multiple layout states.
    /// </summary>
    /// <typeparam name="TVertex">Type of the vertices.</typeparam>
    /// <typeparam name="TEdge">Type of the edges.</typeparam>
    /// <typeparam name="TGraph">Type of the graph.</typeparam>
    public partial class GraphLayout<TVertex, TEdge, TGraph>
        where TVertex : class
        where TEdge : IEdge<TVertex>
        where TGraph : class, IBidirectionalGraph<TVertex, TEdge>
    {