Displaying TaggedEdge edges.

Aug 31, 2009 at 10:59 AM

Hi.

I am trying to use your excellent graphing library to display a graph using the TaggedEdge edge type of QuickGraph with a string tag, but I cant get it to display.

Below is the code I am using.

            var g = new BidirectionalGraph<object, TaggedEdge<object, object>>();
            //var g = new BidirectionalGraph<object, IEdge<object>>();

            // add some verticies
            foreach (State s in dfaToGraph.States)
            {
                g.AddVertex(s.GraphingString());
            }

            // add some edges - these need to be named with the symbol
            foreach (State s in dfaToGraph.States)
            {
                foreach (Transition t in dfaToGraph.GetTransitionsFromState(s.Name))
                {
                    var edge = new TaggedEdge<object, object>(t.FromState.GraphingString(), t.ToState.GraphingString(), t.TransitionSymbol.Value);
                    //var edge = new Edge<object>(t.FromState.GraphingString(), t.ToState.GraphingString());
                    g.AddEdge(edge);
                }
            }

            graphLayoutDisplay.DataContext = g;
            graphLayoutDisplay.Relayout();

Using the current code, nothing will be displayed, but if i change the g and edge variables to used the commented lines, it works fine.

Can anyone tell me how to get it displaying correctly, or point me in the direction of some more documentation?

Thanks.

Nov 8, 2009 at 3:32 PM

Hi wraith.

Did you solved your problem? I'm in the same situation.

thanks

regards

Nov 8, 2009 at 6:44 PM

I didnt get it working in the end. I was going to recommend the most recentt discussion topic, but I see you have found it.

Jun 27, 2010 at 11:47 AM
same problem. couldn't find the topic you were talking about...