Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
10/10/14 14:03:01 (10 years ago)
Author:
bburlacu
Message:

#2223: Added check to prevent adding an arc when the source and the target are the same vertex.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Collections/DirectedGraph/DirectedGraph.cs

    r11391 r11444  
    145145      var target = arc.Target;
    146146
     147      if (source == target)
     148        throw new InvalidOperationException("Source and target cannot be the same.");
     149
    147150      if (!vertices.Contains(source) || !vertices.Contains(target))
    148151        throw new InvalidOperationException("Cannot add arc connecting vertices that are not in the graph.");
Note: See TracChangeset for help on using the changeset viewer.