COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lemon/nearest_neighbor_tsp.h

    r1205 r1294  
    33 * This file is a part of LEMON, a generic C++ optimization library.
    44 *
    5  * Copyright (C) 2003-2010
     5 * Copyright (C) 2003-2013
    66 * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
    77 * (Egervary Research Group on Combinatorial Optimization, EGRES).
     
    116116            for (IncEdgeIt e(_gr, n1); e != INVALID; ++e) {
    117117              if (!used[_gr.runningNode(e)] &&
    118                   (_cost[e] < _cost[min_edge1] || min_edge1 == INVALID)) {
     118                  (min_edge1 == INVALID || _cost[e] < _cost[min_edge1])) {
    119119                min_edge1 = e;
    120120              }
     
    125125            for (IncEdgeIt e(_gr, n2); e != INVALID; ++e) {
    126126              if (!used[_gr.runningNode(e)] &&
    127                   (_cost[e] < _cost[min_edge2] || min_edge2 == INVALID)) {
     127                  (min_edge2 == INVALID||_cost[e] < _cost[min_edge2])) {
    128128                min_edge2 = e;
    129129              }
     
    216216      ///
    217217      /// This function copies the found tour as a list of arcs/edges into
    218       /// the given \ref concept::Path "path structure".
     218      /// the given \ref lemon::concepts::Path "path structure".
    219219      ///
    220220      /// \pre run() must be called before using this function.
Note: See TracChangeset for help on using the changeset viewer.