Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11060 for trunk/sources


Ignore:
Timestamp:
06/30/14 18:30:14 (10 years ago)
Author:
abeham
Message:

#2204: allow to view subtour in PathTSPTourView

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TravelingSalesman.Views/3.3/PathTSPTourView.cs

    r9456 r11060  
    108108
    109109            using (Graphics graphics = Graphics.FromImage(bitmap)) {
    110               if ((permutation != null) && (permutation.Length == coordinates.Rows) && (permutation.Validate())) {
     110              if (permutation != null && permutation.Length > 1) {
    111111                Point[] tour = new Point[permutation.Length];
    112112                for (int i = 0; i < permutation.Length; i++) {
    113                   tour[i] = points[permutation[i]];
     113                  if (permutation[i] >= 0 && permutation[i] < points.Length)
     114                    tour[i] = points[permutation[i]];
    114115                }
    115116                graphics.DrawPolygon(Pens.Black, tour);
Note: See TracChangeset for help on using the changeset viewer.