panthernet / GraphX

GraphX for .NET
Apache License 2.0
316 stars 104 forks source link

Edges with same source and target overflow each other #87

Closed EruRorato closed 6 years ago

EruRorato commented 7 years ago

Hello, I'm very happy what I found such a library for creating graphs, but faced a problem when I create two edges with same source and target. I'm using your windows forms example code. I try to add edges like this:

var vlist = dataGraph.Vertices.ToList();
var obj1 = vlist[0];
var obj2 = vlist[1];
DataEdge dataEdge = new DataEdge(obj1, obj2) { Text = line1.Type, ID = line1.Id };
dataEdge = new DataEdge(obj1, obj2) { Text = line2.Type, ID = line2.Id };

Line1 and Line2 have different types and id, for example line1.Type = "Type1", line2.Type = "Type 2". When I build graph I see only "Type1" edge if I set allowParallelEdges=false, but if I set allowParallelEdges = true I see only "Type2". I think what two edges just overflow each other. What should I do to create graph which will show me both edges? Thank you in advance

panthernet commented 7 years ago

Hi, can you make an example project to show the behavior?

SeniuuS commented 7 years ago

Hello, I think you need to set up the ParallelEdgeDistance. I have set mine to 50 and it works fine.

I have : var logic = new GXLogicCore<TVertex, TEdge, BidirectionalGraph<TVertex, TEdge>>(); logic.EnableParallelEdges = true; logic.ParallelEdgeDistance = 50;