- Timestamp:
- 11/24/14 15:16:59 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.DatasetRefactor/sources/HeuristicLab.Core/3.3/Collections/DirectedGraph/DirectedGraph.cs
r11444 r11571 56 56 : base(original, cloner) { 57 57 vertices = new HashSet<IVertex>(original.vertices.Select(cloner.Clone)); 58 arcs = new HashSet<IArc>(original.arcs.Select(cloner.Clone)); 58 59 // this select preserves the arc order so they are added to the new cloned vertices exactly in the same order 60 var originalArcs = original.Vertices.SelectMany(x => x.InArcs).Select(cloner.Clone); 61 arcs = new HashSet<IArc>(); 59 62 60 63 // add the arcs to the newly cloned vertices 61 foreach (var arc in arcs) { 64 foreach (var arc in originalArcs) { 65 arcs.Add(arc); 62 66 arc.Source.AddArc(arc); 63 67 arc.Target.AddArc(arc); … … 81 85 } 82 86 83 foreach (var arc in arcs ) {87 foreach (var arc in arcs.OrderBy(x => x.Data != null)) { 84 88 var source = arc.Source; 85 89 var target = arc.Target;
Note: See TracChangeset
for help on using the changeset viewer.