VRPH
1.0
|
#include <SwapEnds.h>
Public Member Functions | |
bool | evaluate (class VRP *V, int i, int j, VRPMove *M) |
bool | move (VRP *V, int u, int i) |
Definition at line 16 of file SwapEnds.h.
bool SwapEnds::evaluate | ( | class VRP * | V, |
int | i, | ||
int | j, | ||
VRPMove * | M | ||
) |
This function takes the routes containing nodes a and v and evaluates the swapping of the ends of the routes following a and v respectively, subject to the provided rules. Example: VRPH_DEPOT-i-a-j-k-l-VRPH_DEPOT and VRPH_DEPOT-t-u-v-x-y-z-VRPH_DEPOT becomes VRPH_DEPOT-i-a-x-y-z-VRPH_DEPOT and VRPH_DEPOT-t-u-v-j-k-l-VRPH_DEPOT
Example: ( a & v input): VRPH_DEPOT-i-a-b-j-k-l-VRPH_DEPOT and VRPH_DEPOT-t-u-v-w-x-y-z-VRPH_DEPOT becomes VRPH_DEPOT-i-a-w-x-y-z-VRPH_DEPOT and VRPH_DEPOT-t-u-v-b-j-k-l-VRPH_DEPOT
Definition at line 15 of file SwapEnds.cpp.
bool SwapEnds::move | ( | VRP * | V, |
int | u, | ||
int | i | ||
) |
This function takes the routes corresponding to nodes a and v and swaps the ends of these routes following a and v respectively. Example: VRPH_DEPOT-i-a-j-k-l-VRPH_DEPOT and VRPH_DEPOT-t-u-v-x-y-z-VRPH_DEPOT becomes VRPH_DEPOT-i-a-x-y-z-VRPH_DEPOT and VRPH_DEPOT-t-u-v-j-k-l-VRPH_DEPOT. If the proposed move is feasible, all solution modifications are made, and the function returns true. Returns false if the move is infeasible.
Definition at line 99 of file SwapEnds.cpp.