X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=yarrg%2Frsvalue.c;fp=yarrg%2Frsvalue.c;h=ad301b0b135fe13cb6602800c54208d3c39583fb;hp=9cc9ec757987ce9230380ab02381bed496a1d5f3;hb=52f5717ff34c5880d7600231df6f0f8e2232c6f4;hpb=8aaade51e5904619daf638d496ce1162138d940f diff --git a/yarrg/rsvalue.c b/yarrg/rsvalue.c index 9cc9ec7..ad301b0 100644 --- a/yarrg/rsvalue.c +++ b/yarrg/rsvalue.c @@ -108,6 +108,7 @@ static int setup_leg_constraints(double max_thing, int legs, const char *wh) { static void add_leg_c(int startrow, int leg, double value) { if (startrow<=0) return; + assert(value > 0); add_constraint(startrow+leg, value); } @@ -243,6 +244,7 @@ void value_route(int nislands, const int *islands) { if (islands[already_d] == di) /* visited this island already since we left s, uninteresting */ goto next_d; + if (d>s && di==si) /* route has returned to si, no need to think more about s */ goto next_s; @@ -252,6 +254,9 @@ void value_route(int nislands, const int *islands) { IslandPair *ip= ipair_get(islands[s], islands[d]); TradesBlock *block= ip->trades; int tradestodo= ip->ntrades; + if (!tradestodo) + goto next_d; + int inblock= 0; int col= lpx_add_cols(lp,ip->ntrades);