QuickGraph - How can I associate Edge with a class? (for example, you can using Vertex)

Q1 - How can I associate Edge with a class? (for example, you can using Vertex)

In my case, there are different types of edges that I want to simulate. So I'm really wondering how I can associate some level of data with Edges (like the edge type).

The graph I used was: http://quickgraph.codeplex.com/wikipage?title=BidirectionalGraph&referringTitle=Documentation

thank

+2
source share
2 answers

. , (.. ), IEdge<T> Edge<T>. , .

.

public class MyEdge<TVertex> : Edge<TVertex>
{
    public string Name { get; set; }

    public MyEdge(TVertex source, TVertex target) : base(source, target)
    {
    }
}

...

var graph = new BidirectionalGraph<int, MyEdge<int>>();
+4

TaggedEdge, .

+3

Source: https://habr.com/ru/post/1742934/


All Articles